安装WordPress-4.9.4为何后台管理登录不了,提示:FastCGI sent in stderr: "PHP Fatal error: Maximum execution time of

版权声明:本博客文章需要转载,请注明本博客地址,谢谢 https://blog.csdn.net/czhwin/article/details/82809669

今日本人在安装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);把执行时间延长即可

最后安装成功图如下:

猜你喜欢

转载自blog.csdn.net/czhwin/article/details/82809669