PHP Run Tip: Fatal error allowed memory size solution, fatalallowed_php tutorial

Source: Internet
Author: User

PHP Run Tip: Fatal error allowed memory size solution, fatalallowed


The example in this article tells the PHP run prompt: Fatal error allowed memory size is not enough to resolve. Share to everyone for your reference. Here's how:

Some friends new configuration of the environment or their own newly written program run will encounter fatal error:allowed memory size of 134217728 bytes exhausted error, this problem is not written by the program caused, Another is the environment configuration is not good also will appear, like php5.1.27+apache2.2.3 appears in the windows2003 will appear bug no matter how you fix can not solve fatal error allowed memory size This problem, Only the new environment and PHP version can be configured on reboot.

There are many solutions, the following we will be based on different permissions of the webmaster to introduce.

One, for the server administrative rights can modify the php.ini file

Can be directly in the php.ini copy code code as follows: Memory_limit = 8M; increase to 12M or greater. (Note: M is not MB later)

Second, for no server administrative rights

1.php directly modify the memory but need your PHP support Ini_set function, this function if the php.ini is forbidden to use then this method will be invalid.
Copy the Code code as follows: Ini_set (' memory_limit ', ' 12M ');//Can of course be set to a larger value

2.htaccess mode, this general space host is supported, in the root directory to establish the. htaccess file, add the following:
Copy the Code code as follows:

Php_value Memory_limit 20000000

Note: In general, 8M is standard, but sometimes 8M is not enough.

Special reminder: Fatal error:allowed memory size of 8388608 bytes exhausted, which means that the Memory_limit value of the configuration is 8M, the workaround is to use the method described above to solve, memory_ Limit value to 1.1 points plus debugging success.

I hope this article is helpful to everyone's PHP programming.

http://www.bkjia.com/PHPjc/929092.html www.bkjia.com true http://www.bkjia.com/PHPjc/929092.html techarticle php Run Tip: Fatal error allowed memory size of the solution, fatalallowed This example tells the PHP run prompt: Fatal error allowed memory size of the solution ...

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