Internal Server Error 500 is shown on OpCache enabled sites with PHP 5.5 and higher

Created:

2016-11-16 13:02:55 UTC

Modified:

2017-05-15 19:35:46 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Internal Server Error 500 is shown on OpCache enabled sites with PHP 5.5 and higher

Applicable to:

  • Plesk 11.5 for Windows
  • Plesk 12.0 for Windows

Symptoms

Sites configured with PHP 5.5 and higher and enabled PHP OpCache are not working if there are several sites inside one subscription with dedicated pool and different .NET versions used on sites. The only one domain in a time will work properly, another one will fail with Internal Server 500 error .

Cause

PHP OpCache is unable to create named mutex for the second process. But the first process has successfully created a mutex, for example, ZendOPcache.SharedMemoryMutex@IWPD_1(a1) Despite the name of mutex contains real user name of the pool, but security of created pool has permissions for a special IIS ApplicationPoolIdentity account (its name is generated by pool name).

Second site has the same user name, but special generated ApplicationPoolIdentity user is different. So the second site cannot access this mutex.

The issue registered as Plesk issue #PPPM-4738 . Additionally, it was submitted to PHP as Bug #72645 .

Workaround

There are several possible workarounds:

  • Turn off OpCache for particular PHP handler by setting opcache.enable=0 in %plesk_dir%\Additional\PleskPHP55\php.ini

  • Create and specify local user for each application pool in IIS Application Pools > APP_POOL_NAME > Advanced Settings > Process Model > Identity

  • Upgrade to Plesk 12.5 and enable Dedicated IIS application pool for each website at Service Plans > SERVICE_PLAN_NAME > Performance

For PHP 5.5 and 5.6 we have prepared a custom fixes based on PHP 5.5.38 and PHP 5.6.24 source code.

  • For PHP 5.5 download patched file , unzip, rename it and replace original %plesk_dir%\Additional\PleskPHP55\ext\php_opcache.dll

  • For PHP 5.6 download patched file , unzip, rename it and replace original %plesk_dir%\Additional\PleskPHP55\ext\php_opcache.dll

Note: to prevent rewriting this file when PHP handler will be updated, place the file under the different name, for example, %plesk_dir%\Additional\PleskPHP56\ext\php_opcache_fixed.dll and configure in php.ini to load this file:

zend_extension="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP56\ext\php_opcache_fixed.dll"

In this case, after PHP is updated by Plesk, php.ini will be untouched and fixed module will be unchanged, so PHP will continue to work with modified module after Plesk update.

Attachments:

Have more questions? Submit a request
Please sign in to leave a comment.