thinkphp tips Error Fatal error:allowed memory size solution, thinkphpfatal_php tutorial

Source: Internet
Author: User

thinkphp tip Error Fatal error:allowed memory size resolution, Thinkphpfatal


This example describes a workaround for the thinkphp hint error fatal error:allowed memory size. Share to everyone for your reference. The specific analysis is as follows:

If your thinkphp prompt you: fatal error (Fatal error:allowed memory size), according to the internet said to improve the server can use memory, I think is not a good solution. Trouble is not necessary. Because this is a bug in thinkphp itself.

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

If your error message is the same as mine, also tells you ThinkTemplate.class.php this file error, that is, it is parsing its own label include or other tags when there is a dead loop, causing the server memory is not enough for this dead loop.

Workaround:

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

2. Replace the tags you use with native PHP, such as:
Copy the Code code as follows:


Include './public/home/js/company/companyjs.html ';

If this is because of empty, you can refer to the above:
Copy the Code code as follows:
if (empty ($a)) {
Echo ' A is empty '
}

Solve this problem!

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

http://www.bkjia.com/PHPjc/957133.html www.bkjia.com true http://www.bkjia.com/PHPjc/957133.html techarticle thinkphp hint error fatal error:allowed memory size resolution, Thinkphpfatal This article describes the thinkphp hint error fatal error:allowed memory The workaround for size. Share to ...

  • 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.