This article mainly introduces the PHP error log simple configuration method, a more detailed analysis of the PHP error log configuration involved in the php.ini and php-fpm.conf file configuration related attributes operation skills, the need for friends can refer to the following
The example in this article describes the PHP configuration error log method. Share to everyone for your reference, as follows:
Ini:
; Error log log_errors = on; Display error display_errors = OFF; Log path error_log = "/usr/local/lnmp/php/var/log/error_log"; Error level error_reporting = E_all&~e_notice
Php-fpm.conf:
[Global]; PHP-FPM pid File PID =/usr/local/php/var/run/php-fpm.pid; PHP-FPM error log path error_log =/usr/local/php/var/log/php-fpm.log; PHP-FPM Logging error log level log_level = Notice[www]; Log errors to php-fpm logs; catch_workers_output = yes; Slow log slowlog = Var/log/slow.log; Turn off print log php_flag[display_errors] = off; Error log Php_admin_value[error_log] =/usr/local/php/var/log/www.log; Log error php_admin_flag[log_errors] = on; Memory usage Php_admin_value[memory_limit] = 32M
Attention:
If the error log is not written to a file, see if the WWW user has write access to the ' Php_admin_value[error_log ' path
Other:
' Php_flag ' changes in ' php.ini ' configuration switch form on or off can be modified by ' ini_set '
' Php_value ' Modify the configuration of ' php.ini ' in value form can be modified by ' ini_set '
' Php_admin_flag ' changes in ' php.ini ' configuration switch form on or off can not be modified by ' ini_set '
' Php_admin_value ' modification of configuration value in ' php.ini ' cannot be modified by ' ini_set '