PHP page Disable Error Reporting

Source: Internet
Author: User

disabling error Reporting
error_reporting (0);
#orini_set("Display_errors", "Off");

Turn On Error Reporting

Ini_set ("Display_errors", "on");
#or error_reporting (e_all);

When using PHP to do web site development, in order to prevent users from seeing the error message, and the appearance of the unfriendly interface. Therefore general will be set in php.ini:
Display_errors = OFF;
However, at the time of development, we sometimes need to open the error message. At this point, you can set the following in the PHP file:
1. Ini_set ("Display_errors", "on");
2. error_reporting (E_all);
But sometimes we set this up in time or we can't show the syntax errors in PHP.
This is because the PHP file syntax error causes the file to not be executed at all, so of course the error message is not displayed
Workaround:
Suppose there's a syntax error in this PHP.
You can create a new display_errors.php
Then edit the following in the PHP:
Ini_set ("Display_errors", "on");
Error_reporting (E_all);
Include ("Target file");
This way, when you run display_errors.php, the program will report the error syntax.

What is the difference between error_reporting ("E_all") and Ini_set ("Display_errors", "on")?

The latter is more than the former, the latter is off, the former even E-all is useless

PHP page Disable Error Reporting

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.