PHP Warning: POST Content-Length exceeds the limit

PHP Warning: POST Content-Length of xxxxx bytes exceeds the limit of xxxxxx bytes in Unknown on line 0

You receive the “POST Content-Length” error message when a file greater than the size defined in the php.ini file is uploaded via the browser.

The file you are uploading using the POST method should not exceed the value of post_max_size defined in php.ini file. If it does, it results in the above error message.

Solution:
In case you are looking to upload a larger file size, you need to increase the value of “post_max_size” in php.ini.

1) To locate the exact php.ini file, your PHP is using

php -i | grep php.ini

2) Edit the php configuration file

pico /usr/local/lib/php.ini

3) If you are looking to upload a file of 30M, set post_max_size and to upload_max_filesize to 40M.

post_max_size = 40M
upload_max_filesize = 40M

4) Save the file and restart the httpd service

service httpd restart

You should be done now.

This entry was posted on Friday, November 13th, 2009 and is filed under Linux Administration. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

One Response to “PHP Warning: POST Content-Length exceeds the limit”

  1. appoicachonry

    winsome answers i like it