我想进行主题中提到的配置。如果我启动 nginx,我会在 /var/log/nginx/error.log 中看到此错误消息
* 1 connect() to unix:127.0.0.1:9000 failed (2: No such file or directory) while connect to upstream
我试图用套接字设置。我收到以下错误
unix:/var/run/php5-fpm.sock 失败(2:没有这样的文件或目录)
似乎 nginx 需要一个文件,或者路径不正确。完全不明白怎么解决
这是我的 nginx 设置
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params; }
当我尝试使用套接字时,我使用了这个(fastcgi_pass unix:/var/run/php-fpm/php5-fpm.sock;)
我在 /etc/php-fpm/www.conf 中仅更改了“listen”属性取决于 fastcgi_pass。
任何人都知道我该如何解决?
更新: 我将 fastcgi_pass unix:127.0.0.1:9000 更改为 fastcgi_pass 127.0.0.1:9000 在这种情况下,我收到以下错误
*1 connect() failed (111: Connection refused) while connecting to upstream,
当我启动 php-fpm 时出现以下消息
Oct 17 09:30:31 raspi php-fpm[6605]: [17-Oct-2013 09:30:31] ALERT: [pool www] user has not been defined
Oct 17 09:30:31 raspi php-fpm[6605]: [17-Oct-2013 09:30:31] ERROR: failed to post process the configuration
Oct 17 09:30:31 raspi php-fpm[6605]: [17-Oct-2013 09:30:31] ERROR: FPM initialization failed
Oct 17 09:30:31 raspi systemd[1]: php-fpm.service: main process exited, code=exited, status=78/n/a
Oct 17 09:30:31 raspi systemd[1]: Unit php-fpm.service entered failed state