IT / KomputerSeptember 7, 2009 4:20 am

Fatal error: Maximum execution time of 30 seconds exceeded

Jika di website anda ada pesan tersebut, silahkan coba naikkan max_execution_time  nya . caranya :

edit php.ini di public_html atau bikin dulu kalau belum

tambakan line berikut ini :

max_execution_time = 100

ganti angka 100 seperlunya saja sesuai keinginan. defaultnya kalo tanpa set adalah 30.

selain itu jika script anda ada di subfolder anda perlu mengedit htaccess anda menjadi seperti berikut ini

SetEnv PHPRC /home/USERNAME_CPANEL_ANDA/public_html

ganti USERNAME_CPANEL_ANDA dengan username anda.

 

atau bukan karena infinite loop (meskipun bisa jadi iya).

itu terjadi karena script melampaui batas waktu yg diijinkan php, yaitu 30 detik.

untuk ngakalin, bisa pake:

 code php

ini_set("max_execution_time","0");

 

 

 

IT / Komputer 3:59 am

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.