PHP allowed memory size of 8388608 bytes exhausted (tried to_php tutorial

Source: Internet
Author: User
Today when using a PHP product appeared allowed memory size of 8388608 bytes exhausted (tried to allocate 46080 bytes) in .... The message is checked because this product is not taking into account user memory, let's look at how to resolve this method

PHP.ini This parameter memory_limit caused, because it is not set enough to cause the problem in the above, let's look at several solutions


Method one, using the program to achieve

Add the following command line to your PHP code

The code is as follows Copy Code
Ini_set (' Memory_limit ', ' 128M ');

This requires that your server is not forbidden to modify, the general virtual space is not operable.

Method two, using the. htaccess to do this, the feasibility is very high.

Join in your. htaccess

The code is as follows Copy Code
Php_value Memory_limit 128M;

You can change the 128M to any value you want to set.

Method Three, this should be for the server management rights of friends, directly modify the php.ini file.

Find the "Memory_limit" item, and if not, you can add this parameter yourself at the end of the file. Here are some examples of settings

The code is as follows Copy Code
Memory_limit = 128M;

You can change the 128M to any value you want to set
Restart Apache for you.

So I run that product no longer will appear before the allowed memory size of 8388608 bytes exhausted (tried to allocate 46080 bytes) in .... Out,.

http://www.bkjia.com/PHPjc/632229.html www.bkjia.com true http://www.bkjia.com/PHPjc/632229.html techarticle today when using a PHP product appeared allowed memory size of 8388608 bytes exhausted (tried to allocate 46080 bytes) in .... The information is checked because this product is not considered ...

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