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