Solve thinkphp shutdown debug mode times wrong summary of problems

Source: Internet
Author: User
Tags parse error php file php and

solve thinkphp shutdown debug mode times wrong summary of problems

This article summarizes the individual in the project encountered in the closure of the Thinkphp debugging mode encountered several cases of error and the final treatment method, very simple and practical, here to share with you, the need for small partners can refer to.

Case one:

Recently, the development of a project with thinkphp, local development test completed upload to the server, the first turn on the normal, and then refresh the page will appear "page debugging error, unable to find the page, please try again" error.

I am depressed, clearly local settings define (' App_debug ', false) run no problem, how to put on the server on the wrong?

Baidu,google still did not find the solution, suddenly found that the project App_name/runtime/cache directory and App_name/runtime/logs directory does not have writable permissions, decisively changed, F5, alas well, Mom doesn't have to worry about the wrong message any more!

Case TWO:

thinkphp after setting the App_debug constant to false, a problem similar to the following occurs:

The code is as follows:

Parse error:syntax error, unexpected t_string in e:phpnowhtdocsojbakruntime~app.php on line 1

or report "Server error" directly, how to do?

This has to do with PHP and modify the configuration in php.ini.

The code is as follows:

Short_open_tag = On

Because the build method inside the app.class.php:

When debug mode is turned on, the contents of the relevant files are retrieved and then assembled into a file, which is automatically added at this time.

That's the ~app.php file you saw.

But when you do not open debug mode, will always load the relevant files, this way, your mistakes are exposed.

Case THREE:

After the App_debug is set to False in thinkphp, the data query (select, find, and so on) always displays the first one ... But after setting the App_debug to True, it's OK. What's the solution?

Normally, App_debug is debug mode, put in the online environment, try to set to false.

Find yourself a select query that, when debug is turned off, uses a write file to debug the SQL generated after the query.

The above mentioned is the entire content of this article, I hope you can enjoy.

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.