PHP Run Web site memory is not enough prompt Fatal error allowed memory size

Source: Internet
Author: User
Tags ini root directory

There are a variety of solutions, the following I based on the different permissions of the webmaster to introduce

Have server Admin permissions to modify php.ini files

Can be directly in the php.ini memory_limit = 8M; Increase to 12M or greater. (Note: M is not MB in the back)

No Server Admin Permissions

1.php directly modify memory but you need PHP to support the Ini_set function, this method will not work if the function is prohibited in php.ini.

Ini_set (' Memory_limit ', ' 12M ');//can certainly be set to a larger value


2.htaccess Way, this general space host is supported

In the root directory, create the. htaccess file and add the following:

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

Php_value Memory_limit 20000000

</FilesMatch>

Note: Generally speaking, 8M is the standard, but sometimes 8M is not enough.

Friendly tip: Fatal error:allowed memory size of 8388608 bytes exhausted. Indicates that the configured Memory_limit value is 8M. The solution is also solved by the method described above. Memory_limit value to 1.1 points plus debugging success

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.