Set PHP debugging and debugphp to output all error messages-php Tutorial

Source: Internet
Author: User
Tags php debug
Set PHP debugging and debugphp to output all error messages. debug php and debug php in any environment

Enable php debugging and php debug regardless of the php. ini configuration.

Add it to the first line of the PHP file to be debugged.

Ini_set ('display _ errors ', 1); // error message ini_set ('display _ startup_errors', 1); // php startup error message error_reporting (-1 ); // print out all error messages ini_set ('error _ log', dirname (_ FILE __). '/error_log.txt'); // output error information to a text file

1

2

3

4

Ini_set ('display _ errors ', 1); // error message

Ini_set ('display _ startup_errors ', 1); // php startup error message

Error_reporting (-1); // print all error messages

Ini_set ('error _ log', dirname (_ FILE _). '/error_log.txt'); // output error information to a text FILE

Debug php, debug php. ini configuration in the development environment

; Display error message display_errors = On; display php start error message display_startup_errors = On; log record error message log_errors = On

1

2

3

4

5

6

; Displays error information

Display_errors = On

The php start error message is displayed.

Display_startup_errors = On

; Log record error information

Log_errors = On

Related Article

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.