I've installed from the official repos the LAMP server. In the file /etc/php5/apache2/php.ini, I've changed:

post_max_size = 8M
upload_max_filesize = 2M


post_max_size = 32M
upload_max_filesize = 16M

After that, I've restarted the apache2 server and also the notebook but when I launch the phpinfo I got post_max_size set to 8MB. The only way to resolve this bug is to set the php_value ..... into an .htaccess but this is not what I want.

How can I resolve this?

  1. Create a php file with <?php phpinfo(); ?> and open it with your browser.
  2. Look for Loaded Configuration File (this shows the actual conf. file in use) and edit upload_max_filesize and set post_max_size to the same value (or make it 0 to disable limit) in that file in root mode.
  3. Execute: sudo service apache2 restart

I had the same problem. I changed these values in these files and now it's working:

➜find /etc -name 'php.ini'

You must set php settings for php "scripts", not only for Apache.


I had the same problem and none of the solutions worked but this superb solution did.

  1. create a php file with <? phpinfo(); ?>

  2. Look for "Scan this dir for additional .ini files".

  3. Go to the above directory and create user.ini file like:-

     post_max_size = 1500M
     upload_max_filesize = 1500M
  4. Restart Apache sudo service apache2 restart

  5. Reload the phpinfo(); file. You will thanks me :)
  • This is the only thing that's worked for me. Hosting on Digital Ocean, using Wordpress with PHP5, Apache2, and Ubuntu 14.04. My god, thank you.
    – JonLim
    Oct 3 '16 at 12:45
  • Yes buddy I thank you for that, very clever solution! none of the previous one did works for me Oct 25 '16 at 15:57

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.