PHP error Allowedmemorysizeof67108864bytesexhausted three solutions _ php instance

Source: Internet
Author: User
This article mainly introduces three solutions for PHP error Allowedmemorysizeof67108864bytesexhausted, and PHP memory overflow error, if you want to install the wordpress installation package, you can refer to the following question: fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 76 bytes) in ..... I have never encountered this problem before. According to the prompts, it must be caused by memory overflow. Why is there such a prompt? Next, I will share the error cause and solution I have prepared with phper, hoping to help.

Error cause:

Because the maximum memory consumed by php pages is 8 MB by default (in PHP. ini configuration file), if the file is too large or the image is too large, the above error message will occur during reading.

The solution is as follows:

Solution 1:Add ini_set ("memory_limit", "80 m") to the PHP file. Of course, 80 m can be changed based on your own situation, or not too large. Otherwise, other system resources may encounter problems, -1 is unlimited.

Solution 2:Modify the php. ini configuration file and find

The Code is as follows:

; Maximum amount of memory a script may consume (128 MB)
Http://php.net/memory-limit

Memory_limit = 16 M, remove the semicolon, change the value, change memory_limit from 8 M to 16 M (or larger), and restart the apache service.

The third solution is:Modify the. htaccess distributed configuration file (Note: This directory supports. htaccess ). Add a new sentence in the document: php_value memory_limit 16 M (or larger)

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.