配置好lnmp后,在浏览器中运行程序后,出现如下错误:
[error] 10903#10903: *44 connect() failed (111: Connection refused) while connecting to upstream, client: *.*.*.*, server:info.cloudtbank.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001", host: "info.cloudtbank.com"
nginx 配置
server {
listen 80;
server_name info.cloudtbank.com;
access_log /home/log/access.log;
error_log /home/log/error.log;
index index.php index.html index.htm;
root /home/var/www/;
if (!-f $request_filename) {
rewrite (.*) /index.php?__ip=$remote_addr;
}
if ($request_uri ~ " ") {
return 444;
}
location ~ \.php$ {
# root /home/var/www/;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
大概意思是你没有启动或者配置php-fpm.其中“ /home/var/www/”为网站根目录。
查看一下php-fpm状态 ,启动
/home/php/sbin/php-fpm

网友评论