PHP turn on and off error tips

Source: Internet
Author: User

Windows system switch PHP error prompt

If you do not have permission to modify php.ini, you can add the following code to the PHP file:

The code is as follows Copy Code

Ini_set ("Display_errors", "on");

Error_reporting (E_all | E_STRICT);

Of course, if you can modify the php.ini, as follows:

The code is as follows Copy Code

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


In the Linux system to turn on and off error hint method is similar, but I would like to introduce a specific

Linux system under

1. Open the php.ini file.

Take my Ubuntu example, this file is in:/etc/php5/apache2 directory.

2. Search and modify the downlink, change the off value to on

The code is as follows Copy Code
Display_errors = Off

3. Search Downlink

The code is as follows Copy Code
error_reporting = E_all & ~e_notice
or search:
error_reporting = E_all & ~e_deprecated
Amended to
error_reporting = E_all | E_strict

4. Modify Apache's httpd.conf,

Take my Ubuntu example, this file is in the:/etc/apache2/directory, this is a blank file.
Add the following two lines:

The code is as follows Copy Code

Php_flag display_errors on
Php_value error_reporting 2039

5. Restart Apache, OK.

Reboot command::

  code is as follows copy code
sudo/etc/ Init.d/apache2 Restart

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.