E_WARNING: Zend OPcache API is restricted by "restrict_api" configuration directive

20 posts by 4 authors in: Forums > CMS Builder
Last Post: November 30, 2016   (RSS)

By wolf66 - November 21, 2016

Also on Rackspace and getting this error. Just leaving this message here in case there is a resolution posted. 

By Steve99 - November 22, 2016

Hi wolf66,

The error suppression Dave suggested worked for us (https://www.interactivetools.com/forum/forum-posts.php?postNum=2239627#post2239627).

The CMSB code does check if the function exists before calling it, and currently on Rackspace it is enabled but what the functions actually do on the server is restricted - so it triggers the error.

In /lib/common.php update this line:

if (function_exists('opcache_invalidate')) { opcache_invalidate($filepath, true); }


if (function_exists('opcache_invalidate')) { @opcache_invalidate($filepath, true); }

You will no longer see the error.

We've also found that the server cache is rebuilt rather quickly so we haven't disabled opcache.

By wolf66 - November 22, 2016

Thanks a lot :-) 

By Dave - November 22, 2016

Hi Guys, 

We're going to add this patch to the next release.

Can you check the phpinfo page on your server and let me know what the value of "opcache.restrict_api" is? 

If you're logged into the CMS as admin you can see the phpinfo page here (also linked from the bottom of Admin > General:


Dave Edis - Senior Developer

By Steve99 - November 22, 2016

Hi Dave,

Local and Master Value shows as "/var/local"

By Dave - November 22, 2016

Thanks guys, and what is SCRIPT_FILENAME set to? Or the beginning of it (you can just xxxxxx out your domain/account specific info).  

Dave Edis - Senior Developer

By wolf66 - November 23, 2016


By Steve99 - November 28, 2016


By Dave - November 30, 2016

Thanks guys!  I've used that information to add some code that we can use in future if opcache issues come up again.  Cheers!

Dave Edis - Senior Developer