• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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