为什么要用unix:/tmp/php-cgi.sock,最主要的特征就是unix socket比tcp快,当网站流量大的时候,服务器的优化是分毫必争的.

当我们用php-fpm来管理我们的php启动时,按照如下的配置,就会自动生成/tmp/php-cgi.sock。在php-fpm.conf文件中设置

[www]

listen = /tmp/php-cgi.sock

修改nginx.conf为:

# fastcgi_pass 127.0.0.1:9000;

fastcgi_pass unix:/tmp/php-cgi.sock;

重启php-fpm和ngix

unix:/tmp/php-cgi.sock的更多相关文章

  1. 关于nginx配置的一个报错connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory)

    针对配置php的情况: linux服务器一般提示这个 connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory) ...

  2. 转connect() to unix:/var/run/php-fpm.sock failed (11: Resource temporarily unavailable)

    网站常出现502 bad gateway,程序没有问题. 根据nginx日志:connect() to unix:/var/run/php-fpm.sock failed (11: Resource ...

  3. 输入docker ps 报错信息处理Get http:///var/run/docker.sock/v1.19/containers/json: dial unix /var/run/docker.sock: permission denied.

    完整错误信息 Get http:///var/run/docker.sock/v1.19/containers/json: dial unix /var/run/docker.sock: permis ...

  4. 关于使用deepin在linux下安装mysql出现Can't connect to local MySQL server through socket '/tmp/mysql/mysql.sock' (2)的解决方法

    根据目录/etc/mysql打开文件debain.cnf 此时文本里的内容为 # Automatically generated for Debian scripts. DO NOT TOUCH![c ...

  5. 【转载】Docker 安装后 报 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 解决办法

    Docker Docker 安装后 报 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docke ...

  6. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql/mysql.sock' (2)

    [root@XXX ~]# mysql -h localhost -uroot -p Enter password: ERROR (HY000): Can't connect to local MyS ...

  7. Cannot connect to the Docker daemon at unix:///var/run/docker.sock.问题解决

    出现Cannot connect to the Docker daemon at unix:///var/run/docker.sock时,先用tail -5f /var/log/upstart/do ...

  8. Docker未启动错误:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

    此问题是因为Docker安装后未启动所致,执行以下命令启动docker: systemctl start docker.service 具体日志如下: Connecting to ... Connec ...

  9. supervisorctl unix:///var/run/supervisor.sock refused connection

    运行supervisorct 报如下错误 supervisorctl unix:///var/run/supervisor.sock refused connection 查看supervisord. ...

随机推荐

  1. 纯css3实现的超炫checkbox复选框和radio单选框

    之前为大家分享了好多css3实现的按钮.今天要为大家分享的是纯css3实现的checkbox复选框和radio单选框,效果超级炫.先让我们看看图吧! 在线预览   源码下载 这个实例完全由css3实现 ...

  2. Message Delivery Semantics

    4.6 Message Delivery Semantics Now that we understand a little about how producers and consumers wor ...

  3. Android——通知 Notification

    链接:http://jingyan.baidu.com/article/77b8dc7fde875a6175eab641.html http://www.2cto.com/kf/201502/3749 ...

  4. linux网口驱动实现(待续)

    驱动位于linux/driver/net下. 1. 寄存器读写 asm/io.h #define __raw_writeb(v,a)   (__chk_io_ptr(a), *(volatile un ...

  5. CentOS下安装Gitlab

    环境 Requirements 软件 版本 CentOS 6.6 Python 2.6 Ruby 2.1.5 Git 1.7.10+ Redis 2.0+ MySQL   GitLab 7-8-sta ...

  6. 决策树---ID3算法(介绍及Python实现)

    决策树---ID3算法   决策树: 以天气数据库的训练数据为例. Outlook Temperature Humidity Windy PlayGolf? sunny 85 85 FALSE no ...

  7. 将string转换成char型的一般方法

    C++文件读取中: infile in: in.open("file.dat",ios::in); 这样是能够的. 可是 string a; a="file.dat&qu ...

  8. StarRTC , AndroidThings , 树莓派小车,公网环境,视频遥控(一)准备工作

    原文地址:http://blog.starrtc.com/?p=48 啥也不说,先来个视频看看效果 视频播放器     00:00   00:54     概述为了体现StarRTC的实时音视频传输能 ...

  9. 第二百九十一节,RabbitMQ多设备消息队列-安装与简介

    RabbitMQ多设备消息队列-安装与简介 RabbitMQ简介 解释RabbitMQ,就不得不提到AMQP(Advanced Message Queuing Protocol)协议. AMQP协议是 ...

  10. OpenCV_基于局部自适应阈值的图像二值化

    在图像处理应用中二值化操作是一个很常用的处理方式,例如零器件图片的处理.文本图片和验证码图片中字符的提取.车牌识别中的字符分割,以及视频图像中的运动目标检测中的前景分割,等等. 较为常用的图像二值化方 ...