There is a patch for opcache file collisions in a chroot'd environment
http://git.php.net/?p=php-src.git;a=patch;h=ecba563f2fa1e027ea91b9ee0d50611273852995
It is detailed near the bottom of:
PHP :: Request #69090 :: add prefix/xor to cache keys/check permissions or separate caches
I can confirm that it does solve the collision problems when using opcache in a chroot'd environment. Is this a patch that cPanel needs to include in their PHP offering? Or do you think PHP will include it in later releases (Note the patch was first created on November 15th, 5 days after PHP 5.6.28 was released).
This bug only seems to affect opcache in a chroot'd environment. I doubt many cPanel users are using php-fpm chroots (I doubt many cPanel users are using php-fpm period).
All that being said, I'm left to agree with
@cPanelMichael and the people from ServerFault that using OpCache in any shared hosting environment isn't recommended. The new question is, is there a compiled byte-code optimizer that is recommended for shared hosting environments? In the original post to this thread I mentioned Xcache as being a possible replacement, given it's
xcache.var_namespace_mode and
xcache.var_namespace variables. But Xcache only works up to PHP 5.6 and I don't think there are any plans to continue it with PHP 7.0 or PHP 7.1.
It's also important to note that most people have been or probably still are using suPHP as their PHP Handler. No compiled byte-code optimizer works with suPHP (at least that I am aware of). So the lack of OpCache, Xcache, or any compiled byte-code optimizer probably isn't much of a detriment as one might think.