Ubuntu 15.04 nginx php.ini changes do not work

November 24, 2015 11.4k views
PHP WordPress LEMP Nginx

I have tried everything and read about 10 tutorials. I have tried everything.

I’m trying to increase file size, post size limits for Wordpress and the php.ini changes aren’t reflected in phpinfo.php.

The odd thing is it was working up until this morning. It’s like the original php.ini that I edited during installation was overwritten with the default but now the changes don’t update.

Any help is greatly appreciated!

2 Answers

If the changes don’t do anything, either you’re not editing the right file or you’re not restarting the php service on your machine, depending on how php is configured to be run from your web server.

  • I’ve double checked the file - I’ve changed the same one the phpinfo.php file is referencing. I also restarted the php service with a success message as well as nginx.

    • What parameter are you changing? How are you checking that it changed? Which file are you changing?

      • phpinfo.php says the .ini is: /etc/php5/fpm/php.ini which is the file I edited. The parameters I changed are:


        After I restart php and nginx I check phpinfo.php and see the values have not changed.

  • Walk step-by-step on how you are changing the php.ini as you need root permissions to modify that file and to restart the service. I assume since you are using php5-fpm you are also using Nginx. If you are using Apache, you have a different config for it.

Ok I have fixed it by removing PHP and reinstalling. No idea what caused it though.

  • @electricjet

    In some cases, in my experience, the php5-* init script from the repository packages does not always properly function (i.e. I’ve ran in to instances where php5-fpm doesn’t actually kill off the existing processes). In such a case, it’s a good idea to run service php5-fpm stop and then confirm that there are no existing processes still running.

    You can effectively kill any processes by running:

    killall -9 php5-fpm
Have another answer? Share your knowledge.