• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • 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.

Forwarded to devs PHP: Additional directives extension handling incorrect

frame86

New Pleskian
Username:

TITLE

PHP: Additional directives extension handling incorrect

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Plesk Version 18.0.66 Update #2; Linux

PROBLEM DESCRIPTION

If we add a PHP extension to a site configuration via "Additional directives" section, the extension is written to php.ini and php-fpm.conf.

It may be correct for cli execution where only php.ini is read but wrong for a FPM worker that also reads php.ini which spams the logs with:

> PHP Warning: Module "x" is already loaded in Unknown on line 0

STEPS TO REPRODUCE

Add "extension=x.so" to "Additional directives" section in PHP settings for a site and apply. See error logs.

ACTUAL RESULT

The configuration is written to php.ini and php-fpm.conf as php_value.

EXPECTED RESULT

This a bit tricky since we want a different enviroment for FPM worker and command line. The error would be gone if the "extension" entry is only applied via php.ini but then it would be permamently loaded in command line.

The only (not confusing) solution for this problem is to split the sections:

Additional directives - FCGI/FPM only
Additional directives - php.ini (global)

ANY ADDITIONAL INFORMATION

Please note that there are (PECL) extensions that may work differently in cli and cgi modes or need other settings applied.

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
@frame86 , could you please confirm the Linux distribution and version of the server, the PHP version, and the exact module in question? Thank you in advance.
 
Linux distribution:
Ubuntu 24.04.1 LTS

PHP Extension:
take Xdebug 3.4.0 as an example.

PHP Version:
eg. 8.1

This extension must be loaded as "zend_extension". But this directive is not valid for PHP-FPM configuration, only in php.ini.
php fpm "ERROR: Unable to set php_value 'zend_extension'"

We can set up Xdebug in plesk but it complains:
extension=xdebug.so
PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0

XDebug is a wide common extension - that case should be clear.

We know that we can enable Xdebug as extension globally but this is not wanted as it slows down every site and may cause side effects if a debugger is enabled.

This is just an example that there are settings that must be splitted to php.ini and php-fpm.conf.

In our special case we want that a module is loaded in PHP-FPM but not in CLI mode. But every time we change the directive in plesk (or the service plan) it will be restored in php.ini which is annoying.
 
Quick fix:
You could filter out "extension" from "Additional directives" and only apply it in php.ini but not php-fpm.conf

but we would really appreciate if we had full control about any directive in a splitted configuration for php.ini and php-fpm.conf so we don't have to manually edit php.ini each time again.
 
Thank you for your patience, @frame86. The described behavior was not reproduced and recognized as a product bug. Our team added extension=gd in the additional directives section for PHP 8.2 and they were unable to locate it as added to the php conf file under /var/www/vhosts/10-69-45-15.qa.plesk.tech/opt/plesk/php/8.2/etc/php-fpm.conf.
 
Apologies for the misunderstanding. Forwarded the clarification to our team and I will update you with more details as soon as possible.
 
Thank you for your patience. The error PHP Warning: Module "x" is already loaded in Unknown on line 0 returned while there are additional directive added to PHP Settings was recognized as a bug with ID PPPM-14807 and it will be fixed in one of Plesk's future releases. You can observe the change log here. Thank you for bringing our attention to the issue.

The only (not confusing) solution for this problem is to split the sections:

Additional directives - FCGI/FPM only
Additional directives - php.ini (global)

If you would like such a functionality to be added to Plesk, please do consider opening a UserVoice request. If there is demand for it, our team will take it into accout.
 
Back
Top