Fatal error: Maximum execution time of 30 seconds exceeded

Author: Eric  //  Category: WordPress

WordPress 出現 Fatal error: Maximum execution time of 30 seconds exceeded 是因為主機對程式的執行時間作了限制,解決方法如下 :

// 擇一使用即可,依不可行性排序

01. 自己的主機 or 虛擬主機且可以修改 php.ini

a. 修改 php.ini 裡 max_execution_time 的數值,重新啟動 Server
b. .htaccess 加上 php_value max_input_time 300
c. wp-config.php 加上 set_time_limit( 300 );

02. 虛擬主機 : 不可以修改 php.ini

a. .htaccess 加上 php_value max_execution_time 300
b. wp-config.php 加上 set_time_limit( 300 );

// 如果主機有安裝 suPHP
.htaccess file 的 php_value max_execution_time 300 改成 max_execution_time = 300

Ref :
01. PHP Runtime Configuration
02. PHP set_time_limit ( int $seconds )

Tags: , , , ,

Leave a Reply