PHP error allowed memory size of 67108864 bytes exhausted 3 solutions, 67108864exhausted_php Tutorial

Source: Internet
Author: User
Tags php error

PHP error allowed memory size of 67108864 bytes exhausted 3 solutions, 67108864exhausted


Today in Baidu know to see PHP related information found a netizen asked a WordPress installation prompt error of 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 ... this problem has not been encountered before, according to the hint must be caused by memory overflow. Why do you have such a hint? Below I put oneself tidy of cause of error and solution to Phper share, hope to be helpful.

Cause of Error:

Because the PHP page consumes the maximum memory default is 8M (can be seen in the PHP php.ini configuration file), if the file is too large or the picture is too large, the above prompt error occurs when reading.

Solutions, there are three solutions that individuals currently know:

The first solution is to include Ini_set ("Memory_limit", "80M") in the PHP file, of course, 80M can be changed according to their own circumstances, not too big oh, 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, which is found in the php.ini
Copy the Code code as follows:; Maximum amount of memory a script may consume (128MB)
; Http://php.net/memory-limit

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

The third solution is to modify the. htaccess Distributed configuration file (Note: If the directory supports. htaccess). Add a new sentence to the document: Php_value Memory_limit 16M (or larger)


Allowed memory size of 67108864 bytes exhausted (tried to allocate + bytes)

Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 the problem is the wp_memory_limit definition of small, but the current online method is called Change wp-settings

PHP memory is not enough to appear allowed memories size of 8388608 bytes exhausted (tried to allocate 1298358 bytes)

Why this error occurred:

Because the maximum memory consumed by the PHP page defaults to 8M (as seen in the PHP INI), this error occurs when the file is too large or the image is too large to read.

Workaround:

1, modify PHP.ini
Change the memory_limit from 8M to 16M (or larger) and restart the Apache service

2, add Ini_set ("Memory_limit", "100M") in PHP file;

Note: For the normal use of other resources of the system please do not set the memory_limit too large, where-1 is unlimited

3. Modify the. htaccess documentation (provided that the directory supports. htaccess)
Add a new sentence to the document: Php_value Memory_limit 16M (or larger)

http://www.bkjia.com/PHPjc/851342.html www.bkjia.com true http://www.bkjia.com/PHPjc/851342.html techarticle PHP error allowed memory size of 67108864 bytes exhausted 3 solutions, 67108864exhausted Today in Baidu know to see PHP related information found a netizen asked a WordPress installation mention ...

  • 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.