php-fpmを再起動しようとしたらunable to bind listening socket for address ‘127.0.0.1:9000’: Address already in use (98)

[dacelo@kusanagi ]$ sudo systemctl restart php-fpm
Job for php-fpm.service failed because the control process exited with error code. See "systemctl status php-fpm.service" and "journalctl -xe" for details.
[gp_kikukawa@kusanagi07 DocumentRoot]$ sudo systemctl status php-fpm.service
● php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 木 2019-04-25 16:44:54 JST; 16s ago
Process: 61932 ExecStart=/usr/sbin/php-fpm --nodaemonize (code=exited, status=78)
Main PID: 61932 (code=exited, status=78)
 
425 16:44:54 kusanagi.internal php-fpm[61932]: [25-Apr-2019 16:44:54] ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (98)
425 16:44:54 kusanagi0..internal php-fpm[61932]: [25-Apr-2019 16:44:54] ERROR: FPM initialization failed
Hint: Some lines were ellipsized, use -l to show in full.
 
unable to bind listening socket for address '127.0.0.1:9000': Address already in use (98)

ポート9000が競合してるらしい。
lsofで使用中のポートを見てみる。

[dacelo@kusanagi nginx]$ sudo lsof -i:9000
COMMAND   PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
php-fpm 45557  root    7u  IPv4 588046      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 45583 httpd    9u  IPv4 588046      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 45584 httpd    9u  IPv4 588046      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 45585 httpd    9u  IPv4 588046      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 45586 httpd    9u  IPv4 588046      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 45587 httpd    9u  IPv4 588046      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 45588 httpd    9u  IPv4 588046      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 45589 httpd    9u  IPv4 588046      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 45590 httpd    9u  IPv4 588046      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 45591 httpd    9u  IPv4 588046      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 45592 httpd    9u  IPv4 588046      0t0  TCP localhost:cslistener (LISTEN)

なんでnginxしか使ってないのにhttpdのプロセスがあるのかなー。ちょと不安に感じながらも全部kill…と思ったら、最初のrootのプロセスをkillしたら全部連鎖して死んだ。

[dacelo@kusanagi nginx]$ sudo systemctl restart php-fpm.service
[dacelo@kusanagi nginx]$ sudo systemctl status php-fpm.service
● php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
Active: active (running) since 木 2019-04-25 17:10:23 JST; 12s ago
Main PID: 64263 (php-fpm)
Status: "Processes active: 0, idle: 10, Requests: 0, slow: 0, Traffic: 0req/sec"
CGroup: /system.slice/php-fpm.service
├─64263 php-fpm: master process (/etc/php-fpm.conf)
├─64264 php-fpm: pool www
├─64265 php-fpm: pool www
├─64266 php-fpm: pool www
├─64267 php-fpm: pool www
├─64268 php-fpm: pool www
├─64269 php-fpm: pool www
├─64270 php-fpm: pool www
├─64271 php-fpm: pool www
├─64272 php-fpm: pool www
└─64273 php-fpm: pool www

広告

うまくいきました。

About: dacelo


Leave a Reply

Your email address will not be published. Required fields are marked *