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.