I am trying to increase post_max_size to 1024MB, I am using ini_get('post_max_size') and phpinfo() to check the setting and post_max_size shows as 128M in both.

some phpinfo() on the server:

PHP Version 5.5.9-1ubuntu4.7
System  Linux Dalaran 3.13.0-49-generic #83-Ubuntu SMP Fri Apr 10 20:11:33 UTC 2015 x86_64
Build Date  Mar 16 2015 20:43:56
Server API  Apache 2.0 Handler
Configuration File (php.ini) Path   /etc/php5/apache2
Loaded Configuration File   /etc/php5/apache2/php.ini
Scan this dir for additional .ini files /etc/php5/apache2/conf.d
Apache Version  Apache/2.4.7 (Ubuntu)
user_dir    no value


669 ; Maximum size of POST data that PHP will accept.
670 ; Its value may be 0 to disable the limit. It is ignored if POST data reading
671 ; is disabled through enable_post_data_reading.
672 ; http://php.net/post-max-size
673 post_max_size = 1024M

I have restarted apache after each change. I also ran a grep on all directories in /etc/php5 and found no other reference to Post_max_size

Changing upload_max_filesize and memory_limit works fine.

No user_dir is set, so it should not be loading any .user.ini files.

Nothing useful in apache error log.

If you have any ideas for what I can check next please tell me.

  • 1
    Have you verified that you're modifying the correct php.ini file? I know I've had a problem like that in the past, and it turned out I was modifying a php.ini file that wasn't even being used. – Jared Apr 15 '15 at 22:08
  • The phpinfo() shows which ini file is being used. Also the other settings that I changed upload_max_filesize & memory_limit worked fine, and I did a grep on the whole php5 directory and did not find a post_max_size in any other ini file. – Andrew Apr 15 '15 at 22:11
  • 1
    PHP settings can also be set in a Apache virtual host configuration, or htaccess. – Zoredache Apr 15 '15 at 22:15

YES! Base on what Zoredache said I did a

:/etc/apache2$ rgrep post *

which found

sites-available/000-default.conf:       php_value post_max_size 128M

so a little

/etc/apache2/sites-available$ sudo vi 000-default.conf

change php_value post_max_size 128M to 1024M and I am done!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.