To turn off the PHP error script hints

Source: Internet
Author: User
Tags ini php error

The easiest way to do this is to add the following code directly to the PHP program code:

The code is as follows

Error_reporting (e_all^e_notice^e_warning);

You can turn off all notice and warning-level errors.

Put this statement in the functional inclusion file of your script, usually config.php or conn.php to control the output.

Of course, I can also be set in the PHP.ini method is as follows

Open the php.ini file under the PHP installation directory

Find display_errors = on modified to Display_errors = Off

Note: If you have copied the php.ini file to the Windows directory, you must also modify the Display_errors = on in C:windows/php.ini to Display_errors = Off

Solution of display_errors = off failure in PHP. ini

Problem:

PHP settings file PHP. ini is already set display_errors = off, but in the running process, the page will still appear error messages.

Solve:

Open the php.ini file under the PHP installation directory

Find log_errors = off modified to Log_errors = On

Find error_log = filename modified to error_log= "D:phperrlogphp_error.log" (Here's the directory and filename d:phperrlogphp_error.log whatever you take)

Note: If you have copied the php.ini file to the Windows directory, you must also c:windows/php.ini the file.

In addition, Php_error.log must have at least user modification and write permissions, otherwise the error log cannot be exported.

Often see error_reporting (7) Direct meaning: Set the wrong message return level.

Value constant

1 E_error

2 e_warning

4 E_parse

8 E_notice

E_core_error

E_core_warning

E_compile_error

128 E_compile_warning

256 E_user_error

E_user_warning

1024 E_user_notice

2047 E_all

2048 e_strict

However 7=1+2+4

is to show 1 E_error 2 e_warning 4 e_parse when something goes wrong

code as follows  

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.