Reloading nginx & php5-fpm does not update changes to php.ini

I’ve made changes to max_upload_size in /etc/php5/fpm/php.ini and restarted both nginx and php5-fpm services. phpinfo() states that /etc/php5/fpm/php.ini is being loaded but after reloading/restartinb both services, max_upload_size remains unchanged.

Question: A server reboot solved the problem. Why is a reboot required? Did I miss out anything when restarting the services?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

The issue is probably that you never actually restarted php-fpm. I had issues with this as well, apparently theres a bunch of different ways to restart php-fpm, and some of them dont work for certain environments.

https://serverfault.com/questions/189940/how-do-you-restart-php-fpm/506951

Try those and see if they reload it.

Solution 2

I know there is already an answer to this but I also have had a similar problem to this one and Galen‘s answer did not help with me.


My answer is to instead of editing /etc/php5/fpm/php.ini, edit your /etc/php5/fpm/php-fpm.conf file and add to the end something like this:

php_admin_value[memory_limit] = 10M

Where memory_limit is the value you are wanting to edit on your php.ini and 10M… I think you get the picture!

Solution 3

CentOS 7, PHP 5.6, nginx 1.12 use

systemctl reload php-fpm

Solution 4

If doing:
sudo service php-fpm reload

You get errors like:
php-fpm: unrecognized service

(Although you see it like this when doing ps aux | grep php)

Use command:
sudo service --status-all | grep -i fpm
to see the real names of services.

Then do:
sudo service php7.3-fpm reload
to reread php.ini

Solution 5

nginx is in use. whoever in rush editing php.ini like me this might be the correct paths to edit

/etc/php/7.4/fpm/php.ini
/etc/php/7.4/cli/php.ini

then to take effect

service php7.4-fpm restart
service nginx restart

also this one could help to see what process is running and where php.ini is

ps aux | grep php
php -i | grep php.ini

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply