Php Allowed memory size of 8388608 bytes exhausted (tried to allocate 46080 bytes) in ....

Source: Internet
Author: User

The memory_limit parameter in php. ini is caused by insufficient settings, which causes the problem. Let's take a look at several solutions.


Method 1: implement with a program

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 allowed to be modified. Generally, virtual space cannot be operated.

Method 2: Use. htaccess, which is highly feasible.

Add in your. htaccess

The code is as follows: Copy code
Php_value memory_limit 128 M;

You can change m to any value you want to set.

Method 3: directly modify the php. Ini file for a friend with server management permissions.

Find "memory_limit". If not, you can add this parameter at the end of the file. The following are some configuration examples:

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

You can change m to any value you want to set.
Restart apache.

In this way, when I run the product again, the Allowed memory size of 8388608 bytes exhausted (tried to allocate 46080 bytes) in will not appear ,.

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.