Fatal error: Allowed memory size of 8388608
Ketika Anda ingin menambahkan plugin pada blog yang mempunyai engine wordpress dan menemukan pesan error seperti berikut :
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 12 bytes) in /home/sites/public_html/wp-admin/includes/plugin.php on line 4
Hal ini terjadi karena PHP disetting memory-nya 8 MB. Jika mempunyai hosting sendiri atau mempunyai hak akses ke file php.ini tambahkan kode memory_limit = 12M pada file php.ini. Jika Anda tidak mempunyai akses ke file php.ini bisa juga dengan menambahkan kode berikut pada file .htaccess
php_value memory_limit “200M”
php_flag register_globals on
php_value post_max_size “12M”
php_value upload_max_filesize “20M”
php_value max_execution_time “500″
php_value max_input_time “500″
To change the memory limit for one specific script by including a line such as this at the top of the script:
ini_set(”memory_limit”,”12M”);
The 12M sets the limit to 12 megabytes (12582912 bytes). If this doesn’t work, keep increasing the memory limit until your script fits or your server squeals for mercy.
You can also make this change permanently for all PHP scripts running on the server by adding a line like this to the server’s php.ini file:
memory_limit = 12M
Keep in mind that a huge memory limit is a poor substitute for good coding. A poorly written script may inefficiently squander memory which can cause severe problems for frequently executed scripts. However, some applications are run infrequently and require lots of memory like importing and processing a big data file.
