This example describes the method for configuring the error log in PHP. Share to everyone for your reference, specific 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]
; logging error to PHP-FPM log
; 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 the file, see if the WWW user has write access to the ' php_admin_value[error_log] ' path
Other:
' Php_flag ' Modify the configuration switch in ' php.ini ' form on or off can be modified by ' ini_set '
The configuration value form in ' php_value ' modified ' php.ini ' can be modified by ' ini_set '
' Php_admin_flag ' Modify the configuration switch in ' php.ini ' form on or off cannot be modified by ' ini_set '
The configuration value form in ' php_admin_value ' modified ' php.ini ' cannot be modified by ' ini_set '
More interested in PHP related content readers can view the site topics: "PHP error and Exception handling method summary", "PHP string (String) Usage summary", "PHP Array" Operation Techniques Encyclopedia, "PHP operation and operator Usage Summary", " PHP Network Programming Skills Summary, "Introduction to PHP Basic Grammar", "PHP object-oriented Programming Introductory Course", "Php+mysql Database Operation Introduction" and "PHP common database Operation Skills Summary"
I hope this article will help you with the PHP program design.