The error "Fatal error Allowed memory size" is returned when the php website is running out of memory.

Source: Internet
Author: User
Tags php website

There are many solutions. I will introduce them to webmasters with different permissions.

You have the server management permission to modify the php. Ini file.

You can directly set memory_limit = 8 M in php. ini; to 12 M or larger. (Note: M is not MB)

No server management permission

1. Directly modify the memory in php, but you need php to support the ini_set function. If this function is disabled in php. ini, this method will not work.

Ini_set ('memory _ limit ', '12m'); // you can set it to a larger value.


2. htaccess is supported by common space hosts.

Create a. htaccess file in the root directory and add the following content:

<FilesMatch ". (php | html ?) $ ">

Php_value memory_limit 20000000

</FilesMatch>

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

Friendly reminder: Fatal error: Allowed memory size of 8388608 bytes exhausted. Indicates that the configured memory_limit value is 8 MB. The solution is to use the method described above. The memory_limit value must be set to and debugging is successful.

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.