php-fpm不创建.sock文件 [英] php-fpm doesn't create .sock file

查看:392
本文介绍了php-fpm不创建.sock文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台在Amazon Linux上运行的AWS服务器.

I have an AWS server running on Amazon Linux.

我使用了本指南来安装php7(页面底部): https: //forums.aws.amazon.com/thread.jspa?messageID=695576

I used this guide to install php7 (bottom of the page): https://forums.aws.amazon.com/thread.jspa?messageID=695576

我想使用nginx代替Apache,因此我还安装了php70w-fpm和nginx软件包.但是,当我service start php-fpm时,它不会在服务器上的任何位置创建php-fpm.sock文件.我已经签入/var/run,并且还运行了find / -name "*.sock",它仅返回/var/run/rpcbind.sock.

I would like to use nginx instead of Apache, so I've also installed the php70w-fpm and nginx packages. However, when I service start php-fpm, it does not create a php-fpm.sock file anywhere on my server. I have checked in /var/run and have also ran find / -name "*.sock" which only returns /var/run/rpcbind.sock.

推荐答案

真正的解决方案是nginx配置中的www.conffastcgi_pass中的侦听必须匹配.是否使用套接字还是由TCP决定.

The real solution here is that the listen in www.conf and fastcgi_pass in nginx configuration have to match. Whether you use sockets or tcp is up to you.

答案是根本不使用.sock文件.

The answer was to not use a .sock file at all.

listen = 127.0.0.1:9000

所以在我的nginx配置中,我放了

fastcgi_pass 127.0.0.1:9000;

而不是使用类似的东西

fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;

这篇关于php-fpm不创建.sock文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆