Explore the reasons why PHP scripts do not complain _php tips

Source: Internet
Author: User
Tags php script

So if the PHP script doesn't report syntax errors, what is the reason:

1. The general integration environment, the default will open error reporting; But in Linux, it doesn't have to be installed with a package,

At this point you can view the PHP configuration file and turn on Error reporting =>

Copy Code code as follows:

Display_errors = ON/* PHP configuration file path:/uer/local/php/etc/php.ini * *


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

Copy Code code as follows:

Ini_set (' display_errors ', ' on '); /* Show all errors/*


2. Set the error reporting level=>

Copy 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/* ERROR other than NOTICE * *
error_reporting = E_error | E_parse | E_core_error/* Only considers fatal Run-time errors, new parse errors and core errors * *

  Above three kinds, recommend middle of.

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

Copy Code code as follows:

Error_reporting (E_all &~ e_notice);


3. After changing the configuration file, you need to restart the service to take effect=>

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

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

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

Another, Red Hat proprietary start command: Service httpd restart

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

Another, Red Hat proprietary start command: Service httpd stop

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

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.