php+nginx 启动后,访问项目文件,出现以下错误:
An error occurred.
Faithfully yours, nginx.
查看error.log文件,里面有错误信息:
[error] 3096#5692: *3 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /shop/web/index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
再查看9000端口是否被占用或者启动,我这里是windows系统,在命令行中输入netstat -ano|findstr 9000,发现没有9000端口的相关信息,端口没启动。
换个方式启动php-gic.exe,在命令行中输入:php-cgi.exe -b 127.0.0.1:9000 -c php.ini
查看9000端口的情况,发现有信息,启动了,再浏览器中访问项目,网页能正常打开,问题解决