• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Custom PHP versions: no systemctl reload is issued on a change of PHP handlers when changing from any custom handler to any other handler

Peter Debik

Community Manager until 3/2024
Plesk Guru
Username:

TITLE


Custom PHP versions: no systemctl reload is issued on a change of PHP handlers when changing from any custom handler to any other handler

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

OS version, architecture: Ubuntu 20.04.5 LTS
Product version (including MU): 18.0.49 Update #2

PROBLEM DESCRIPTION

SOURCE

Issue - Plesk not reloading service of custom PHP handler

PROBLEM DESCRIPTION
When a PHP handler that was installed through Plesk installer is changed to another PHP handler, Plesk issues a "systemctl reload" command. As a result, the pool config is removed from poold and the socket file in /var/www/vhosts/system/<domain> is cleared.

But when the customer has installed a custom PHP handler and changes from that custom PHP handler to another PHP handler, Plesk does not issue a systemctl reload. In such a case the pool config is removed, but the custom handler's service does not notice that, because the systemctl reload is missing. This leads to the situation that the new handler cannot start, because:

ERROR: Another FPM instance seems to already listen on /var/www/vhosts/system/<domain>/php-fpm.sock

STEPS TO REPRODUCE

  • Install a custom PHP handler
  • Set any domain to that custom PHP handler.
  • Change the PHP handler to another PHP handler.

ACTUAL RESULT

No systemctl reload, socket file not removed

EXPECTED RESULT

systemctl reload, remove socket file

ANY ADDITIONAL INFORMATION

Solely based on customer forum post, not verified by CM.
Workaround: Run systemctl reload manually from the console.

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
Last edited:
Developers were not able to reproduce the issue on Ubuntu 20 with a custom PHP installed with
Code:
# add-apt-repository ppa:ondrej/php
# apt update
# apt install php8.1 php8.1-fpm php8.1-cli -y 
# plesk bin php_handler --add -id php81-fpm -displayname "8.1.14 (custom)" -path /usr/sbin/php-fpm8.1 -clipath /usr/bin/php8.1 -phpini /etc/php/8.1/cli/php.ini -type fpm -service php8.1-fpm -poold /etc/php/8.1/fpm/pool.d
 
The difference in my case was that I tried to add another handler for the existing binaries:

Code:
plesk bin php_handler --add -id plesk-php81-custom-fpm -displayname "8.1 custom" -path /opt/plesk/php/8.1/sbin/php-fpm -clipath /opt/plesk/php/8.1/bin/php -phpini /opt/plesk/php/8.1/etc/php.ini -type fpm -service plesk-php81-custom-fpm -poold /opt/plesk/php/8.1/etc/php-custom-fpm.d

This is how my ExecStart looked in the .service file:

Code:
ExecStart=/opt/plesk/php/8.1/sbin/php-fpm --nodaemonize -c /opt/plesk/php/8.1/etc/php.ini --pid /run/plesk-php81-custom-fpm.pid --fpm-config /opt/plesk/php/8.1/etc/php-custom-fpm.conf

I adjusted the service's PIDFile value accordingly.
 
@Jayfin3 Developers have tested your approach, but came to the conclusion that existing libraries cannot be reused for an additional custom handler. Instead, please follow the above mentioned steps to install custom PHP versions.
 
Developers were not able to reproduce the issue on Ubuntu 20 with a custom PHP installed with
Code:
# add-apt-repository ppa:ondrej/php
# apt update
# apt install php8.1 php8.1-fpm php8.1-cli -y
# plesk bin php_handler --add -id php81-fpm -displayname "8.1.14 (custom)" -path /usr/sbin/php-fpm8.1 -clipath /usr/bin/php8.1 -phpini /etc/php/8.1/cli/php.ini -type fpm -service php8.1-fpm -poold /etc/php/8.1/fpm/pool.d
@Peter Debik, tell me if you need to install additional packages libapache2-mod-php7.0 and libapache2-mod-fcgid?

It is clear what is php7.0-mysql needed.

And I don't understand why it's so complicated like this:
 
I do not know the answer to the lib question. In this case maybe asking Plesk support staff via ticket can be a good next step.
 
Back
Top