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