thinkphp hint error fatal error:allowed memory size resolution _php instance

Source: Internet
Author: User

The example in this article describes the solution for thinkphp hint error fatal error:allowed memory size. Share to everyone for your reference. The specific analysis is as follows:

If your thinkphp prompts you: Fatal error (Fatal error:allowed memory size), according to the internet to improve the server can use memory, I think is not a good solution. There is no need for trouble. Because this is thinkphp itself a bug.

Error Tip: Fatal error:allowed Memory size of 1073741824 bytes exhausted (tried to allocate 523800 bytes) In/var/www/www.examp le.com/thinkphp/lib/template/thinktemplate.class.php on line 265.

If your error tip is the same as mine, it also tells you that the error in this file is that it ThinkTemplate.class.php a dead loop when parsing its own tag include or other tags, resulting in insufficient server memory for this dead loop.

Workaround:

1, find the source of the problem. In the template page where the error occurs (Fatal error:allowed memory size), find the label (include/if/empty, etc.) of the thinkphp you are using, and delete the test one by one to see which label caused it;

2, change the label you use into native PHP, such as:

Copy Code code as follows:
<!--my mistake was caused by include-->
<include file= "./public/home/js/company/companyjs.html"/>
<!--replaced by-->
<php>include './public/home/js/company/companyjs.html ';</php>

If it is because of empty, you can refer to the above:

Copy Code code as follows:
<php>
if (empty ($a)) {
Echo ' A is empty '
}
</php>

Solve the problem!

It is hoped that this article will be helpful to the program design based on thinkphp framework.

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.