我正在使用nginx和php-fpm。
我的phpinfo页面说php从/etc/php5/fpm/php.ini加载php.ini文件,我尝试更新该文件然后运行
sudo service php-fpm reload
Run Code Online (Sandbox Code Playgroud)
但是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
Run Code Online (Sandbox Code Playgroud)
现在,您可以添加随机配置更改,例如:
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
Run Code Online (Sandbox Code Playgroud)
当然,请确保在更改配置后重新启动FPM,以使其生效。
| 归档时间: |
|
| 查看次数: |
6122 次 |
| 最近记录: |