PHP open and close error prompts for permissions without modifying php.ini, error php.ini_php Tutorial

Source: Internet
Author: User
Tags php error blank page

PHP open and close error prompts apply to permissions without modifying PHP.ini, error message php.ini


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

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

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 change the Display_errors = on in C:windows/php.ini to Display_errors = Off

Resolution for display_errors = off invalidation in PHP. ini

On the Linux system to turn on and off the error prompt the same way, but I would like to give you a specific introduction

Under Linux system

1. Open the php.ini file.

Take my Ubuntu example, this file is in the/etc/php5/a (www.jb51.net) pache2 directory.

2. Search and modify the downstream, 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

Revision changed 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, which 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 it will be OK.

Restart command::

The code is as follows

Sudo/etc/init.d/apache2 restart


How do I turn on Error prompt output in PHP?

Ini
Inside set display_errors = On open error prompt, error_reporting = e_all & ~e_notice set error level. It can also be used in PHP files
Ini_set (' display_errors ', 1);//Set turn On Error prompt
Error_reporting (' E_all & ~e_notice ');//Error level hint

PHP does not "will prompt error, how to set Phpini?"

This is an important grammatical error

If you want to block the error in the PHP header plus

error_reporting (0);

The statement can mask the error, but when PHP has an error, you can only see the blank page on the browser.

Php. INI found in
Error_reporting
Set as
Error_reporting =0
Note If a semicolon is preceded, remove the preceding semicolon

Don't forget to restart Apache or related Web services

http://www.bkjia.com/PHPjc/895119.html www.bkjia.com true http://www.bkjia.com/PHPjc/895119.html techarticle PHP open and close error prompt is applicable to not modify PHP.ini permissions, error php.ini Windows system switch PHP error prompt If you do not have permission to modify php.ini, you can be the following generation ...

  • 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.