Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

nginx

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?

like image 867
Nyxynyx Avatar asked Oct 18 '13 15:10

Nyxynyx


People also ask

Is nginx reload safe?

The reload command keeps the Nginx server running as it reloads updated configuration files. If Nginx notices a syntax error in any of the configuration files, the reload is aborted and the server keeps running based on old config files. Reloading is safer than restarting Nginx.

Does nginx auto reload config?

nginx -t will test the syntax of the configuration files and ensure that all configuration files referenced are accessible. If the Nginx configuration passes testing, then Nginx will be reloaded with nginx -s reload .

Do you have to restart nginx after config change?

You need to reload or restart Nginx whenever you make changes to its configuration. The reload command loads the new configuration, starts new worker processes with the new configuration, and gracefully shuts down old worker processes.


2 Answers

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!

like image 23
maxisme Avatar answered Sep 19 '22 16:09

maxisme


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.

like image 107
Galen Avatar answered Sep 18 '22 16:09

Galen