【发布时间】:2011-09-20 05:35:12
【问题描述】:
我正在尝试将我的 symfony2 应用程序部署到我的 ec2 实例。我配置了 deploy.rb 文件,并且能够使用 cap deploy:setup 初始化服务器目录。但是,当我运行 cap deploy 时,我收到此错误:failed "sh -c 'cd /var/www/html/capifonytest/releases/20110920052019 && php app/console cache:warmup --env=prod'" on xxx.xx.xxx.xx。这是我的 deploy.rb 文件:
set :application, "capifonytest"
default_run_options[:pty] = true
set :scm, :git
set :deploy_to, "/var/www/html/#{application}"
set :repository, "git@github.com:myname/myrepo.git"
set :branch, "master"
set :ssh_options, { :forward_agent => true }
set :user, "ec2-user"
set :domain, "xxx.xx.xxx.xx"
ssh_options[:keys] = [File.join(ENV["AWS_HOME"], "tsmith.pem")]
role :web, domain # Your HTTP server, Apache/etc
role :app, domain # This may be the same as your `Web` server
role :db, domain, :primary => true # This is where Rails migrations will run
set :use_sudo, true
set :keep_releases, 3
有没有人知道将 symfony2 应用程序部署到 ec2 实例或使用 capifony/capistrano 的良好教程/资源?此外,任何让 symfony2 在 ec2 实例上工作的提示或技巧都将得到极大的利用。我正在运行 amazon linux ami 64bit,我相信它是基于 centos 的。
这是输出的更详细的sn-p:
服务器:["107.20.247.96"]
[107.20.247.96] 执行命令
** [out :: 107.20.247.96] 查找:/var/www/html/capifonytest/releases/2011092118<br /> 2846/web/css': No such file or directory<br /> ** [out :: 107.20.247.96] find:/var/www/html/capifonytest/releases/2011092118
2846/web/images': 没有这样的文件或目录
** [out :: 107.20.247.96] 查找:/var/www/html/capifonytest/releases/2011092118<br /> 2846/web/js': No such file or directory<br /> command finished in 358ms<br /> triggering after callbacks fordeploy:finalize_update'
* 执行 `symfony:cache:warmup'
* 执行“cd /var/www/html/capifonytest/releases/20110921182846 && php app/
控制台缓存:预热 --env=prod"
服务器:[“107.20.247.96”]
[107.20.247.96] 执行命令
** [out :: 107.20.247.96] PHP 警告:require_once(/var/www/html/capifonytest
/releases/20110921182846/app/../vendor/symfony/src/Symfony/Component/Locale/Reso
urces/stubs/functions.php):无法打开流:
中没有这样的文件或目录 /var/www/html/capifonytest/releases/20110921182846/app/autoload.php 第 25 行
** [out :: 107.20.247.96] PHP 致命错误:require_once():打开请求失败
ired '/var/www/html/capifonytest/releases/20110921182846/app/../vendor/symfony/s
rc/Symfony/Component/Locale/Resources/stubs/functions.php' (include_path='.:/usr
/share/pear:/usr/share/php') 在 /var/www/html/capifonytest/releases/201109211828
第 25 行的 46/app/autoload.php
命令在 302 毫秒内完成
* [deploy:update_code] 回滚
* 执行“rm -rf /var/www/html/capifonytest/releases/20110921182846; true”
服务器:[“107.20.247.96”]
[107.20.247.96] 执行命令
命令在 280 毫秒内完成
失败:“sh -c 'cd /var/www/html/capifonytest/releases/20110921182846 && php 应用程序
/console cache:warmup --env=prod'" 在 107.20.247.96
【问题讨论】:
标签: amazon-ec2 capistrano symfony