Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set php.ini not to display errors

Shulou Source: shulou.com Published: 2022-06-03 04:56:01 10月03日 Update

How to set php.ini does not show errors, many novices are not very clear about this, in order to help you solve this problem, the following small series will explain in detail for everyone, there are people who need this to learn, I hope you can gain something.

Php.ini does not display errors: 1. Find and open the php.ini file;2. Block errors by setting "display_errors = Off".

Operating environment: Windows 7 system, PHP7.1 version, DELL G3 computer

What if php.ini doesn't show errors?

PHP.ini Sets the masking and display of PHP errors:

If there is an error in the PHP program running process, whether the error message is displayed on the browser, and the level of the error message displayed are things we need to control during program development, debugging, and operation.

Here is how to control the masking and display of PHP errors by setting php.ini:

1. Whether the error message is displayed

display_errors = On

masking errors display_errors = Off (default)

2. Level of error message displayed

error_reporting = E_ALL (all)

error_reporting = E_ALL & ~E_NOTICE

Here we generally set E_ALL, in PHP programs using the error_reporting() function to set the error message level of the current program.

3. Set whether to save error log

We usually set it not to display errors during the operation of the program, so that we can record the operation status by saving the error log.

log_errors = On

log_errors = Off

If you want to save the error log, you need to set the error log save file at the same time

error_log = e:/php/logs/php_error.log

Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.

Tags: Error information log program level process file help control operation run clear content function can be passed at the same time what to do article novice Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi NVidia Apple Linux MySQL