Php enable and disable error prompt is applicable to php. ini modification permissions, error prompt php. ini_PHP tutorial

Source: Internet
Author: User
The php enabling and disabling error message is applicable to the failure to modify php. ini. the error message is "php. ini. Php enabling and disabling error prompt is applicable to php not modified. ini permission, error prompt php. iniwindows system switch php error prompt if php cannot be modified. ini permission. you can set the following prompt to enable and disable php on behalf of php. ini permission, error prompt php. ini

Windows system switch php error prompt

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

The code is as follows:

Ini_set ("display_errors", "On ");

Error_reporting (E_ALL | E_STRICT );

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

The code is as follows:

Find display_errors = On and change it to display_errors = off.

Note: If you have copied the PHP. ini file to the windows directory, you must change display_errors = On in c: windows/php. ini to display_errors = off.

Solution for failure of display_errors = Off in PHP. ini

The method for enabling and disabling error messages in linux is similar, but I will introduce it to you in detail.

In linux

1. open the php. ini file.

Take my ubuntu as an example. the file is in the/etc/php5/a (www.jb51.net) pache2 directory.

2. search and modify the downstream, and change the Off value to On

The code is as follows:

Display_errors = Off

3. search downstream

The code is as follows:

Error_reporting = E_ALL &~ E_NOTICE

Or search:

Error_reporting = E_ALL &~ E_DEPRECATED

Change

Error_reporting = E_ALL | E_STRICT

4. modify httpd. conf of Apache,

Take my Ubuntu as an example. the file is in the/etc/apache2/Directory. this is a blank file.

Add the following two lines:

The code is as follows:

Php_flag display_errors on
Php_value error_reporting 2039

5. restart Apache and you will be OK.

Restart command ::

The code is as follows:

Sudo/etc/init. d/apache2 restart


How can I enable error prompt output in PHP?

Php. ini
Set display_errors = On to enable the error message, error_reporting = E_ALL &~ E_NOTICE: Set the error level. You can also
Ini_set ('display _ errors ', 1); // sets the enable error prompt.
Error_reporting ('e _ ALL &~ E_NOTICE '); // error level prompt
 

If php does not have '', an error is Prompted. how can I set phpini?

This is an important syntax error.

If you want to block errors, add them to the PHP header.

Error_reporting (0 );

The statement can block the error prompt. However, if a PHP error occurs, you can only see a blank page in the browser.

In PHP. INI, find
Error_reporting
Set
Error_reporting = 0
Note that if there is a semicolon in front, remove the semicolon in front.

Don't forget to restart Apache or related web services

In windows, When php is switched on, the following error message is displayed: If you do not have the permission to modify php. ini, replace the following...

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.