This article summarizes several situations that I encountered when I disabled the ThinkPHP debugging mode in my project and the Final Solution. it is very simple and practical. I will share it with you here, if you have any need, refer.
Case 1:
I recently used ThinkPHP to develop a project. after the local development test is complete and uploaded to the server, the first time I open the project normally, and then refresh the page, the following error occurs: "page debugging error, unable to open the page, please try again.
I'm so depressed. it's okay to set define ('app _ debug', false) locally. how can I put it on the server and there is an error?
Baidu, Google still did not find a solution, and suddenly found that the project APP_Name/Runtime/Cache directory and APP_Name/Runtime/Logs directory do not have the write permission, decisive change, F5, alas okay, mom no longer needs to worry about error messages!
Case 2:
ThinkPHP sets the APP_DEBUG constant to false, and the following problems occur:
The code is as follows:
Parse error: syntax error, unexpected T_STRING in E: \ PHPnow \ htdocs \ ojbak \ Runtime \~ App. php on line 1
Or directly report "Server Error". what should I do?
This is related to PHP. modify the configuration in php. ini.
The code is as follows:
Short_open_tag = On
Because the build method in app. class. php is as follows:
After the debug mode is enabled, the content of the relevant file will be obtained and then combined into a file. this will be automatically added.
That's what you see ~ App. php file
However, if you do not enable the debugging mode, the relevant files will be loaded every time. in this way, your errors will be exposed.
Case 3:
When APP_DEBUG is set to false in thinkphp, Data Query (select, find, etc.) always displays the first one .. However, after you set APP_DEBUG to true, it will be normal .. Why? Is there any solution?
Normally, APP_DEBUG is the debugging mode. put it in the online environment and set it to false whenever possible ..
Find a select query by yourself. when debug is disabled, debug the SQL statement generated after the query by writing files.
The above is all the content of this article. I hope you will like it.