Articles in this section

Alt-php-fpm fails to start on CloudLinux: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (98)

Plesk for Linux kb: technical cloudlinux

Applicable to:

  • Plesk for Linux

Symptoms

  • alt-php-fpm from CloudLinux fails to start after recent updates with error:

CONFIG_TEXT: php-fpm[989147]: ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (98) 
php-fpm[989147]: ERROR: FPM initialization failed

  • The installed alt-php versions have identical pool configuration listening on the same port:

# grep -HRi "^listen =" /opt/alt/php*/etc/ 
/opt/alt/php81/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000 
/opt/alt/php82/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000 
/opt/alt/php83/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000 
/opt/alt/php84/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000 
/opt/alt/php85/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000

Cause

Only one service can listen on a port at one time. The first alt-phpXX-fpm.service that starts will successfully bind to port 9000; every other alt-php version attempting to start afterward will fail with Address already in use

Confirm which process currently holds the port:

# ss -ltnp | grep :9000 
LISTEN 0 65535 127.0.0.1:9000 0.0.0.0:* users:(("php-fpm",pid=564445,fd=13),("php-fpm",pid=564444,fd=13),("php-fpm",pid=197238,fd=11))

This is a known bug in CloudLinux.

Resolution

A fix is available upstream. Update the operating system:

# yum update

If above does not show any updates then execute the following instead:

# yum groupupdate alt-phpXX* --enablerepo=cloudlinux-updates-testing

*Change XX version according to needs, for example alt-php82

If the issue persists after updating, contact CloudLinux support.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.