#How to enable error debugging in thinkphp5? The method is as follows:
Method 1. Change the debugging mode to true in the configuration file config.php under the application.
Related recommendations: "ThinkPHP Tutorial"
Method 2. Define the .env file under the ROOT_PATH directory of the application, and define The APP_DEBUG configuration parameter is used to replace the constant definition of the entry file, which makes it easy to set environment variables in the deployment environment to turn on and off debugging mode. (Note: After defining the .env file, the app_debug parameter defined in the configuration file is invalid.)
// 设置开启调试模式 app_debug = true
Debugging advantages:
1. Turn on logging, any error information and debugging information will be recorded in detail to facilitate debugging;
2. The entire execution process will be recorded in detail;
3. Template modifications can take effect immediately;
4. Record SQL logs to facilitate SQL analysis;
5. Use the Trace function to better debug and find errors;
6. When an exception occurs, detailed exceptions will be displayed information.
The above is the detailed content of How to enable error debugging in thinkphp5. For more information, please follow other related articles on the PHP Chinese website!