Error on first login - "Zend OPcache API is restricted by "restrict_api" configuration directive" after successful install

Permalink 1 user found helpful
Hi all,

after more than several attempts I finally managed to install 5.7.4.2, yay.

Immediately after the install I login to the site to savour the fruits of my hard labour. However, I am welcomed by this:

Whoops\Exception\ErrorException thrown with message "Zend OPcache API is restricted by "restrict_api" configuration directive"

Stacktrace:
#26 Whoops\Exception\ErrorException in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/vendor/tedivm/stash/src/Stash/Driver/FileSystem.php:286
#25 Whoops\Run:handleError in <#unknown>:0
#24 opcache_invalidate in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/vendor/tedivm/stash/src/Stash/Driver/FileSystem.php:286
#23 Stash\Driver\FileSystem:storeData in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/vendor/tedivm/stash/src/Stash/Driver/Composite.php:148
#22 Stash\Driver\Composite:actOnAll in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/vendor/tedivm/stash/src/Stash/Driver/Composite.php:103
#21 Stash\Driver\Composite:storeData in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/vendor/tedivm/stash/src/Stash/Item.php:353
#20 Stash\Item:executeSet in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/vendor/tedivm/stash/src/Stash/Item.php:305
#19 Stash\Item:set in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/src/Cache/Adapter/DoctrineCacheDriver.php:76
#18 Concrete\Core\Cache\Adapter\DoctrineCacheDriver:doSave in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php:115
#17 Doctrine\Common\Cache\CacheProvider:save in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:214
#16 Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory:getMetadataFor in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:360
#15 Doctrine\ORM\EntityManager:find in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/src/File/File.php:90
#14 Concrete\Core\File\File:getByID in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/blocks/image_slider/view.php:37
#13 include in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/src/Block/View/BlockView.php:234
#12 Concrete\Core\Block\View\BlockView:renderViewContents in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/src/View/AbstractView.php:123
#11 Concrete\Core\View\AbstractView:render in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/src/Area/Area.php:862
#10 Concrete\Core\Area\Area:display in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/themes/elemental/default.php:9
#9 include in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/src/View/View.php:74
#8 Concrete\Core\View\View:inc in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/themes/elemental/full.php:3
#7 include in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/src/View/View.php:189
#6 Concrete\Core\View\View:renderViewContents in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/src/View/AbstractView.php:123
#5 Concrete\Core\View\AbstractView:render in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/src/Routing/DispatcherRouteCallback.php:24
#4 Concrete\Core\Routing\DispatcherRouteCallback:sendResponse in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/src/Routing/DispatcherRouteCallback.php:213
#3 Concrete\Core\Routing\DispatcherRouteCallback:execute in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/src/Application/Application.php:369
#2 Concrete\Core\Application\Application:dispatch in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/bootstrap/start.php:284
#1 require in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/concrete/dispatcher.php:36
#0 require in /nfsmnt/hosting1_1/c/a/cad94d54-8b2e-4827-9da8-69ace704f0af/harmonymama.sk/web/concrete5.7.4.2/index.php:2

I am able to view the dashboard, however, I cannot view any pages of my site (did the install including the default site and theme). As soon as I try to navigate to them from the dashboard, I get the error.

So far I tried adding some Zend OPcache parameters into the .ini file. The file the error is referring to is in the core folder. Is this an app bug? Can anyone help? Also, will there ever be a 5.7+ version of c5 that's stable? :)

Thanks for your help,

Best,

Matus

yoga
View Replies:
andreicristescu replied on at Permalink Reply
I had the same problem because my provider had the opcache in php deactivated. First they helped me but after every concrete5 update I had to ask them again to help me with that, so I tried for myself to do it (Done it in concrete5.7.5). So that's what I need to do to make that error dissapear:

concrete/src/Cache/OpCache.php :Delete file or rename



concrete/vendor/tedivm/stash/src/Stash/Driver/FileSystem.php

Line 286 ("opcache_invalidate($path, true);") : php comment



concrete/src/Config/DirectFileSaver.php

Line 5 ("use Concrete\Core\Cache\OpCache;") : php comment or delete



concrete/src/Config/FileSaver.php

Line 5 ("use Concrete\Core\Cache\OpCache;") : php comment or delete
Line 100 ("if ($result) { OpCache::clear($file);} return $result;") :delete



concrete/src/Application/Application.php

Line 8 ("use Concrete\Core\Cache\OpCache;") : php comment or delete
Line 125 ("OpCache::clear();") : php comment or delete


Hope that helps! :)