ThinkPHP prompts the error Fatalerror: Allowedmemorysize. thinkphpfatal_PHP tutorial

Source: Internet
Author: User
ThinkPHP prompts Fatalerror: Allowedmemorysize solution, thinkphpfatal. ThinkPHP prompts Fatalerror: Allowedmemorysize. thinkphpfatal this article describes how ThinkPHP prompts Fatalerror: Allowedmemorysize. If ThinkPHP prompts the error Fatal error: Allowed memory size, thinkphpfatal

This article describes how ThinkPHP prompts the error Fatal error: Allowed memory size. Share it with you for your reference. The specific analysis is as follows:

If your ThinkPHP prompts you a Fatal error (Fatal error: Allowed memory size), I don't think it is a good solution to increase the memory available for servers. There is no need for trouble. This is because ThinkPHP has a BUG.

Error message:Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 523800 bytes) in/var/www/www.example.com/ThinkPHP/Lib/Template/ThinkTemplate.class.php on line 265.

If your error message is the same as mine, tell you ThinkTemplate. class. an error occurs in the php file, that is, it has an endless loop when parsing its own tag include or other tags, resulting in insufficient server memory for this endless loop.

Solution:

1. locate the problem source. On the template page with the error (Fatal error: Allowed memory size), find the ThinkPHP tag you are using (include/if/empty) and delete the tests one by one, check which tag is causing the problem;

2. replace the tag you are using with the native PHP, for example:

The code is as follows:




Include './Public/home/js/Company/companyJS.html ';

For empty reason, refer to the above:

The code is as follows:


If (empty ($ )){
Echo 'A is blank'
}


Now the problem is solved!

I hope this article will help you with ThinkPHP framework-based programming.

Fatal error: Allowed memory size solution. thinkphpfatal this article describes how ThinkPHP prompts the error Fatal error: Allowed memory size. Share...

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.