3

我正在尝试(第一次)使用 capifony 从我的 github 存储库部署我的网站。它一直运行到设置阶段并出现以下错误:

** [out :: example.me] PHP Warning:  require_once(/var/www/example/prod/releases/20111208212344/app/bootstrap.php.cache): failed to open stream: No such file or directory in /var/www/example/prod/releases/20111208212344/app/console on line 4
 ** [out :: example.me] PHP Fatal error:  require_once(): Failed opening required '/var/www/example/prod/releases/20111208212344/app/bootstrap.php.cache' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/example/prod/releases/20111208212344/app/console on line 4
 ** [out :: example.me] PHP Warning:  require_once(/var/www/example/prod/releases/20111208212344/app/bootstrap.php.cache): failed to open stream: No such file or directory in /var/www/example/prod/releases/20111208212344/app/console on line 4
 ** [out :: example.me] PHP Fatal error:  require_once(): Failed opening required '/var/www/example/prod/releases/20111208212344/app/bootstrap.php.cache' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/example/prod/releases/20111208212344/app/console on line 4
    command finished in 106300ms
  * executing `symfony:assets:install'
  * executing "cd /var/www/example/prod/releases/20111208212344 && php app/console assets:install web --env=prod"
    servers: ["example.me"]
    [example.me] executing command
 ** [out :: example.me] PHP Warning:  require_once(/var/www/example/prod/releases/20111208212344/app/bootstrap.php.cache): failed to open stream: No such file or directory in /var/www/example/prod/releases/20111208212344/app/console on line 4
 ** [out :: example.me] PHP Fatal error:  require_once(): Failed opening required '/var/www/example/prod/releases/20111208212344/app/bootstrap.php.cache' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/example/prod/releases/20111208212344/app/console on line 4
    command finished in 1294ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /var/www/example/prod/releases/20111208212344; true"
    servers: ["example.me"]
    [example.me] executing command
    command finished in 1329ms
failed: "sh -c 'cd /var/www/example/prod/releases/20111208212344 && php app/console assets:install web --env=prod'" on example.me

有没有人遇到过这个?任何想法可能是什么原因?

4

2 回答 2

1

它与供应商目录的符号链接有关。这是更详细的解决方案: https ://github.com/symfony/symfony-standard/pull/215

于 2011-12-09T09:52:07.293 回答
0

我被困了一段时间,我不确定它是否完全相同。当我部署 vi Capifony 时,bootstrap.php.cache 文件指向我的 FormBundle.php 文件,但在以前的版本文件夹中不再存在。我查看了 vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php 中的代码,它使用的路径是 realpath( DIR .'/../../../ ../../../../../app') - 硬编码路径,wtf?问题在于我的供应商文件夹位于共享文件夹中的 mySymfony 设置之外,因此 realpath 没有任何用处。

然而,它确实在代码中进一步检查服务器变量($_SERVER('argv')),所以我只是在 vhosts 中设置它,将其添加到文件中:SetEnv argv /var/www/njc-forms/当前的

希望能帮助那里的人。

于 2015-01-20T21:58:25.647 回答