Home >Backend Development >PHP Tutorial >ThinkPHP notes - enable debug debugging mode, thinkphpdebug_PHP tutorial

ThinkPHP notes - enable debug debugging mode, thinkphpdebug_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:23:562121browse

ThinkPHP notes - enable debug debugging mode, thinkphpdebug

debug+trace mode can view TP error information during the development process, which can better help developers debug. However, turning on the debug mode is not simply a matter of setting it in the configuration file. After searching the information, I found an effective method.

First, go to the project directory where you have deployed ThinkPHP

Then pay attention to enable debugging mode in the entry file, write the code define('APP_DEBUG',true) in the entry file index.php; first delete the Runtime directory, and then run it again, you will find that under the runtime directory The ~runtime.php file is gone, which means your debugging mode has been successfully enabled

The reason why this ~runtime.php file is deleted is that this file is a compiled file and will be cached, so during debugging mode we don’t have to worry about other errors caused by caching

The trace page is also a way for our developers to obtain error information, so we need to enable the trace page. In the THinkPHp3.0 version, the trace page is not enabled by default. We need to manually add

‘SHOW_PAGE_TRACE’ =>true, // Display page Trace information

To see if the trace information is turned on, as long as we go to the index in IndexAction.class.php

Add $this->display();

Then run it again. If you see the following interface, indicate your debugging mode, trace and enable it. >

You use dw or something to modify a page attribute and see if the editor agrees. It is usually caused by coding issues

thinkphp turns off the debugging mode (APP_DEBUG => false), causing a program error. If the debugging mode is turned on, no error is reported. How to solve it?


What version of thinkphp is now written in the entry file

define('APP_DEBUG', true);

If you don’t post the source code, God can’t save you



http://www.bkjia.com/PHPjc/833843.html

www.bkjia.com
true

http: //www.bkjia.com/PHPjc/833843.html

ThinkPHP Notes - Turn on debug debugging mode, thinkphpdebug debug+trace mode can view TP error information during the development process, It can better help developers debug. But in debug mode...
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