PHP error configuration

Source: Internet
Author: User
Tags php error php error log
For PHP errors, you must first enable PHP to report errors.

# Vim php. inilog_errors = On # error_reporting = E_ALL & ~ is enabled by default &~ E_DEPRECATED &~ E_STRICT # enabled by default # You can also temporarily switch the currently processed php error level error_reporting (E_ERROR | E_WARNING | E_PARSE) in the PHP code; # the function returns the previous error level



Second, configure the error log path

# Specify the php error log path # vim php. inierror_log =/var/log/php_errors.log # manually open

If the php error log path is not specified, the php error log is written to the error log path of the apache host.



WhenAfter an error is reported in PHPIn addition to writing errors into logs, we can also display the error information directly back to the browser for output.

!! In an online deployment environment, make sure to disable error echo !!

# Vim php. inidisplay_errors = On # manually enable it # You can also temporarily switch the currently processed error echo settings ini_set ('display _ errors ', '1') in php code ');

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.