search

Home  >  Q&A  >  body text

Not found /var/run/php-fpm/php7.4-fpm.sock or /var/run/php-fpm/

Using: Ubuntu 20.04

PHP startup failedbecause /var/run/php-fpm/php7.4-fpm.sock and /var/run/php-fpm/php7.4-fpm.pid are missing.

The details are as follows: (Feedback from systemctl status php7.4-fpm.service)

● php-fpm7.4[3465899]: Error: Unable to bind Listening socket at address "/var/run/php-fpm/php7.5-fpm.sock": There is no such thing File or directory (2)

● php-fpm7.4[3465899]: Error: Unable to bind Listening socket at address "/run/php-fpm/php7.5-fpm.pid": There is no such thing File or directory (2)

I checked "/etc/php/7.4/fpm/pool.d/www.conf" but there is the following code in the file:

;li sten = 127.0.0.1:9000
lis ten = /var/run/php-fpm/php7.4-fpm.sock


P粉036800074P粉036800074424 days ago696

reply all(1)I'll reply

  • P粉894008490

    P粉8940084902023-10-31 15:53:54

    First problem: It is searching for php7.5-fpm.sock instead of php7.4-fpm.sock

    But since you confirmed that your /etc/php/7.4/fpm/pool.d/www.conf does have listen = /var/run/php-fpm/php7.4 -fpm.sock, I assume php7.5-fpm.sock naming has been processed/adjusted.

    Second Problem: When your FPM is running, the .sock file does not exist. To resolve this issue, run the following command:

    mkdir -p /var/run/php-fpm
    touch /var/run/php-fpm/php7.4-fpm.sock
    

    Notice: If your permission is denied, you should use sudo to execute the above command.

    Then restart your PHP-FPM service.

    Hope it helps!

    reply
    0
  • Cancelreply