[Reprint] Enable debug mode

Source: Internet
Author: User

The debug + trace mode allows you to view the TP error information during the development process and help developers debug better. However, enabling the debug mode is not easy to set in the configuration file. After checking the information, find an effective method.

First, you have deployed the thinkphp project directory.

Note that the debugging mode is enabled in the entry file, and the index is in the entry file. write the Code define ('app _ debug', true) in PHP. First, delete the runtime directory and run it again. You will find ~ The runtime. php file is missing, indicating that your debugging mode is successfully enabled.

This ~ Runtime. php file deletion. This file will be cached after compilation, so during the debugging mode, we do not have to worry about other errors caused by caching.

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

'Show _ page_trace '=> true, // display page trace information

To check whether the trace information is enabled, as long as the index side in indexaction. Class. php

Add $ this-> display ();


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

Original article: http://www.cnblogs.com/summerzi/category/594881.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.