# Slim Application Error Code 2

**URL:** https://forum.shopware.com/t/slim-application-error-code-2/52439
**Category:** Installation/Einstieg
**Created:** [18. April 2018 um 07:47 UTC](https://forum.shopware.com/t/slim-application-error-code-2/52439 "2018-04-18T07:47:31Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ollix](https://avatars.discourse-cdn.com/v4/letter/o/e56c9b/32.png) [@ollix](https://forum.shopware.com/u/ollix)
#### Post date: [18. April 2018 um 07:47 UTC](https://forum.shopware.com/t/slim-application-error-code-2/52439/1 "2018-04-18T07:47:31Z")

</div>

Hallo,

ich versuche die aktuelle shopware Version auf Ubuntu 16.04 zu installieren. Die Abhängigkeiten müssten soweit erfüllt sein. Bis zur Weboberfläche konnte ich aber noch nicht vordringen, aktuell erscheint diese Fehlermeldung:

Slim Application Error

The application could not run because of the following error:  
Details  
Type: ErrorException  
Code: 2  
Message: file\_put\_contents(/var/www/shopware/recovery/install/data/uniqueid.txt): failed to open stream: Permission denied  
File: /var/www/shopware/recovery/common/src/Service/UniqueIdGenerator.php  
Line: 85  
Trace

#0 [internal function]: Slim\Slim::handleErrors(2, ‘file\_put\_conten…’, ‘/var/www/shopwa…’, 85, Array)  
#1 /var/www/shopware/recovery/common/src/Service/UniqueIdGenerator.php(85): file\_put\_contents(’/var/www/shopwa…’, ‘6loMidKdabVVyL9…’)  
#2 /var/www/shopware/recovery/common/src/Service/UniqueIdGenerator.php(58): Shopware\Recovery\Common\Service\UniqueIdGenerator-\>saveUniqueId(‘6loMidKdabVVyL9…’)  
#3 /var/www/shopware/recovery/install/src/ContainerProvider.php(216): Shopware\Recovery\Common\Service\UniqueIdGenerator-\>getUniqueId()  
#4 /var/www/shopware/recovery/common/vendor/pimple/pimple/src/Pimple/Container.php(113): Shopware\Recovery\Install\ContainerProvider-\>Shopware\Recovery\Install{closure}(Object(Pimple\Container))  
#5 /var/www/shopware/recovery/install/src/app.php(206): Pimple\Container-\>offsetGet(‘shopware.notify’)  
#6 [internal function]: {closure}()  
#7 /var/www/shopware/recovery/common/vendor/slim/slim/Slim/Route.php(462): call\_user\_func\_array(Object(Closure), Array)  
#8 /var/www/shopware/recovery/common/vendor/slim/slim/Slim/Slim.php(1326): Slim\Route-\>dispatch()  
#9 /var/www/shopware/recovery/common/vendor/slim/slim/Slim/Middleware/Flash.php(85): Slim\Slim-\>call()  
#10 /var/www/shopware/recovery/common/vendor/slim/slim/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash-\>call()  
#11 /var/www/shopware/recovery/common/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride-\>call()  
#12 /var/www/shopware/recovery/common/vendor/slim/slim/Slim/Slim.php(1271): Slim\Middleware\PrettyExceptions-\>call()  
#13 /var/www/shopware/recovery/install/index.php(75): Slim\Slim-\>run()  
#14 {main}

Ich habe schon mal den Cache mit dem im Verzeichnis liegenden Script gelöscht und die Berchtigungen für die Datei: /var/www/shopware/recovery/common/src/Service/UniqueIdGenerator.php erweitert. Hat aber beides nichts genutzt.

An welcher Stelle sollte ich weiter suchen?

---

<div class="post-metadata">

### Author: ![TimmeHosting](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/timmehosting/32/15580_2.png) [@TimmeHosting](https://forum.shopware.com/u/TimmeHosting)
#### Post date: [20. April 2018 um 06:06 UTC](https://forum.shopware.com/t/slim-application-error-code-2/52439/2 "2018-04-20T06:06:10Z")

</div>

Die Berechtigungen stimmen bei Dir nicht. Der PHP-Prozeß muß auf /var/www/shopware/recovery/install/data/uniqueid.txt schreibend und lesend zugreifen können.

![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/385eaa628505df573ebf33722f780335f53ac1b2.png)

Timme Hosting - schnelles nginx-Hosting

[www.timmehosting.de](https://timmehosting.de/)

---

<div class="post-metadata">

### Author: ![ollix](https://avatars.discourse-cdn.com/v4/letter/o/e56c9b/32.png) [@ollix](https://forum.shopware.com/u/ollix)
#### Post date: [20. April 2018 um 11:02 UTC](https://forum.shopware.com/t/slim-application-error-code-2/52439/3 "2018-04-20T11:02:00Z")

</div>

Hallo TimmeHosting,

vielen Dank für deinen Hinweis, er hat zur Lösung geführt.

Die Datei /var/www/shopware/recovery/install/data/uniqueid.txt existierte gar nicht (wird vermutlich erst beim ersten Start erzeugt).

Ich habe dem Apache-User Lese/Schreibe und Ausführen Berechtigungen für das gesamte Webverzeichnis des shops erteilt. Danach klappte es problemlos.

Diese Konfiguration erscheint mir allerdings nicht besonders sicher, gibt es Empfehlungen wie die Berechtigungen idealer Weise konfiguriert werden sollen?

---

<div class="post-metadata">

### Author: ![TimmeHosting](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/timmehosting/32/15580_2.png) [@TimmeHosting](https://forum.shopware.com/u/TimmeHosting)
#### Post date: [20. April 2018 um 17:08 UTC](https://forum.shopware.com/t/slim-application-error-code-2/52439/4 "2018-04-20T17:08:11Z")

</div>

Das hängt immer davon ab, wie PHP mit Apache verbandelt ist - mod\_php, FastCGI, PHP-FPM, etc.?

![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/385eaa628505df573ebf33722f780335f53ac1b2.png)

Timme Hosting - schnelles nginx-Hosting

[www.timmehosting.de](https://timmehosting.de/)

---

<div class="post-metadata">

### Author: ![ollix](https://avatars.discourse-cdn.com/v4/letter/o/e56c9b/32.png) [@ollix](https://forum.shopware.com/u/ollix)
#### Post date: [20. April 2018 um 21:35 UTC](https://forum.shopware.com/t/slim-application-error-code-2/52439/5 "2018-04-20T21:35:50Z")

</div>

In diesem Fall über das Apache PHP Modul (libphp7.0.so).

---

<div class="post-metadata">

### Author: ![TimmeHosting](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/timmehosting/32/15580_2.png) [@TimmeHosting](https://forum.shopware.com/u/TimmeHosting)
#### Post date: [22. April 2018 um 18:39 UTC](https://forum.shopware.com/t/slim-application-error-code-2/52439/6 "2018-04-22T18:39:59Z")

</div>

Im Falle von mod\_php sollten Ordner und Dateien dem Benutzer und der Gruppe gehören, unter denen Apache läuft. Dateien sollten die Berechtigungen 644 und Ordner 755 erhalten.

![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/385eaa628505df573ebf33722f780335f53ac1b2.png)

Timme Hosting - schnelles nginx-Hosting

[www.timmehosting.de](https://timmehosting.de/)

---

<div class="post-metadata">

### Author: ![treboltec](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@treboltec](https://forum.shopware.com/u/treboltec)
#### Post date: [21. Februar 2021 um 21:24 UTC](https://forum.shopware.com/t/slim-application-error-code-2/52439/7 "2021-02-21T21:24:17Z")

</div>

I fixed this access isse by installing the missing php components. check the install requirements from the site and install the php componets, before trying to fix the file permissions, 777 is never a good idea, even though it fixes most issues.
