PHP error Log Simple configuration method

Source: Internet
Author: User
Tags php error php error log
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 '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.