重新加载 nginx 和 php5-fpm 不会更新对 php.ini 的更改

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19453525/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 19:30:25  来源:igfitidea点击:

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

nginxphp

提问by Nyxynyx

I've made changes to max_upload_sizein /etc/php5/fpm/php.iniand restarted both nginx and php5-fpm services. phpinfo()states that /etc/php5/fpm/php.iniis being loaded but after reloading/restartinb both services, max_upload_sizeremains unchanged.

我对max_upload_sizein进行了更改/etc/php5/fpm/php.ini并重新启动了 nginx 和 php5-fpm 服务。phpinfo()各国/etc/php5/fpm/php.ini正在加载,但重装后/ restartinb两种服务,max_upload_size保持不变。

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

问题:服务器重启解决了这个问题。为什么需要重启?重新启动服务时我错过了什么吗?

回答by Galen

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.

问题可能是您从未真正重新启动过 php-fpm。我也遇到了这个问题,显然有很多不同的方法可以重新启动 php-fpm,其中一些方法不适用于某些环境。

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

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

Try those and see if they reload it.

试试这些,看看他们是否重新加载它。

回答by maxisme

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.

我知道已经有答案了,但我也遇到了与此类似的问题,而Galen的回答对我没有帮助。



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

我的答案是不要编辑/etc/php5/fpm/php.ini,而是编辑您的/etc/php5/fpm/php-fpm.conf文件并在末尾添加如下内容:

php_admin_value[memory_limit] = 10M

Where memory_limitis the value you are wanting to edit on your php.iniand 10M... I think you get the picture!

memory_limit您要在您的php.ini10M...上编辑的值在哪里...我想您明白了!

回答by Do Nhu Vy

CentOS 7, PHP 5.6, nginx 1.12 use

CentOS 7、PHP 5.6、nginx 1.12 使用

systemctl reload php-fpm