Enable Error Reporting in PHP

Source: Internet
Author: User
Method 1: Add @ before a function with a possible error, and then add ordie () such as @ mysql_connect (...) ordie (DatabaseConnectError) Method 2: Edit php. ini, find display_errors, and change the value to off. (That is, set the value to ON after removing it.) method 3: Before the php script

Method 1: Add @ before a function with a possible error, and then ordie ("") for example: @ mysql_connect (...) ordie ("DatabaseConnectError") Method 2: Edit php. ini, find "display_errors =", and change the value after = to "off. (That is, set the value to ON after removing it.) method 3: Before the php script

Block PHP error messages

Method 1:Add @ before a function that may have an error, and then or die ("")
For example:
@ Mysql_connect (...) or die ("Database Connect Error ")

Method 2:Edit php. ini, find "display_errors =", and change the value after "=" to "off. (That is, remove the one before it, and set the value to ON)

Method 3:Add error_reporting (0) to the php script to block all error messages.
Here, error_reporting configures the error information return level.

Syntax: int error_reporting (int [level]);
Return Value: integer
Function types: PHP system functions

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.