Input PHP errors into the log file

Source: Internet
Author: User

(LAMP) prevents the client browser from displaying PHP code errors and saves the error message to the log file:
Locate the php.ini in the PHP configuration file (as in the/etc/php.ini under Centos6.7), set
Display_errors = off//does not allow error messages to be displayed in the browser
Log_errors = on//Enter the error information into the log file
Error_log =/var/www/html/php_errors_log//Specifies the error log location
Locate the Apache configuration file http.conf (for example,/etc/httpd/conf/httpd.conf under Centos6.7), set
Php_flag display_errors off
Php_value error_reporting 2039
Restart Apache Server
Service httpd Restart
Note:
1, if the log_errors specified directory exists or does not have permissions, the error will be output to the browser
2. The CentOS user who writes the error log to the Log_errors file is Apache (not the Apache server, but a user of CentOS), so be aware of the Apache user's permissions

Input PHP errors into the log file

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.