Home  >  Article  >  Backend Development  >  What to do if php.ini does not display errors

What to do if php.ini does not display errors

藏色散人
藏色散人Original
2021-10-18 09:34:301494browse

How to set php.ini not to display errors: 1. Find and open the php.ini file; 2. Set "display_errors = Off" to block errors.

What to do if php.ini does not display errors

##The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

## What should I do if #php.ini does not display errors?

PHP.ini Sets the shielding and display of PHP error messages (errors):

If an error occurs during the running of the PHP program, it will be displayed in the browser Whether to display error information and the level at which error information is displayed are what we need to control during program development, debugging, and operation.

The following is an explanation of how to control the shielding and display of PHP error messages (errors) by setting php.ini:

1. Whether error messages are displayed

Display errors display_errors = On

                                                                                                                                                                      use using using the   error above using        through out out out out out out out out out had through using in  )
Here we generally set it to E_ALL, and use the error_reporting() function in the PHP program to set the error information level of the current program.

3. Set whether to save the error log

During the operation of the program, we generally set it not to display errors, so that the running status can be recorded by saving the error log
log_errors = On (record the error log)
log_errors = Off (no logging)
If you save the error log, you need to set the error log saving file at the same time

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


Recommended learning: "
PHP Video Tutorial
"

The above is the detailed content of What to do if php.ini does not display errors. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn