PHP error Log Simple configuration method _php Tips

Source: Internet
Author: User
Tags fpm memory usage php error php error log

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.

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.