无法在Nginx上更改`upload_max_filesize` [英] Trouble changing `upload_max_filesize` on nginx

查看:312
本文介绍了无法在Nginx上更改`upload_max_filesize`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里看到了其他一些类似的问题,但是大多数答案都是特定于Apache的(使用其.htaccess文件),并且我正在使用nginx.

I've see a few other similar questions on here, but most of the answers are Apache specific (dealing with their .htaccess file) and I'm using nginx.

我在php.ini棒中更改upload_max_filesize时遇到麻烦.我在Debian上使用nginx,php5和wordpress.

I'm having trouble making my change to the upload_max_filesize in php.ini stick. I'm using nginx, php5 and wordpress on Debian.

当我运行phpinfo()时,我看到以下输出:

When I run phpinfo() I see the following output:

Loaded Configuration File /etc/php5/cgi/php.ini

然后我进入相关的.ini文件,更改一些值,然后重新启动nginx.当我启动我为wordpress获得的phpinfo()插件时,它将值报告为不变.

I then go to the relevant .ini file, change a few values, and then restart nginx. When I fire up a phpinfo() plugin I got for wordpress, it reports the values as unchanged.

我不知所措,因为phpinfo()报告它正在从我已更改的文件中加载配置值,但没有报告更改.

I'm at a loss because phpinfo() reports that it is loading config values from the file that I've changed, but it doesn't report the changes.

推荐答案

您可能正在使用FAST CGI:

You might be using FAST CGI:

[webserver] <----> [fcgi daemon]
                        `- [php]

如果重新启动Web服务器,则PHP不会重新启动,因此仍然具有旧的ini值,因为它没有重新加载ini文件.

If you restart the webserver, PHP is not restarted, so still has the old ini values because it didn't reload the ini file.

重新启动fcgi守护程序可以解决该问题,PHP将重新启动,重新读取ini.

Restarting the fcgi daemon solves that issue, PHP will be restarted, re-reading the ini.

某些fcgi守护程序具有一个命令,该命令可以更优雅地重新加载子进程.取决于您使用什么.

Some fcgi daemons have a command that reloads the child processes more gracefully. Depends on what you use.

这篇关于无法在Nginx上更改`upload_max_filesize`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆