本文介绍了如何找到我的php-fpm.sock?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行Wordpress时使用:Nginx + PHP-FPM + APC + W3总缓存+ PageSpeed.

I'm running Wordpress with: Nginx + PHP-FPM + APC + W3 Total Cache + PageSpeed.

经过三天的研究和配置,我成功地使其工作.我将PHP-FPM配置为通过127.0.0.1:9000运行.但是现在我想通过套接字进行配置.

After 3 days researching and configuring, I succeeded to make it work.I configured PHP-FPM to run via 127.0.0.1:9000. But now I want to configure via Socket.

问题是我无法在服务器中找到套接字路径.我刚刚找到了/var/run/php-fpm/php-fpm.pid,但是没有php-fpm.sock.

The problem is that I can't find the socket path in my server. I just found /var/run/php-fpm/php-fpm.pid, but php-fpm.sock was not there.

运行whereis php-fpm的输出是:

php-fpm: /usr/sbin/php-fpm /etc/php-fpm.d /etc/php-fpm.conf /usr/share/man/man8/php-fpm.8.gz

但是这里没有任何php-fpm.sock.

如何找到php-fpm.sock?

我的规格

  • Amazon Micro EC2
  • Linux版本3.4.48-45.46.amzn1.x86_64 Red Hat 4.6.3-2(我认为它基于CentOS 5)
  • PHP 5.3.26(fpm-fcgi)

推荐答案

我知道这是个老问题,但是由于我现在也遇到了同样的问题并找到了答案,我想我可以分享一下.问题是由于在pood.d/目录中进行的配置.

I know this is old questions but since I too have the same problem just now and found out the answer, thought I might share it. The problem was due to configuration at pood.d/ directory.

打开

/etc/php5/fpm/pool.d/www.conf

找到

listen = 127.0.0.1:9000

更改为

listen = /var/run/php5-fpm.sock

此后重新启动nginx和php5-fpm服务,并检查是否已创建php5-fpm.sock.

Restart both nginx and php5-fpm service afterwards and check if php5-fpm.sock already created.

这篇关于如何找到我的php-fpm.sock?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 18:33