PHP error allowed memory size of 67108864 bytes exhausted 3 Solutions _php instance

Source: Internet
Author: User

Today in Baidu know to see PHP related data found a netizen asked a WordPress installation hint error A problem, said he installed the WordPress installation package encountered such a problem: Fatal error:allowed memory size of 67108864 bytes exhausted (tried to allocate-bytes) in .... The small part of this problem has not been encountered before, according to the prompts must be caused by memory overflow. And why is there such a hint? Below I put myself to organize the error reason and solution to phper share, hope to help.

Reason for error:

Because the maximum memory consumed by the PHP page is 8M (as you can see in the PHP php.ini configuration file), if the file is too large or the picture is too large, the error will occur when reading the message.

Solution, the individual currently knows three solutions:

The First solution is: add ini_set in PHP file ("Memory_limit", "80M"), of course 80M can be changed according to their own circumstances, and not too much, otherwise the system other resources will encounter problems oh, of which-1 is not set limits.

The second solution is to modify the php.ini configuration file and find it in php.ini

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

Memory_limit = 16M, remove the preceding semicolon, change the value of the size of the memory_limit from 8M to 16M (or greater), restart the Apache service can.

The third solution is to modify the. htaccess Distributed configuration file (Note: The premise is that the directory supports. htaccess). Add a new sentence to the document: Php_value memory_limit 16M (or greater)

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.