dave Posted January 8, 2016 Share Posted January 8, 2016 (edited) I've got a user that's having trouble uploading images. So I take a look at my phpinfo.php and see that post_max_size is set to 8M. Figuring the user is trying to upload large images I decide 8m is too small. Simple problem, right? So I toss a php.ini file in the web root. post_max_size = 32M max_execution_time = 300 If I do that, phpinfo() tells me all is well, but my Processwire site stops working entirely. Whether I try to view the homepage or go to /processwire/ all I get is: <h1>Internal Server Error</h1> <p>The server encountered an internal error or misconfiguration and was unable to complete your request.</p> <p>Error has been logged. </p> Setting $config->debug to true doesn't give me any more info on the error, and nothing shows up in my cPanel's Error Log. If I delete every line in php.ini and just leave a blank file, the error still occurs. So it seems like I can't have a php.ini at all. I asked my hosting company if they had another way of changing the post_max_size and they just went ahead and threw another php.ini in there and crashed the site again. Any ideas? Edited January 8, 2016 by dave Link to comment Share on other sites More sharing options...
Tom. Posted January 8, 2016 Share Posted January 8, 2016 Try it without defining a max_execution_time and just the post_max_size also upload_max_filesize. Also if you have them there, they don't need ";" on the end. Link to comment Share on other sites More sharing options...
dave Posted January 8, 2016 Author Share Posted January 8, 2016 Thanks Tom. I've tried various combinations of things in php.ini, and as I mentioned even an empty php.ini. I went ahead and tried just post_max_size and upload_max_filesize as you suggested and got the same result as always. It doesn't seem to matter what's in it, the site just doesn't work if there's a file named php.ini in the web root. Link to comment Share on other sites More sharing options...
Tom. Posted January 8, 2016 Share Posted January 8, 2016 Thanks Tom. I've tried various combinations of things in php.ini, and as I mentioned even an empty php.ini. I went ahead and tried just post_max_size and upload_max_filesize as you suggested and got the same result as always. It doesn't seem to matter what's in it, the site just doesn't work if there's a file named php.ini in the web root. How strange, some hosts block the usage of php.ini. But as you said they added a php.ini file. It would seem weird for them to add it if they didn't support it. From the top of my head I can't see for whatever reason ProcessWire would conflict with php.ini. So I might be tempted to say, even though your host added it, they don't actually support it. I would instead add this to the bottom of your .HTACCESS file: php_value upload_max_filesize 32M php_value post_max_size 32M php_value max_execution_time 300 php_value max_input_time 300 It can also be completely possible that your host has blocked that too. So the final way of doing is via PHP itself. (However I'll have to do some research into where to add that in ProcessWire). Possibly add this at the bottom of /site/config.php/, but I'm just guessing there. ini_set('post_max_size', '64M'); ini_set('upload_max_filesize', '64M'); I really would recommend against adding it via PHP. Link to comment Share on other sites More sharing options...
SiNNuT Posted January 8, 2016 Share Posted January 8, 2016 Have you instead of php.ini tried putting the settings in a file called .user.ini placed in your public_html? I mention this because i see a reference to this in the phpinfo(). 3 Link to comment Share on other sites More sharing options...
SiNNuT Posted January 8, 2016 Share Posted January 8, 2016 @Tom it looks like the server is cgi/fastcgi so i don't think you can do php value in htaccess, this will also cause 500 errors. 1 Link to comment Share on other sites More sharing options...
dave Posted January 8, 2016 Author Share Posted January 8, 2016 @SiNNut That succeeded in changing the local values in my phpinfo() and it didn't crash the site. Thanks! Still having an issue with some uploads, but that's probably a topic for another thread. 1 Link to comment Share on other sites More sharing options...
diogo Posted January 8, 2016 Share Posted January 8, 2016 Welcome to the forum, by the way 1 Link to comment Share on other sites More sharing options...
SiNNuT Posted January 9, 2016 Share Posted January 9, 2016 Glad that that worked out dave. To be honest i find it pretty strange that your hoster was not able to solve this, even worse they tried putting a php.ini in your root themselves. Shouldn't they know how their stuff is configured? It's not related to PW as far as i can tell. Link to comment Share on other sites More sharing options...
dave Posted January 9, 2016 Author Share Posted January 9, 2016 Yah, I'm going to let them know how I solved it. Small web-hosting company of the client's choice. They're quick to reply to e-mails at least. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now