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)