Post by robert@ipc » Thu Aug 24, 2023 10:18 pm

I have installed a brand new install of 4.0.2.2

in the administration menus when entering data and for the site viewer we get the following error:

Warning: Zend OPcache API is restricted by "restrict_api" configuration directive in </mnt/location/mydomain.com>/web/storage/vendor/twig/twig/src/Cache/FilesystemCache.php on line 67

The message goes away when when i refresh the screen each time the message appears. I have read some conflicting messages that say to ignore this message.
However, If this is browser dependent, this would be a very bad look for customers who see the website and the first time they come in to view product they get an error message. They don't know that it may be 'nothing' .

So what is the permanent fix? Thanks.

Newbie

Posts

Joined
Wed Aug 23, 2023 3:21 am

Post by ADD Creative » Fri Aug 25, 2023 3:50 am

It's related to this issue in that it's a warning that Twig suppresses. https://github.com/opencart/opencart/issues/12483

Sadly it's been closed without fixing. You could follow my instructions on fixing at the above link or look at the fix for OpenCart 3.x for an idea. https://github.com/opencart/opencart/pull/10835

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by robert@ipc » Fri Aug 25, 2023 4:35 am

Thank you I will follow on and read the other posts and see how to apply those to our situation.

you mention this has not been permanently fixed, sadly. I see that this error has been around for a while. But what is a head scratcher for me is that OC 4 requires PHP8. And php8 seems to be what throws the error. Therefore all new installs should get this error, ergo should'nt this be permanently fixed in the core distribution? just saying.

Newbie

Posts

Joined
Wed Aug 23, 2023 3:21 am

Post by ADD Creative » Fri Aug 25, 2023 4:42 am

Yes it should be fixed. It think the warning is dependent on the PHP opcache.restrict_api setting. https://www.php.net/manual/en/opcache.c ... strict-api

Not all servers will have the same setting so most users (including the OpenCart developer) probably don't see the warning.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by ADD Creative » Thu Aug 31, 2023 4:45 pm

I posted a fix here, but sadly it's been rejected. https://github.com/opencart/opencart/pull/12660

Otherwise just make sure error display is switched off in your settings, config and PHP settings, then keep clearing your error logs.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by IP_CAM » Thu Aug 31, 2023 9:59 pm

I posted a fix here, but sadly it's been rejected.
Rainy Days In Georgia ... 8)

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 2 guests