php-fpm 未创建 /run/php/php7.2-fpm.sock(ubuntu 18.04 服务器)

php-fpm 未创建 /run/php/php7.2-fpm.sock(ubuntu 18.04 服务器)

错误日志ERROR: unable to bind listening socket for address '/run/php/php7.2-fpm.sock': No such file or directory

有人可以帮我找出这个问题吗,因为我没有主意了,下面是我一直在寻找的,而且从我所看到的,一切都很好。

文件位置加代码:

/usr/sbin/php-fpm7.2(存在)

/etc/init/php7.2-fpm.conf(存在,见下面的代码)

# php7.2-fpm - The PHP FastCGI Process Manager

description "The PHP 7.2 FastCGI Process Manager"
author "Ondřej Surý <[email protected]>"

start on runlevel [2345]
stop on runlevel [016]

# you can uncomment this with recent upstart
# reload signal USR2

pre-start script
mkdir -p /run/php
chmod 0755 /run/php
chown www-data:www-data /run/php
end script

respawn
exec /usr/sbin/php-fpm7.2 --nodaemonize --fpm-config /etc/php/7.2/fpm/php-fpm.conf

/etc/init.d/php7.2-fpm(存在,参见下面的代码,仅复制了我认为必要的内容)

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="PHP 7.2 FastCGI Process Manager"
NAME=php-fpm7.2
CONFFILE=/etc/php/7.2/fpm/php-fpm.conf
DAEMON=/usr/sbin/$NAME
DAEMON_ARGS="--daemonize --fpm-config $CONFFILE"
CONF_PIDFILE=$(sed -n 's/^pid[ =]*//p' $CONFFILE)   
PIDFILE=${CONF_PIDFILE:-/run/php/php7.2-fpm.pid}
TIMEOUT=30
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

/etc/php/7.2/fpm/php7.2-fpm(存在,见下面的代码)

 pid = /run/php/php7.2-fpm.pid

/etc/php/7.2/fpm/pool.d/www.conf(存在,见下面的代码)

 user = www-data
 group = www-data
 listen = /run/php/php7.2-fpm.sock
 listen.owner = www-data
 listen.group = www-data
 ;listen.mode = 0660 (i have comment this on and off, no changes on the above error output)

/etc/nginx/sites-available/default(存在,参见下面的代码

location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.2-fpm.sock; (I have changed this to /var/run/php/php7.2-fpm.sock but no difference /var/run is a symlink to /run
}

我不知道在哪里可以查找错误或者如何修复它。

有人能帮我解释一下错误可能出在哪里吗?谢谢

相关内容