Home > PHP Framework > ThinkPHP > How to enable debugging mode in thinkphp5

How to enable debugging mode in thinkphp5

Release: 2020-04-09 09:08:59
forward
4970 people have browsed it

How to enable debugging mode in thinkphp5

ThinkPHP has a debugging mode specially set up for the development process. After turning on the debugging mode, a certain amount of execution efficiency will be sacrificed, but the convenience and debugging functions it brings are well worth it. Let's take a look at how to enable debugging mode in thinkphp5.

Method 1. Change the debugging mode to true in the configuration file config.php under the application

How to enable debugging mode in thinkphp5

Method 2. Define it under the ROOT_PATH directory of the application .env file, and define the APP_DEBUG configuration parameter 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
Copy after login

How to enable debugging mode in thinkphp5

Debugging advantages:

1. Turn on logging, Any error messages 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 exception information will be displayed;

Recommended tutorial: thinkphp tutorial

The above is the detailed content of How to enable debugging mode in thinkphp5. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
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
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template