# Zend OPcache API is restricted by "restrict\_api" configuration directive -

**URL:** https://forum.shopware.com/t/zend-opcache-api-is-restricted-by-restrict-api-configuration-directive/50515
**Category:** Administration
**Created:** [17. Januar 2018 um 20:31 UTC](https://forum.shopware.com/t/zend-opcache-api-is-restricted-by-restrict-api-configuration-directive/50515 "2018-01-17T20:31:17Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ppeter](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@ppeter](https://forum.shopware.com/u/ppeter)
#### Post date: [17. Januar 2018 um 20:31 UTC](https://forum.shopware.com/t/zend-opcache-api-is-restricted-by-restrict-api-configuration-directive/50515/1 "2018-01-17T20:31:17Z")

</div>

```
 Hallo! hab nach einen Upgrade von der Shopware Version 5.4.3 auf 5.4.6 folgenden Fehler (siehe Meldung unter htacess Eintrag) erhalten Was genau hab, ich vergessen damit es funktioniert: <ifmodule mod_rewrite.c>
#Restrict api subdomain to /api:
    RewriteCond %{HTTP_HOST} ^api\. [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule !^api/.*$ - [R=404,L]
</ifmodule> Meldung: Slim Application Error The application could not run because of the following error: Details Type: ErrorException Code: 2 Message: Zend OPcache API is restricted by "restrict\_api" configuration directive File: /home/frischebry/www/recovery/common/src/Utils.php Line: 36 Trace #0 [internal function]: Slim\Slim::handleErrors(2, 'Zend OPcache AP...', '/home/frischebr...', 36, Array) #1 /home/frischebry/www/recovery/common/src/Utils.php(36): opcache\_reset() #2 /home/frischebry/www/recovery/update/src/Controller/RequirementsController.php(104): Shopware\Recovery\Common\Utils::clearOpcodeCache() #3 /home/frischebry/www/recovery/update/src/app.php(130): Shopware\Recovery\Update\Controller\RequirementsController-\>checkRequirements() #4 [internal function]: {closure}() #5 /home/frischebry/www/recovery/common/vendor/slim/slim/Slim/Route.php(462): call\_user\_func\_array(Object(Closure), Array) #6 /home/frischebry/www/recovery/common/vendor/slim/slim/Slim/Slim.php(1326): Slim\Route-\>dispatch() #7 /home/frischebry/www/recovery/common/vendor/slim/slim/Slim/Middleware/Flash.php(85): Slim\Slim-\>call() #8 /home/frischebry/www/recovery/common/vendor/slim/slim/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash-\>call() #9 /home/frischebry/www/recovery/common/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride-\>call() #10 /home/frischebry/www/recovery/common/vendor/slim/slim/Slim/Slim.php(1271): Slim\Middleware\PrettyExceptions-\>call() #11 /home/frischebry/www/recovery/update/index.php(69): Slim\Slim-\>run() #12 {main}

```

&nbsp;

danke

mfg

Peter Polz

---

<div class="post-metadata">

### Author: ![marck1991](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@marck1991](https://forum.shopware.com/u/marck1991)
#### Post date: [21. Januar 2018 um 21:33 UTC](https://forum.shopware.com/t/zend-opcache-api-is-restricted-by-restrict-api-configuration-directive/50515/2 "2018-01-21T21:33:13Z")

</div>

Hallo,

ich hatte selbigen Fehler.

Ich habe diese Funktion Zeile 36 in der Datei /recovery/common/src/Utils.php auskommentiert.

&nbsp;

if (function\_exists(‘opcache\_reset’)) {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opcache\_reset();  
}

ersetzen durch:

/\*\*if (function\_exists(‘opcache\_reset’)) {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opcache\_reset();  
&nbsp; &nbsp; &nbsp; &nbsp; }\*/

&nbsp;

Bei meinem Hoster ist wohl ein Modul nicht aktiv, welches diese PHP-Funktion wohl abfragt.

Nach dem Auskommentieren lief das Update erfolgreich durch 🙂

LG

Marc

---

<div class="post-metadata">

### Author: ![ppeter](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@ppeter](https://forum.shopware.com/u/ppeter)
#### Post date: [22. Januar 2018 um 09:20 UTC](https://forum.shopware.com/t/zend-opcache-api-is-restricted-by-restrict-api-configuration-directive/50515/3 "2018-01-22T09:20:21Z")

</div>

Herzlichen Dank, das werde ich so testen

&nbsp;

Grüße

Peter&nbsp;

---

<div class="post-metadata">

### Author: ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)
#### Post date: [22. Januar 2018 um 09:23 UTC](https://forum.shopware.com/t/zend-opcache-api-is-restricted-by-restrict-api-configuration-directive/50515/4 "2018-01-22T09:23:27Z")

</div>

Naja, lt. Fehlermeldung ist aber das Problen nicht, dass der Opcache nicht installiert ist, sondern der Hoster den Zugriff auf diesen blockiert hat.  
Ist erstmal ein Konfigurationsproblem auf dem Server.

---

<div class="post-metadata">

### Author: ![ppeter](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@ppeter](https://forum.shopware.com/u/ppeter)
#### Post date: [22. Januar 2018 um 09:32 UTC](https://forum.shopware.com/t/zend-opcache-api-is-restricted-by-restrict-api-configuration-directive/50515/5 "2018-01-22T09:32:10Z")

</div>

ok das werde ich natürlich auch vorher prüfen

&nbsp;

danke

---

<div class="post-metadata">

### Author: ![ppeter](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@ppeter](https://forum.shopware.com/u/ppeter)
#### Post date: [22. Januar 2018 um 22:48 UTC](https://forum.shopware.com/t/zend-opcache-api-is-restricted-by-restrict-api-configuration-directive/50515/6 "2018-01-22T22:48:09Z")

</div>

danke nochmals,&nbsp;hab das jetzt so gemacht

&nbsp; &nbsp; /\*\*if (function\_exists(‘opcache\_reset’)) {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opcache\_reset();  
&nbsp; &nbsp; &nbsp; &nbsp; }\*/

&nbsp; &nbsp; &nbsp; &nbsp; if (function\_exists(‘apcu\_clear\_cache’)) {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; apcu\_clear\_cache();  
&nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; }

&nbsp;

beim hoster gibt es für den laut angaben keine möglichkeit für&nbsp;

```
 restrict\_api

```

&nbsp;

gibt es noch eine andere Lösung

---

<div class="post-metadata">

### Author: ![ppeter](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@ppeter](https://forum.shopware.com/u/ppeter)
#### Post date: [24. Januar 2018 um 16:12 UTC](https://forum.shopware.com/t/zend-opcache-api-is-restricted-by-restrict-api-configuration-directive/50515/7 "2018-01-24T16:12:06Z")

</div>

Hallo!

ich hab jetzt erfahren das der Hoster einen eigenen Pfad für die restricted api hat, wie kann ich den Pfad jetzt in shopware anpassen?

hier ist die Info:  
Die OPcache API sollte auf unserem System aktiv sein und über diesen PFad erreichbar:  
/home/ovh/fpm7.0/opcache-status.php

Bitte versuchen Sie, das von Ihnen verwendete Script, so anzupassen das die API, über diesen Pfad angesteuern wird.

&nbsp;

&nbsp;

danke

lg

Peter Polz
