PHP-FPM kann unter Ubuntu 20.04 nicht gestartet werden

PHP-FPM kann unter Ubuntu 20.04 nicht gestartet werden

Ich versuche, php8.1-fpm zu starten und erhalte den folgenden Fehler (während php8.0-fpm und php7.4-fpm korrekt starten). Für jede Hilfe wäre ich sehr dankbar.

[root@ ~]# systemctl status php8.1-fpm.service
● php8.1-fpm.service - The PHP 8.1 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php8.1-fpm.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2022-06-14 17:06:17 EEST; 5s ago
       Docs: man:php-fpm8.1(8)
    Process: 39682 ExecStart=/usr/sbin/php-fpm8.1 --nodaemonize --fpm-config /etc/php/8.1/fpm/php-fpm.conf (code=exited, status=78)
    Process: 39693 ExecStopPost=/usr/lib/php/php-fpm-socket-helper remove /run/php/php-fpm.sock /etc/php/8.1/fpm/pool.d/www.conf 81 (code=exited, status=0/SUCCESS)
   Main PID: 39682 (code=exited, status=78)

Jun 14 17:06:17 domain.com systemd[1]: Starting The PHP 8.1 FastCGI Process Manager...
Jun 14 17:06:17 domain.com php-fpm8.1[39682]: [14-Jun-2022 17:06:17] ERROR: unable to bind listening socket for address 'localhost:8002': Address already in use (98)
Jun 14 17:06:17 domain.com php-fpm8.1[39682]: [14-Jun-2022 17:06:17] ERROR: FPM initialization failed
Jun 14 17:06:17 domain.com systemd[1]: php8.1-fpm.service: Main process exited, code=exited, status=78/CONFIG
Jun 14 17:06:17 domain.com systemd[1]: php8.1-fpm.service: Failed with result 'exit-code'.
Jun 14 17:06:17 domain.com systemd[1]: Failed to start The PHP 8.1 FastCGI Process Manager.

Antwort1

Es scheint, dass Sie bereits einen Prozess auf Port 8002 in Ihrem lokalen Host laufen haben

Identifizieren Sie den Prozess netstat -ltnp | grep -w ':8002'und prüfen Sie, ob Sie ihn beenden können oder nicht

Wenn ein anderer Prozess Port 8002 benötigt, können Sie den php-fpm-Port in der Datei ändern/etc/php/8.1/fpm/pool.d/www.conf

verwandte Informationen