1. 程式人生 > >安裝WordPress-4.9.4為何後臺管理登入不了,提示:FastCGI sent in stderr: "PHP Fatal error: Maximum execution time of

安裝WordPress-4.9.4為何後臺管理登入不了,提示:FastCGI sent in stderr: "PHP Fatal error: Maximum execution time of

今日本人在安裝wordpress-4.9.4時,發現到最後一步的頁面顯示為空,瀏覽器重新整理後,顯示成功安裝,並提示登入後臺管理頁面,

輸入剛剛設定的使用者名稱和密碼,死活登入不上去,一查資料庫表名是建立好了,可是表裡沒有任何資料。

本機環境是Windows7+Nginx

解決步驟

1、檢視Nginx的日誌檔案發現了問題,提示2018/09/22 07:29:01 [error] 10168#10200: *135 FastCGI sent in stderr: "PHP Fatal error:  Maximum execution time of 30 seconds exceeded in D:\czhwin\tools\website\wordpress\wp-includes\wp-db.php on line 1924" while reading response header from upstream, client: 192.168.0.104, server: localhost, request: "POST /wp-admin/install.php?step=2 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.0.104:8080", referrer: "http://192.168.0.104:8080/wp-admin/install.php"

上面日誌顯示PHP執行超時了,檢視wp-db.php 1924行,發現是執行資料庫的操作,

2、有兩種辦法解決

第一種辦法、需要更改PHP.ini的超時配置

找到Php安裝目錄下的php.ini,查詢max_execution_time,預設值是30秒,改成max_execution_time=300,如果時間不過,還可以繼續改大一點,例如max_execution_timemax_execution_time=3000,然後重啟php-fpm和nginx,繼續安裝wordpress,最後安裝提示成功了

第二種辦法、在php程式碼處加入ini_set('max_execution_time', 300);

把執行時間延長即可

最後安裝成功圖如下: