Apache and PHP filesize upload limits

Q I have a customer on my server who is unable to upload files larger than 500k, yet they have set the /etc/php.ini directive upload_max_filesize = 10M. This should have allowed him to upload his 2-4MB JPEGs without any problem, but he can't. Any file smaller than 500k uploads without a problem. Am I missing something obvious here? I've tried changing the number to 20M and it does the same thing. I know it's working, because if I bring it down to less than 512k it will block smaller files too.

A PHP probably isn't the problem here. Apache also has this parameter to safeguard your server from abuse, and the chances are that Apache is the culprit that's limiting you. I've seen this becoming an issue in Red Hat Enterprise Server 3 as they've set a 512k default. The directive can be found in /etc/httpd/conf.d/php.conf as LimitRequestBody 524288. Just change this to a number that suits your application and restart Apache. You should be good to go.

Follow us on Identi.ca or Twitter

Username:   Password:
Create Account | About TuxRadar