Articles in this section

PHP-FPM handler failed to be configured for domain on Plesk for Linux server: An another FPM instance seems to already listen on

Plesk for Linux kb: technical ABT: Group B

Applicable to:

  • Plesk for Linux

Symptoms

  • PHP-FPM handler failed to be configured for the domain. When pressing OK in Plesk in Domains > example.com > PHP Settings, the following error appears:

    PLESK_ERROR: phpinimng failed: invoke-rc.d:initscript plesk-php72-fpm, action "status" failed. invoke-rc.d:initscript plesk-php72-fpm, action "status" failed.Service plesk-php72-fpm is down after attempt to start it.

  • The same error appears when trying to start the corresponding PHP-FPM service in Tools & Settings > Services Management

  • The log file /var/log/plesk-php72-fpm/error.log contains the following error:

    CONFIG_TEXT: NOTICE: configuration file /opt/plesk/php/7.2/etc/php-fpm.conf test is successful
    ERROR: An another FPM instance seems to already listen on /var/www/vhosts/system/example.com/php-fpm.sock
    ERROR: FPM initialization failed

    Note: PHP version may differ from 7.2 (e.g., it can be 7.3)

PLESK_ERROR: Error: phpinimng failed: WARNING:fpm_util:no uptime entry plesk-service.localdomain.conf is configured for the pool /opt/plesk/php/7.4/etc/php-fpm.d, fallback to run check Job for plesk-php74-fpm.service failed because the control process exited with error code.

Cause

Leftover Domain PHP configuration files causing a conflict with the current PHP version selected in Domains > example.com > PHP Settings

Resolution

  1. Connect to the server via SSH

  2. Download and unpack the script to find all conflicting configuration files:

    # curl -LO https://support.plesk.com/hc/en-us/article_attachments/12377594509335/115002165905-find-extra-config-files.php.tar.gz

    # tar xf 115002165905-find-extra-config-files.php.tar.gz

  3. Run the script to get a list of the configuration files:

    # plesk php 115002165905-find-extra-config-files.php
    [CRIT] File /etc/php/7.0/fpm/pool.d/example.com.conf may cause PHP failure: domain example.com has "plesk-php72-fpm" handler specified, but this file is used to configure "fpm" handler!
    [CRIT] File /etc/php/7.0/fpm/pool.d/example.org.conf may cause PHP failure: domain example.org has "plesk-php72-fpm" handler specified, but this file is used to configure "fpm" handler!

  4. Remove all the configuration files mentioned above:

    # rm /etc/php/7.0/fpm/pool.d/example.com.conf /etc/php/7.0/fpm/pool.d/example.org.conf

  5. Restart the PHP-FPM services:

    # systemctl restart plesk-php* php*

  6. Recreate the PHP-FPM sockets and configuration files:

    # plesk bin php_settings -u

Note: Also, there can be found other files:

  • The /opt/plesk/php/X.X/etc/php-fpm.d/plesk-service.localdomain.conf files are created by Plesk for the proper PHP functionality. PHP handlers might work incorrectly if these files are absent. If the files were removed accidentally it is possible to recreate them by using the next command:

    # plesk sbin php_handlers_control --list-json | plesk sbin phpinimng --batch-uptime-conf-from-json

  • The /etc/php-fpm.d/www.conf is the default Apache file that is no needed nor for Plesk neither to the Apache itself as of now. It can be removed without any consequences.

Was this article helpful?

Comments

2 comments
Date Votes
  • Hi Francisco Garcia,

     

    May I ask, if you can say why I couldn't open the downloaded file:

    # tar xf 115002165905-find-extra-config-files.php.tar.gz
    gzip: stdin: not in gzip format
    tar: Child returned status 1
    tar: Error is not recoverable: exiting now

    # file 115002165905-find-extra-config-files.php.tar.gz
    115002165905-find-extra-config-files.php.tar.gz: HTML document, ASCII text, with very long lines (2515)

    # wget https://plesk.zendesk.com/hc/article_attachments/12377594509335/115002165905-find-extra-config-files.php.tar.gz
    --2023-04-30 23:04:37--  https://plesk.zendesk.com/hc/article_attachments/12377594509335/115002165905-find-extra-config-files.php.tar.gz
    Resolving plesk.zendesk.com (plesk.zendesk.com)... 104.16.51.111, 104.16.53.111
    Connecting to plesk.zendesk.com (plesk.zendesk.com)|104.16.51.111|:443... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: https://plesk.zendesk.com/hc/restricted?return_to=https%3A%2F%2Fplesk.zendesk.com%2Fhc%2Farticle_attachments%2F12377594509335%2F115002165905-find-extra-config-files.php.tar.gz&locale=en-us [following]
    --2023-04-30 23:04:37--  https://plesk.zendesk.com/hc/restricted?return_to=https%3A%2F%2Fplesk.zendesk.com%2Fhc%2Farticle_attachments%2F12377594509335%2F115002165905-find-extra-config-files.php.tar.gz&locale=en-us
    Reusing existing connection to plesk.zendesk.com:443.
    HTTP request sent, awaiting response... 403 Forbidden
    2023-04-30 23:04:37 ERROR 403: Forbidden.


    Could it be the Plesk Support KB article now behind a user and password, causing this problem?

     

    I have manage to directly download the file from this current Plesk support article webpage and upload it to the website.

     

    May I ask what would the below mean, and how should  it be fixed?

     

    # plesk php 115002165905-find-extra-config-files.php
    PHP Warning:  Undefined array key 0 in /root/nginx-backups/115002165905-find-extra-config-files.php on line 129
    [CRIT] Orphan file /opt/plesk/php/8.2/etc/php-fpm.d/plesk-service.localdomain.conf exists for the domain plesk-service.localdomain not present in Plesk
    1
  • [root@server2 ~]# plesk php 115002165905-find-extra-config-files.php
    PHP Warning:  Undefined array key 0 in /root/115002165905-find-extra-config-files.php on line 129
    [CRIT] Orphan file /opt/plesk/php/7.4/etc/php-fpm.d/plesk-service.localdomain.conf exists for the domain plesk-service.localdomain not present in Plesk
    PHP Warning:  Undefined array key 0 in /root/115002165905-find-extra-config-files.php on line 129
    [CRIT] Orphan file /opt/plesk/php/8.2/etc/php-fpm.d/plesk-service.localdomain.conf exists for the domain plesk-service.localdomain not present in Plesk
    [root@server2 ~]# rm /etc/php/7.0/fpm/pool.d/example.com.conf /etc/php/7.0/fpm/pool.d/example.org.conf
    rm: das Entfernen von „/etc/php/7.0/fpm/pool.d/example.com.conf“ ist nicht möglich: Datei oder Verzeichnis nicht gefunden
    rm: das Entfernen von „/etc/php/7.0/fpm/pool.d/example.org.conf“ ist nicht möglich: Datei oder Verzeichnis nicht gefunden

    1

Please sign in to leave a comment.