Jump to content

Warning: Zend OPcache API is restricted by "restrict_api" configuration directive... yadda yadda....


Greg Lumley
 Share

Recommended Posts

Hi, I'm getting this error on a new host: I've never seen it before and wondered if someone has dealt with something similar in the past? If so, were you able to solve it?

Also, according to phpinfo(); mod_rewrite is enabled but none of the urls are working. I'm ready to move her site to a new host but thought I'd ask here first. 

 

Warning: Zend OPcache API is restricted by "restrict_api" configuration directive in /usr/www/users/floreng/000/site/assets/cache/FileCompiler/site/modules/AdminLinksInFrontend/AdminLinksInFrontend.module on line 170 Warning: session_name(): Session name cannot be changed after headers have already been sent in /usr/www/users/floreng/000/wire/core/Session.php on line 294 Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in /usr/www/users/floreng/000/wire/core/Session.php on line 297 Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in /usr/www/users/floreng/000/wire/core/Session.php on line 298 Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in /usr/www/users/floreng/000/wire/core/Session.php on line 299 Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in /usr/www/users/floreng/000/wire/core/Session.php on line 300

Thank you so much. 

Link to comment
Share on other sites

Check phpinfo for ini setting opcache.restrict_api. AdminLinksInFrontend tries to use opcache for performance. The warning means that there's a path in that setting that doesn't match with the path to AdminLinksInFrontend.module. The module tries to call opcache_get_status() in that line, which triggers the warning.

Putting the line

ini_set('opcache.restrict_api', '/usr/www/users/floreng/000');

or

ini_set('opcache.restrict_api', '');

into site/config.php might be enough to get rid of the warning.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

So, I'm not sure what the issue was with the host I was using. They maintained there was a security issue with the opcache. After some research, I see there was one, somewhere around 2018 whith earlier versions of PHP. It seems none of the hosts I use now have the urge to switch it off.

In a nutshell: BitPoet's solution didn't work but, I'm sure that was due to the hosts settings. I moved to another host. 

Up till this host, I'd never had the cache issue before. 

 

G

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...