Nginx php fpm不会加载php.ini设置

Nginx php fpm不会加载php.ini设置,nginx,php,Nginx,Php,我正在使用nginx和php-fpm 我的phpinfo页面说php正在从/etc/php5/fpm/php.ini加载php.ini文件,我尝试更新该文件,然后运行 sudo service php-fpm reload 但是php仍然使用旧的设置,phpinfo显示旧的值,就好像我没有修改任何东西一样 我尝试重新启动php fpm,甚至重新启动我的计算机,但仍然不起作用,它只是无法加载新的php.ini值…您可能需要检查fpm池配置。您还可以在那里设置php.ini设置,在我看来,在使用F

我正在使用nginx和php-fpm

我的phpinfo页面说php正在从/etc/php5/fpm/php.ini加载php.ini文件,我尝试更新该文件,然后运行

sudo service php-fpm reload
但是php仍然使用旧的设置,phpinfo显示旧的值,就好像我没有修改任何东西一样


我尝试重新启动php fpm,甚至重新启动我的计算机,但仍然不起作用,它只是无法加载新的php.ini值…

您可能需要检查fpm池配置。您还可以在那里设置php.ini设置,在我看来,在使用FPM时,这是一个更好的地方

在FPM池配置的末尾,您会发现类似的内容:

; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
;   php_value/php_flag             - you can set classic ini defines which can
;                                    be overwritten from PHP call 'ini_set'.
;   php_admin_value/php_admin_flag - these directives won't be overwritten by
;                                     PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.

; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.

; Note: path INI options can be relative and will be expanded with the prefix
; (pool, global or /usr/local)

; Default Value: nothing is defined by default except the values in php.ini and
;                specified at startup with the -d argument
现在,您可以添加随机配置更改,例如:

php_flag[display_errors] = on

php_admin_flag[log_errors] = on

php_admin_value[memory_limit] = 128M
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i

当然,请确保在更改配置后重新启动FPM,使其生效。

我们在哪里可以找到此FPM池配置文件?@notriouswebmaster,这完全取决于您的安装。例如,我配置了路径,以便配置文件本身位于/usr/local/php/etc中,但当然每个人都有自己的安装方式。检查您的phpinfo页面,它可能会给出提示。