Home Backend Development PHP Tutorial thinkphp turns on debugging mode and cancels cache generation_PHP tutorial

thinkphp turns on debugging mode and cancels cache generation_PHP tutorial

Jul 13, 2016 pm 05:13 PM
thinkphp introduce about Cancel turn on article model generate cache debug

This article will introduce an article about thinkphp turning on debugging mode and canceling cache generation. Friends who need to know more can refer to this article.

Recently, I returned to thinkphp and found that the two files that turned off the cache in the common file mentioned in the old version of turning off the cache were missing. I've been looking for it for a long time and don't know what's going on.

So I read the manual and Baidu. Later I discovered that you can turn on the debugging mode to turn off the cache, and turning on the debugging mode has many benefits for programmers...

Search for the word debugging in the thinkphp3.0 complete development manual, and you will find many techniques. Here are the steps to enable debugging

Although the compilation cache is excellent, it is not conducive to debugging and troubleshooting during the development phase. We strongly recommend that ThinkPHP developers always turn on debugging mode during the development phase to facilitate timely discovery of hidden problems, analysis, and problem solving. Turning on debugging mode is very simple. You only need to add a line of constant definition code to the entry file:

I share the code in my index.php with you:

The code is as follows
 代码如下 复制代码

require './ThinkPHP/ThinkPHP.php';
define('APP_DEBUG',1);
?>

Copy code


require './ThinkPHP/ThinkPHP.php';
define('APP_DEBUG',1);

?>



After completing the development phase and deploying to the production environment, you only need to delete the debug mode definition code to switch to deployment mode.


After turning on debugging mode, the system will first load the system's default debugging configuration file, and then load the project's debugging configuration file. The advantages of debugging mode are:


² Turn on logging, any error information and debugging information will be recorded in detail to facilitate debugging;


² Turn off template caching and template modifications can take effect immediately;



² Record SQL logs to facilitate SQL analysis;


² Turn off field caching, data table field modifications will not be affected by caching;

² Strictly check file case (even on Windows platform) to help you detect Linux deployment problems in advance;
² It can be conveniently used in different stages of the development process, including development, testing and demonstration, etc. Independent project configuration files can be configured for different application modes;

http://www.bkjia.com/PHPjc/629133.html
www.bkjia.comtrue
http: //www.bkjia.com/PHPjc/629133.htmlTechArticleThis article introduces an article about thinkphp turning on debugging mode and canceling cache generation. Friends who need to know more can refer to this article article. Recently I returned to thinkphp and found that the old version was closed...
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1665
14
PHP Tutorial
1269
29
C# Tutorial
1249
24
How to use LeakSanitizer to debug C++ memory leaks? How to use LeakSanitizer to debug C++ memory leaks? Jun 02, 2024 pm 09:46 PM

How to use LeakSanitizer to debug C++ memory leaks? Install LeakSanitizer. Enable LeakSanitizer via compile flag. Run the application and analyze the LeakSanitizer report. Identify memory allocation types and allocation locations. Fix memory leaks and ensure all dynamically allocated memory is released.

How to conduct concurrency testing and debugging in Java concurrent programming? How to conduct concurrency testing and debugging in Java concurrent programming? May 09, 2024 am 09:33 AM

Concurrency testing and debugging Concurrency testing and debugging in Java concurrent programming are crucial and the following techniques are available: Concurrency testing: Unit testing: Isolate and test a single concurrent task. Integration testing: testing the interaction between multiple concurrent tasks. Load testing: Evaluate an application's performance and scalability under heavy load. Concurrency Debugging: Breakpoints: Pause thread execution and inspect variables or execute code. Logging: Record thread events and status. Stack trace: Identify the source of the exception. Visualization tools: Monitor thread activity and resource usage.

How to debug PHP asynchronous code How to debug PHP asynchronous code May 31, 2024 am 09:08 AM

Tools for debugging PHP asynchronous code include: Psalm: a static analysis tool that can find potential errors. ParallelLint: A tool that inspects asynchronous code and provides recommendations. Xdebug: An extension for debugging PHP applications by enabling a session and stepping through the code. Other tips include using logging, assertions, running code locally, and writing unit tests.

Detailed introduction of Samsung S24ai functions Detailed introduction of Samsung S24ai functions Jun 24, 2024 am 11:18 AM

2024 is the first year of AI mobile phones. More and more mobile phones integrate multiple AI functions. Empowered by AI smart technology, our mobile phones can be used more efficiently and conveniently. Recently, the Galaxy S24 series released at the beginning of the year has once again improved its generative AI experience. Let’s take a look at the detailed function introduction below. 1. Generative AI deeply empowers Samsung Galaxy S24 series, which is empowered by Galaxy AI and brings many intelligent applications. These functions are deeply integrated with Samsung One UI6.1, allowing users to have a convenient intelligent experience at any time, significantly improving the performance of mobile phones. Efficiency and convenience of use. The instant search function pioneered by the Galaxy S24 series is one of the highlights. Users only need to press and hold

How to use caching in Golang distributed system? How to use caching in Golang distributed system? Jun 01, 2024 pm 09:27 PM

In the Go distributed system, caching can be implemented using the groupcache package. This package provides a general caching interface and supports multiple caching strategies, such as LRU, LFU, ARC and FIFO. Leveraging groupcache can significantly improve application performance, reduce backend load, and enhance system reliability. The specific implementation method is as follows: Import the necessary packages, set the cache pool size, define the cache pool, set the cache expiration time, set the number of concurrent value requests, and process the value request results.

Caching mechanism and application practice in PHP development Caching mechanism and application practice in PHP development May 09, 2024 pm 01:30 PM

In PHP development, the caching mechanism improves performance by temporarily storing frequently accessed data in memory or disk, thereby reducing the number of database accesses. Cache types mainly include memory, file and database cache. Caching can be implemented in PHP using built-in functions or third-party libraries, such as cache_get() and Memcache. Common practical applications include caching database query results to optimize query performance and caching page output to speed up rendering. The caching mechanism effectively improves website response speed, enhances user experience and reduces server load.

PHP Debugging Errors: A Guide to Common Mistakes PHP Debugging Errors: A Guide to Common Mistakes Jun 05, 2024 pm 03:18 PM

Common PHP debugging errors include: Syntax errors: Check the code syntax to make sure there are no errors. Undefined variable: Before using a variable, make sure it is initialized and assigned a value. Missing semicolons: Add semicolons to all code blocks. Function is undefined: Check that the function name is spelled correctly and make sure the correct file or PHP extension is loaded.

Putting the entire earth into a neural network, the Beihang University team launched a global remote sensing image generation model Putting the entire earth into a neural network, the Beihang University team launched a global remote sensing image generation model Jun 09, 2024 pm 09:56 PM

Beihang's research team used a diffusion model to "replicate" the Earth? At any location around the world, the model can generate remote sensing images of multiple resolutions, creating rich and diverse "parallel scenes." Moreover, complex geographical features such as terrain, climate, and vegetation have all been taken into consideration. Inspired by Google Earth, Beihang's research team "loaded" satellite remote sensing images of the entire Earth into a deep neural network from an overhead perspective. Based on such a network, the team built MetaEarth, a global top-down visual generation model. MetaEarth has 600 million parameters and can generate remote sensing images with multiple resolutions, unbounded and covering any geographical location around the world. Compared with previous research, the global remote sensing image generation model has

See all articles