![无法在 /run/php/php8.0-fpm.sock、Nginx Web 服务器中找到 php8.0-fpm.sock](https://linux22.com/image/771875/%E6%97%A0%E6%B3%95%E5%9C%A8%20%2Frun%2Fphp%2Fphp8.0-fpm.sock%E3%80%81Nginx%20Web%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%AD%E6%89%BE%E5%88%B0%20php8.0-fpm.sock.png)
我目前正在 Nginx Web 服务器中监听 TCP 套接字,但出于某些原因,我想监听我的 UNIX 域套接字。问题是我无法php8.0-fpm.sock
在/var/run/php/php8.0-fpm.sock
和/run/php/php8.0-fpm.sock
路径中找到。当我运行 时ls /run/php
,它只显示php8.0-fpm.pid
。
systemctl status php8.0-fpm
确认已安装并正确运行:
php8.0-fpm.service - The PHP 8.0 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php8.0-fpm.service; enabled; vendor pr /php8.0-fpm.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-10-30 03:03:54 EDT; 20min ago
Docs: man:php-fpm8.0(8)
Process: 282214 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/8.0/fpm/pool.d/www.conf 80 (code=exited, status=0/SUCCESS)
Main PID: 282200 (php-fpm8.0)
Status: "Processes active: 0, idle: 2, Requests: 7, slow: 0, Traffic: 0req/sec"
Tasks: 3 (limit: 4621)
Memory: 67.5M
CGroup: /system.slice/php8.0-fpm.service
├─282200 php-fpm: master process (/etc/php/8.0/fpm/php-fpm.conf)
├─282212 php-fpm: pool www
└─282213 php-fpm: pool www
Oct 30 03:03:54 127.0.0.1localhost systemd[1]: Starting The PHP 8.0 FastCGI Promd[1]: Starting The PHP 8.0 FastCGI Process Manager...
Oct 30 03:03:54 127.0.0.1localhost systemd[1]: Started The PHP 8.0 FastCGI Procmd[1]: Started The PHP 8.0 FastCGI Process Manager.
答案1
尝试用找到它。
find / -name "*fpm.sock"
答案2
您可以选择:
netstat -pluntx |grep php
netstat 中的选项 -x 正在查找所有套接字监听