Find out why PHP scripts do not error _php tutorial

Source: Internet
Author: User
So if the PHP script does not report grammatical error, what is the reason for it:

1. General integration Environment, the default is to turn on error reporting; But in a Linux system, it is not necessary to use packages to install

At this point, you can view the PHP configuration file, open the error report

Copy the Code code as follows:
Display_errors = ON/* PHP config file path:/uer/local/php/etc/php.ini */


Note:the method of dynamically setting the php.ini configuration file in php script = =

Copy the Code code as follows:
Ini_set (' display_errors ', ' on '); /* Show All errors */


2. Setting the error reporting level =

Copy the Code code as follows:
error_reporting = E_all; /* The most stringent error reporting level, the development phase can be opened */
error_reporting = E_all &~ e_notice * * Except for NOTICE error */
error_reporting = E_error | E_parse | E_core_error/* Only consider fatal run-time errors, new parsing errors, and core errors */

More than three kinds, recommended in the middle.

Note:the method of dynamically setting error_reporting error reporting levels in PHP scripts = =

Copy the Code code as follows:
Error_reporting (E_all &~ e_notice);


3. After you change the configuration file, you need to restart the service to take effect.

Apache Startup:/usr/local/apache2/bin/apachectl Start/* Recommended */

Another, Red Hat Linux proprietary boot command: Service httpd start

Apache Restart:/usr/local/apache2/bin/apachectl restart

Also, Red Hat proprietary boot command: Service httpd restart

Apache STOP:/usr/local/apache2/bin/apachectl stop

Another, Red Hat proprietary boot command: Service httpd stop

Nginx Restart:/usr/local/nginx/sbin/nginx-s Reload/* Smooth restart */

http://www.bkjia.com/PHPjc/788642.html www.bkjia.com true http://www.bkjia.com/PHPjc/788642.html techarticle so if the PHP script does not report grammatical error, what will be the reason: 1. General integration Environment, the default is to turn on error reporting, but in the Linux system, the use of software packages installed is not necessarily ...

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