3

I'm trying (for the first time) to use capifony to deploy my site from my github repo. It runs right through to the setup phase and has this error:

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

Has anyone encoutered this? Any ideas what could be the cause?

ed209
  • 11,075
  • 19
  • 66
  • 82
  • That might be it, should I install them in the shared directory before deploy? I'm not sure how I would do that without having a version of symphony on the server as locally I installed them via the console/ deps file – ed209 Dec 08 '11 at 22:26
  • 1
    You need to run the `bin/vendors install` script to install the deps. Add `set :update_vendors, true` to `deploy.rb` to instruct capifony to do it. Details are on the [capifony site](http://capifony.org). – Elnur Abdurrakhimov Dec 08 '11 at 22:32
  • My deploy.rb has those details. But I'm not sure how to run bin/vendors install as there is no symfony on the server. – ed209 Dec 08 '11 at 22:39
  • `bin/vendors install` installs all the deps, including Symfony. I have no experience with capifony, but I believe it should somehow run that script. – Elnur Abdurrakhimov Dec 08 '11 at 22:44
  • seems like capifony already installed vendors. – ed209 Dec 09 '11 at 09:33
  • I resolved a similar problem with ```composer install``` – lrkwz Oct 06 '15 at 07:51

2 Answers2

1

It has to do with symlinks to the vendors directory. here is the solution with more detail: https://github.com/symfony/symfony-standard/pull/215

ed209
  • 11,075
  • 19
  • 66
  • 82
0

I was stuck on this for a while, I'm not sure if it's exactly the same issue. When I deployed vi Capifony, the bootstrap.php.cache file was pointing to my FormBundle.php file, but in a previous release folder tha no longer existed. I took a look at the code in vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php and the path it uses is realpath(DIR.'/../../../../../../../../app') - hardcoded path, wtf? The problem with this is that my vendor folder is outside of mySymfony setup in a shared folder, so that realpath points to nothing useful.

It does however checking for an server variable ($_SERVER('argv')) a bit further up in the code, so I just set that in the vhosts adding this to the file: SetEnv argv /var/www/njc-forms/current

Hope that helps someone out there.

kurtfoster
  • 353
  • 3
  • 14