There are many solutions. I will introduce them to webmasters with different permissions.
You have the server management permission to modify the php. Ini file.
You can directly set memory_limit = 8 M in php. ini; to 12 M or larger. (Note: M is not MB)
No server management permission
1. Directly modify the memory in php, but you need php to support the ini_set function. If this function is disabled in php. ini, this method will not work.
Ini_set ('memory _ limit ', '12m'); // you can set it to a larger value.
2. htaccess is supported by common space hosts.
Create a. htaccess file in the root directory and add the following content:
<FilesMatch ". (php | html ?) $ ">
Php_value memory_limit 20000000
</FilesMatch>
Note: In general, 8 m is the standard, but sometimes 8 m is not enough.
Friendly reminder: Fatal error: Allowed memory size of 8388608 bytes exhausted. Indicates that the configured memory_limit value is 8 MB. The solution is to use the method described above. The memory_limit value must be set to and debugging is successful.