Using: Ubuntu 20.04
PHP starts failed because missing /var/run/php-fpm/php7.4-fpm.sock & /var/run/php-fpm/php7.4-fpm.pid.
Heres the details: (feedback from systemctl status php7.4-fpm.service
)
● php-fpm7.4[3465899]:ERROR: unable to bind
listening socket for address ‘/var/run/php-fpm/php7.5-fpm.sock’: No such
file or directory (2)
● php-fpm7.4[3465899]:ERROR: unable to bind
listening socket for address ‘/run/php-fpm/php7.5-fpm.pid’: No such
file or directory (2)
I checked "/etc/php/7.4/fpm/pool.d/www.conf", but there is the following code in the file:
;listen = 127.0.0.1:9000
listen = /var/run/php-fpm/php7.4-fpm.sock
2
Answers
Type in:
Find following code:
line 36:
change it to:
line 133:
Remove that line, save that file, and type in:
Thanks: @tkausl @dai007uk
First problem: it is searching for
php7.5-fpm.sock
instead ofphp7.4-fpm.sock
But since you confirmed that your
/etc/php/7.4/fpm/pool.d/www.conf
indeed haslisten = /var/run/php-fpm/php7.4-fpm.sock
, I will just assume thephp7.5-fpm.sock
naming was handled/adjusted.Second problem: the
.sock
file does not exist when your FPM is running. To solve this, run the following:NOTE:
If you get permission denied, you should use
sudo
for the above commands.Then restart your PHP-FPM service.
Hope that helps!