• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Issue PHP-FPM Opcache bug - warning repeatedly thrown and logged in error log

tristansilkstream

New Pleskian
Server operating system version
Ubuntu 24.04.2 LTS
Plesk version and microupdate number
18.0.71 #2
I have applications that are sensitive to warnings in addition to errors and will fail a request if a warning is found. When running my scripts on PHP FPM handlers, there is an error relating to enabling opcache that is breaking my scripts output.

This is the error dumped from a PHP script:

array(4) { ["type"]=> int(2) ["message"]=> string(89) "Zend OPcache can't be temporary enabled (it may be only disabled till the end of request)" ["file"]=> string(7) "Unknown" ["line"]=> int(0) }

You can also find it in the error log: /var/log/plesk-php84-fpm/error.log

I recently set up a new server with Plesk Obsidian 18.0.71 Update 2 and installed my software under a new subscription running PHP 8.4 FPM. Dedicated and shared PHP FPM are affected. FastCGI is not affected.

I have set up a clean install of Plesk with a subscription showing the error which I can give Plesk staff access to.

The issue seems to happen since Plesk Obsidian 18.0.70

https://docs.plesk.com/release-notes/obsidian/change-log/#plesk-18070

I believe this is the specific change that has caused this problem:

"(Plesk for Linux) It is no longer possible to bypass the default PHP performance settings in PHP-FPM handlers using the .user.ini settings file or the PHP ini_set() command. The default PHP performance settings should be optimal for most websites, and changing the settings could impact the websites’ performance."

It looks like Plesk is creating two config files per domain and both set opcache.enable = 1 which seems to cause the issue.

For shared PHP FPM, the two files would be:

/var/www/vhosts/system/domain-name-example.com/etc/php.ini

opcache.enable = 1

/opt/plesk/php/8.4/etc/php-fpm.d/domain-name-example.com.conf

php_admin_value[opcache.enable] = 1

For dedicated, I think the FPM pool conf file is in a different location.

In previous versions of Plesk, we don't have the FPM conf file. This has only just started appearing recently especially for new subscriptions being set up.
 
I would suggest opening a ticket with Plesk support for further investigation on your server. To sign-in and open a ticket please go to:
If you got your license from a reseller, your reseller is in charge of providing you with support. You can raise the inquiry with them and they can forward it to our team for further processing.If the reseller does not provide support, here is an alternative to get support directly from Plesk:
 
I've seen the same issue in our logs and can confirm the same diagnosis: two files being generated by Plesk with the same configuration for the opcache.enable parameter. Although a warning, it is flooding our logs as it is logged for every invocation of PHP.
 
I would suggest opening a ticket with Plesk support for further investigation on your server. To sign-in and open a ticket please go to:
If you got your license from a reseller, your reseller is in charge of providing you with support. You can raise the inquiry with them and they can forward it to our team for further processing.If the reseller does not provide support, here is an alternative to get support directly from Plesk:

We use ANS Group in the UK for our hosting and they have provided all of the Plesk licences for us. Unfortunately, they don't seem interested in sending bug reports through to Plesk and will only implement an immediate fix.

In this case, we've been able to work around the issue with our PHP software but it doesn't stop the log file at /var/log/plesk-php84-fpm/error.log bloating. If you have a busy site, this log file will receive a new entry every 15 seconds or so, depending on the opcache time expiry.

My original post indicates where I believe the issue originates from.

You can replicate this issue by creating a new subscription on any server running Plesk Obsidian 18.0.71 that uses PHP-FPM.

Simply add an index.php file to the httpdocs directory and remove the default index.html if it exists. Go to that index.php file on your internet browser and it should have logged a new entry in the error.log. The error can also be retrieved by PHP using the error_get_last() function.

index.php example:

PHP:
<?php

var_dump(error_get_last());

Also worth reiterating that the error only occurs every 15 seconds or so due to the way opcache works with caching PHP scripts.

I don't need an urgent fix on this but it would be good to have this fixed in a future Plesk update.
 
@tristansilkstream . Thank you for the further clarification. I was unsuccessful in replicating the behavior with the duplicate directives, but I am positive this is root cause of the issue. Can you run the following command on your server, please:

Bash:
plesk db -e "SELECT value FROM TmplData INNER JOIN Templates ON (TmplData.tmpl_id = Templates.id AND TmplData.element = 'phpSettingsId' AND Templates.name='Default Domain')"

where Default Domain is the plan assigned to the domain name(s) experiencing the issue. The output should be value X. Then:

Bash:
plesk db -e "SELECT * FROM PhpSettingsParameters WHERE id=X and name='opcache.enable'"

where id=X is the value the previous command returned.
 
@Sebahat.hadzhi
Thank you for coming back to this issue.

Unfortunately I didn't get any output from this command.

Bash:
plesk db -e "SELECT * FROM PhpSettingsParameters WHERE id=19 and name='opcache.enable'"

I tried to run this command instead and got the following output.

Bash:
plesk db -e "SELECT * FROM PhpSettingsParameters WHERE id=19"

Code:
id      name    value
19      disable_functions       opcache_get_status
19      enableFastcgi   on
19      error_reporting E_ALL
19      max_execution_time      60
19      open_basedir    {WEBSPACEROOT}{/}{:}{TMP}{/}
19      pm      ondemand
19      pm.max_children 50
19      pm.max_requests 0
19      pm.max_spare_servers    1
19      pm.min_spare_servers    1
19      pm.start_servers        1
19      safe_mode       off
 
Thank you for the confirmation, @tristansilkstream . The behavior indeed has been recognized as a bug identified with ID PPPM-15067. The ETA for the fix is the upcoming Plesk release (17.0.72). Until the fix is released the workaround we can suggest is:

1. Commenting out the php_admin_value[opcache.enable] line in /opt/plesk/php/8.4/etc/php-fpm.d/*.conf
2. The running:

Bash:
systemctl reload 'plesk-php*-fpm.service'

This should stop the warnings. Please let me know if the issue still persists on your end.
 
Back
Top