In the PHP configuration file php. ini, how does one set the error report,
Open the PHP Error Report Method for your reference.
The php. ini file contains many configuration settings. You should have set up your php. ini file and put it in the appropriate directory, as shown in instructions for installing PHP and Apache 2 on Linux.
When debugging a PHP application, you should know two configuration variables. The two variables and their default values are as follows:
Copy codeThe Code is as follows:
Display_errors = Off error_reporting = E_ALL
By searching for these variables in the php. ini file, you can find the current default values of these two variables. The purpose of the display_errors variable is obvious-It tells PHP whether an error is displayed. The default value is Off. However, to make the development process easier, set this value to On: display_errors = On.
The default value of error_reporting variable is E_ALL. This setting displays all information from poor coding practices to harmless prompts to errors. E_ALL is a little too detailed for the development process, because it displays a prompt on the screen for some trivial matters (for example, the variable is not initialized), it will mess up the browser output. I only want to see errors and bad code practices, but do not want to see harmless prompts. Therefore, replace error_reporting with the following default values: error_reporting = E_ALL &~ E_NOTICE
Restart Apache and complete configuration.