PHP debugging Error

Source: Internet
Author: User
When using php for website development, an unfriendly interface appears to Prevent Users From seeing error messages. Therefore, display_errorsOff is usually set in php. ini. However, during development, we sometimes need to open the error message. At this time, you can set ini_set (display_errors, On); error_reportin in the PHP file.

When using php for website development, an unfriendly interface appears to Prevent Users From seeing error messages. Therefore, we usually set display_errors = Off in php. ini. However, during development, we sometimes need to open the error message. At this time, you can set ini_set (display_errors, On); error_reportin in the PHP file.

When using php for website development, an unfriendly interface appears to Prevent Users From seeing error messages. Therefore, the general settings will be set in php. ini:
Display_errors = Off;
However, during development, we sometimes need to open the error message. At this time, you can set in the PHP file:

Ini_set ("display_errors", "On ");
Error_reporting (E_ALL );



However, sometimes we set this in time and still cannot display the syntax errors in php.
This is because the PHP File Syntax Error causes the file to be not executed at all, so the error message is certainly not displayed.

Solution:

Suppose there is a syntax error in php.
You can create a new test. php
Edit the following content in the php file:
Ini_set ("display_errors", "On ");
Error_reporting (E_ALL );
Include ("target file ");
In this way, when you are running test. php, the program will report the error syntax.

Original article address: Go to: PHP debugging error. Thank you for sharing it.

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.