簡體   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