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. 

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); }

To:

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:
admin.php?menu=admin&action=phpinfo

Thanks!

Dave Edis - Senior Developer
interactivetools.com

Hi Dave,

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

By wolf66 - November 22, 2016

As above. /var/local/ for both. 

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
interactivetools.com

By wolf66 - November 23, 2016

/mnt/target03/357330/www.dev-bccc.com/web/content/cmsb/admin.php

/mnt/stor14-wc1-ord1/xxxxxx/xxxxxx/www.DOMAINNAME.com/web/content/cmsb/admin.php