大网数据广告活动
服务器运维问答

PHP-FPM - Error 503 - Attempt to connect to Unix domain socket failed

· 52CE 我爱测

I get on server this errors (CentOs 7): [proxy:debug] proxy_util.c(2209): [client 80.251.245.153:61902] AH00944: connecting fcgi://127.0.0.1/data/webs/dev/index.php to 127.0.0.1:8000 [proxy:debug] proxy_util.c(2246): [client 80.2…

问题原文

原帖链接 · Pavel Novák · CC BY-SA 3.0

I get on server this errors (CentOs 7):

[proxy:debug] proxy_util.c(2209): [client 80.251.245.153:61902] AH00944: connecting fcgi://127.0.0.1/data/webs/dev/index.php to 127.0.0.1:8000
[proxy:debug] proxy_util.c(2246): [client 80.251.245.153:61902] AH02545: fcgi: has determined UDS as /tmp/php56-fpm.sock
[proxy:debug] proxy_util.c(2418): [client 80.251.245.153:61902] AH00947: connected /data/webs/dev/index.php to httpd-UDS:0
[proxy:error] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /tmp/php56-fpm.sock (*) failed
[proxy_fcgi:error] AH01079: failed to make connection to backend: httpd-UDS
[proxy:debug] proxy_util.c(2171): AH00943: FCGI: has released connection for (*)

Socket Exists, i'm tried change permissions to 777, but not working:

 ls -l /tmp/php56-fpm.sock
-rw-rw----. 1 apache apache 0 Feb 17 16:11 /tmp/php56-fpm.sock

PHP-FPM www.conf listen setting (full file is here: https://pastebin.com/uD5GsMna):

listen=/tmp/php56-fpm.sock

Virtualhost:

<VirtualHost *:80>
   ServerName dev.stavebninyfranek.com
   DocumentRoot "/data/webs/dev"
   <FilesMatch "\.php$">
     SetHandler  "proxy:unix:/tmp/php56-fpm.sock|fcgi://127.0.0.1"
   </FilesMatch> 
 </VirtualHost>

My config files is (httpd.conf): https://pastebin.com/XS6cDuFQ

Im tryed change socket, change permission to apache:apache user, but I dont know where is problem.

Thanks

社区高分解答

原帖链接 · paulie · CC BY-SA 4.0

This is potentially caused by systemd configuration on Apache, on Centos 7 for example by default the service is configured with :

PrivateTmp=true

Which means it gets its own subdirectory in /tmp visible as /tmp so it can't see files in /tmp added by other programs. The solution would be to not use /tmp for your php-fpm sockets (more secure than setting the above to false).

(I realise that in at least one case a Debian derivative is in use, but it uses systemd too!)

paulie.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-02-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。