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