lamp架構之php-fpm配置文件中通過php_admin_value[]或php_value[] 重寫php.ini中的配置
php-fpm的配置 php_admin_value[*] 會覆蓋php.ini中的配置。
如果在lamp架構中瀏覽器訪問php文件的php_info()函數,如果在php-fpm相關配置文件中配置了與php.ini相同的參數,那麼local value和master value都會顯示該php-fpm覆蓋掉php.ini之後的值。
我們看一下下面的案例:
; 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_value可以通過ini_set改變php的運行時狀態。經測試php5.4.16對php_flag報錯無法識別。
; php_admin_value/php_admin_flag - these directives won't be overwritten by
; PHP call 'ini_set'。【強商科技】經驗證,php_admin_value配置後,ini_set()函數也無法改變該配置的值,即運行時狀態不能被ini_set()改變,php_info()的local值也會顯示運行時的配置值。經測試php5.4.16對php_admin_flag 報錯無法識別。
; 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.
; Default Value: nothing is defined by default except the values in php.ini and
; specified at startup with the -d argument
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f [email protected]
;php_flag[display_errors] = off
php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 128M
; Set session path to a directory owned by process user
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session