我正在尝试为新的ubuntu / php5.5 / nginx安装设置虚拟主机
等/ nginx的/ sites_available / mydomain.com:
server {
listen 80 default_server;
root /home/www/mydomain.com/public/;
index index.php index.html
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
server_name mydomain.com;
location ~ \.php${
try_files $uri =404;
fastcgi_index index.php;
fastcgi_pass php5-fpm-sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 240;
include /etc/nginx/fastcgi_params;
}
}
etc / hosts文件:
127.0.0.1 mydomain.com
“sites-enabled”文件夹中符号链接中的符号链接:
sudo ln -s /etc/nginx/sites-available/mydomain.com /etc/nginx/sites-enabled/mydomain.com
该
service nginx restart
失败,var / log / nginx / error.log给出
no port in upstream "php5-fpm-sock" in /etc/nginx/sites-enabled/mydomain.com:12
什么可能是错的?
解决方法:
缺少fpm地址路径:
nano /etc/nginx/conf.d/php5-fpm.conf
编辑:
upstream php5-fpm-sock {
server unix:/var/run/php5-fpm.sock;
}