2016-01-29 30 views
2

我在AWS上使用jenkins連續部署。一切都OK,但是當我看到我的網頁上,有這樣的錯誤:Symfony失蹤bootstrap.php.cache

Warning: require_once(/var/app/web/../app/bootstrap.php.cache): failed to open stream: No such file or directory in /var/app/web/app.php on line 6 Fatal error: require_once(): Failed opening required '/var/app/web/../app/bootstrap.php.cache' (include_path='.:/usr/local/lib/php') in /var/app/web/app.php on line 6 

我知道,那是因爲我錯過bootstrap.php.cache應該由作曲家產生,但並沒有什麼。

在dockerfile我用RUN composer install --no-scripts --optimize-autoloader

並在入口點我composer run-script post-install-cmd --no-interaction

回答

6

執行以下命令:

sudo php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php 
+2

更新:在我目前版本的sensio/distribution-bundle(5.0)腳本已被移動,請嘗試'sudo php vendor/sensio/distribution-bundle/Resources/bin/build_bootstrap.php' – jgpATs2w

0

在Web文件夾,你必須添加bootstrap.php.cache。它已經在您的symfony的應用程序文件夾中。

+0

,所以我必須manualy創建它?它應該包含什麼內容? – Delirium

+0

它已經存在於應用程序文件夾中。您可以將其從應用程序複製並粘貼到網絡文件夾。 –

+0

雖然作曲家會生成它嗎?因爲我在我的composer.json中有: 「Sensio \\ Bundle \\ DistributionBundle \\ Composer \\ ScriptHandler :: buildBootstrap」 – Delirium