


Solution to the problem that SHOW_RUN_TIME cannot display the running time properly in ThinkPHP Original, thinkphprun_PHP tutorial
The solution to the problem that SHOW_RUN_TIME in ThinkPHP cannot display the running time normally. Original, thinkphprun
The example in this article tells the solution to the problem that SHOW_RUN_TIME in ThinkPHP cannot display the running time properly. Share it with everyone for your reference. The details are as follows:
Set in ThinkPHP’s config.php:
Copy code The code is as follows: 'SHOW_RUN_TIME'=>true;
The running time can be output in the template, but sometimes the running time will not be displayed.
The solution to this is as follows:
Open the ThinkPHPLibThinkCoreView.class.php file,
In the protected function output($content,$display) method
Will:
if(C('HTML_CACHE_ON')) HtmlCache::writeHTMLCache($content); if($display) { if(false !== strpos($content,'{__RUNTIME__}')) { $runtime = C('SHOW_RUN_TIME')? ''.$this->showTime().'' : ''; $content = str_replace('{__RUNTIME__}', $runtime, $content); } echo $content; if(C('SHOW_PAGE_TRACE')) $this->showTrace(); return null; }else { return $content; }
changed to:
if(C('HTML_CACHE_ON')) HtmlCache::writeHTMLCache($content); if($display) { $runtime = C('SHOW_RUN_TIME')? ''.$this->showTime().'' : ''; if(false !== strpos($content,'{__RUNTIME__}')) { $content = str_replace('{__RUNTIME__}', $runtime, $content); } else $content .= $runtime; echo $content; if(C('SHOW_PAGE_TRACE')) $this->showTrace(); return null; }else { return $content; }
This problem is solved!
I hope this article will be helpful to everyone’s PHP programming based on the ThinkPHP framework.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

DeepSeek: How to deal with the popular AI that is congested with servers? As a hot AI in 2025, DeepSeek is free and open source and has a performance comparable to the official version of OpenAIo1, which shows its popularity. However, high concurrency also brings the problem of server busyness. This article will analyze the reasons and provide coping strategies. DeepSeek web version entrance: https://www.deepseek.com/DeepSeek server busy reason: High concurrent access: DeepSeek's free and powerful features attract a large number of users to use at the same time, resulting in excessive server load. Cyber Attack: It is reported that DeepSeek has an impact on the US financial industry.

Problem Description When calling Alipay EasySDK using PHP, after filling in the parameters according to the official code, an error message was reported during operation: "Undefined...

Solve the problem of third-party interface returning 403 in Node.js environment. When we use Node.js to call third-party interfaces, we sometimes encounter an error of 403 from the interface returning 403...

OKX device restrictions Solution: Are your OKX account devices restricted? This article provides detailed self-service solutions. First, contact OKX official customer service to provide your account information and restricted device details. Customer Service may ask you to provide authentication information and explain any abnormal activities. Then you need to wait for OKX to review, which can take several days. After the audit is completed, take corresponding measures based on the reasons for the restrictions (such as abnormal login or violation), such as changing the password, enabling two-factor verification, or stopping the violation. If the restrictions are caused by system errors, please wait patiently for the system to recover and follow the official announcement of OKX.

Using the ThinkPHP6 framework combined with elasticsearch-php client to operate Elasticsearch...

Want to keep your Binance account safe? This article details how to use Binance security authenticator (such as Google Authenticator), including downloading and installing, enabling settings, backup keys, and daily usage tips to effectively prevent theft of the account.

Alipay PHP...

thinkphp6...
