cancel
Showing results for 
Search instead for 
Did you mean: 

[ERROR] Exception: Warning: Zend OPcache API is restricted by "restrict_api" configuration directive

[ERROR] Exception: Warning: Zend OPcache API is restricted by "restrict_api" configuration directive

Hi friends,

 

I´m having this problem when I try to install Magento 2.2, MySQL 5.6 and PHP 7.0.23

 

[ERROR] Exception: Warning: Zend OPcache API is restricted by "restrict_api" configuration directive in /home/vesteldigital/novus/magento2/vendor/magento/framework/App/DeploymentConfig/Writer.php on line 152 in /home/vesteldigital/novus/magento2/vendor/magento/framework/App/ErrorHandler.php:61

Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'Zend OPcache AP...', '/home/vesteldig...', 152, Array)
#1 /home/vesteldigital/novus/magento2/vendor/magento/framework/App/DeploymentConfig/Writer.php(152): opcache_invalidate('/home/vesteldig...')
#2 /home/vesteldigital/novus/magento2/setup/src/Magento/Setup/Model/Installer.php(405): Magento\Framework\App\DeploymentConfig\Writer->saveConfig(Array, true)
#3 /home/vesteldigital/novus/magento2/setup/src/Magento/Setup/Model/Installer.php(509): Magento\Setup\Model\Installer->createModulesConfig(Array)
#4 [internal function]: Magento\Setup\Model\Installer->installDeploymentConfig(Array)
#5 /home/vesteldigital/novus/magento2/setup/src/Magento/Setup/Model/Installer.php(342): call_user_func_array(Array, Array)
#6 /home/vesteldigital/novus/magento2/setup/src/Magento/Setup/Controller/Install.php(109): Magento\Setup\Model\Installer->install(Array)
#7 /home/vesteldigital/novus/magento2/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Magento\Setup\Controller\Install->startAction()
#8 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#9 /home/vesteldigital/novus/magento2/vendor/zendframework/zend-eventmanager/src/EventManager.php(490): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#10 /home/vesteldigital/novus/magento2/vendor/zendframework/zend-eventmanager/src/EventManager.php(214): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#11 /home/vesteldigital/novus/magento2/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 /home/vesteldigital/novus/magento2/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#13 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#14 /home/vesteldigital/novus/magento2/vendor/zendframework/zend-eventmanager/src/EventManager.php(490): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#15 /home/vesteldigital/novus/magento2/vendor/zendframework/zend-eventmanager/src/EventManager.php(214): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#16 /home/vesteldigital/novus/magento2/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#17 /home/vesteldigital/novus/magento2/setup/index.php(35): Zend\Mvc\Application->run()
#18 {main}

 

Thanks a lot in advance.

 

4 REPLIES 4

Re: [ERROR] Exception: Warning: Zend OPcache API is restricted by "restrict_api" configura

Hi @jorgediezprada,

 

Maybe you have disabled OPcache?

Re: [ERROR] Exception: Warning: Zend OPcache API is restricted by "restrict_api" configura

I have the same problem, opcache (PHP 5.4+, 7.x) is enabled

Re: [ERROR] Exception: Warning: Zend OPcache API is restricted by "restrict_api" configura

I'm encountering the same issue, did anyone find a solution? Tried to change to PHP 7.1 from 7.2 but no change, still same error output. Spoke with my host and they got opcache enabled.

 

I downloaded Magento-CE-2.3.2_sample_data-2019-06-13-04-25-39.zip and uploaded it to the public_html, made a MariaDB etc and the Wizard haven't complained until last stage when the install is about to start.

It's shared server so I don't have root or ssh to it so I can run commands.

 

Would really appreciate some input in this matter and try to solve it!

Re: [ERROR] Exception: Warning: Zend OPcache API is restricted by "restrict_api" configura

<span class="text-info">Starting Magento installation:</span><br><span class="text-info">File permissions check...</span><br><span class="hidden">[Progress: 1 / 933]</span><br><span class="text-info">Required extensions check...</span><br><span class="hidden">[Progress: 2 / 933]</span><br><span class="text-info">Enabling Maintenance Mode...</span><br><span class="hidden">[Progress: 3 / 933]</span><br><span class="text-info">Installing deployment configuration...</span><br><span class="text-danger">[ERROR] Exception: Warning: Zend OPcache API is restricted by "restrict_api" configuration directive in /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/vendor/magento/framework/App/DeploymentConfig/Writer.php on line 154 in /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/vendor/magento/framework/App/ErrorHandler.php:61
Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'Zend OPcache AP...', '/www/webvol4/c8...', 154, Array)
#1 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/vendor/magento/framework/App/DeploymentConfig/Writer.php(154): opcache_invalidate('/www/webvol4/c8...')
#2 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/setup/src/Magento/Setup/Model/Installer.php(444): Magento\Framework\App\DeploymentConfig\Writer->saveConfig(Array, true)
#3 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/setup/src/Magento/Setup/Model/Installer.php(548): Magento\Setup\Model\Installer->createModulesConfig(Array)
#4 [internal function]: Magento\Setup\Model\Installer->installDeploymentConfig(Array)
#5 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/setup/src/Magento/Setup/Model/Installer.php(367): call_user_func_array(Array, Array)
#6 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/setup/src/Magento/Setup/Controller/Install.php(109): Magento\Setup\Model\Installer->install(Array)
#7 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(84): Magento\Setup\Controller\Install->startAction()
#8 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#9 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/vendor/zendframework/zend-eventmanager/src/EventManager.php(490): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#10 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/vendor/zendframework/zend-eventmanager/src/EventManager.php(260): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#11 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#12 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/vendor/zendframework/zend-mvc/src/DispatchListener.php(118): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#13 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#14 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/vendor/zendframework/zend-eventmanager/src/EventManager.php(490): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#15 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/vendor/zendframework/zend-eventmanager/src/EventManager.php(260): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#16 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/vendor/zendframework/zend-mvc/src/Application.php(340): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#17 /www/webvol4/c8/0vzzrg6n3eeuvl4/magento.web.site/public_html/setup/index.php(39): Zend\Mvc\Application->run()
#18 {main}<span><br>