Zend OPcache API is restricted by "restrict_api" configuration directive

#1

Any idea how to get around this error? I’ve heard Rackspace did something with this flag recently but I’m not seeing it in the admin on all of our grav sites on Rackspace.

#2

Sorry for the double post, I can’t delete the other one though. Rackspace broke this 8 days ago. The .htaccess flag they recommend does it turn it off. Every grav site we host will be broken with no way to repair it unless we can figure a workaround.

#3

Just an FYI if anyone else is on Rackspace and wondering what is going on. I’ll let you know if we find a way.

#4

This is what they recommended in the .htaccess if it helps anyone else, didn’t work for us: php_flag xcache.cacher 0

#5

This worked for me. http://www.interactivetools.com/forum/forum-posts.php?postNum=2239640

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

#6

Anyone found a more permanent fix for this? I’m also trying to get Grav running on Rackspace - the above solution worked but I’m still having issues accessing the admin now, getting the same “Zend OPcache API is restricted” message. I’m also concerned making a temp change in the system files will just get overwritten when the CMS is updated.

Any assistance would be much appreciated.

#7

We’ll probably stop using Grav just for this issue. Easier to stop using it than to stop using our hosting.

#8

@julizmt, where is this error coming from? Can you please turn on:

errors:
  display: true

In your user/config/system.yaml and provide the trace that points to the file and line that throws the error.

#9

BTW, i think you can just disable opcache via your .htaccess:

php_flag opcache.enable Off
#10

Just one thought, the fact that RackSpace is forcibly disabling opcache is just going to hurt your performance. Seems on odd choice on their part. I would think there are better hosting opportunities that don’t cripple PHP performance like that.

#11

This fix ‘should’ resolve your original issue. Can you please test? https://github.com/getgrav/grav/commit/c6c8577b6f21b9e9ee7292824fe2fab17595dc04

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