cap部署symfony2项目的问题,找不到app / bootstrap.php.cache

时间:2011-12-08 21:33:20

标签: symfony capistrano capifony

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

** [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

有人有过这样的经历吗?任何想法可能是什么原因?

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分: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 / current

希望帮助那里的人。