Reputation: 367
I have just changed the php.ini file for upload_max_filesize
and post_max_size
.Now when i upload an image with size=5M it will display the following error.
HTTP 500 error That’s odd... the website can’t display this page The site may be under maintenance or could have a programming error.
But when i upload an image with small size it will generate no error and the image upload successfully.
How can i fix this problem???
Upvotes: 3
Views: 1714
Reputation: 9045
Run tail -f /var/log/apache2/error.log
or tail -f /var/log/nginx/error.log
depending on the one you have in one terminal and keep it open
Then go to browser and do the actions again which are giving you 500 error. once error occurs, you would see it tailed in the error file in the terminal window.
Check if upload_max_filesize
and post_max_size
are updated in php.ini of the web user and not cli. You can do phpinfo()
and check in browser if the values are reflected correctly. If you are using xamp then check \xampp\apache\logs\error.log
path or use logs
button in the application GUI to see. This step will be the deciding factor for whats the error about.
Even if you have increased the above parameters, server might take some time to process large file, and exceed max_execution_time
. You can check if thats the case, which can be found depending on the error you have seen in step 1.
Restart your apache2 server and also any additional caching mechanism enabled like opcache
for example.
There are 2 more parameters which can affect which are max_input_time
and memory_limit
. I would not suggest increasing these unless thats where error is occurring, specially having too large value in memory_limit
.
Hops this helps.
Upvotes: 1