繁体   English   中英

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

[英]php-fpm wont load php.ini settings

我正在使用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,以使其生效。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM