Capifony symfony2部署错误

Capifony symfony2部署错误,symfony,deployment,capifony,Symfony,Deployment,Capifony,我真的需要你的帮助 它跟踪堆栈溢出上的每个帖子,但对我来说没有任何效果 我尝试部署symfony 2.3应用程序,但出现以下错误: Fatal error: require(): Failed opening required '../20140821061908/app/../vendor/autoload.php' (include_path= '.:/usr/share/pear:/usr/share/php') in ../releases/20140821061908/ app/aut

我真的需要你的帮助

它跟踪堆栈溢出上的每个帖子,但对我来说没有任何效果

我尝试部署symfony 2.3应用程序,但出现以下错误:

Fatal error: require(): Failed opening required '../20140821061908/app/../vendor/autoload.php' (include_path=
'.:/usr/share/pear:/usr/share/php') in ../releases/20140821061908/
app/autoload.php on line 5
下面是我的deploy.rb:

set :application, "*****"
set :domain,      "*****"
set :deploy_to,   "*****"
set :app_path,    "app"
set :web_path,    "web"

#set :repository,  "****"
set :repository,   "******"
set :user,        "*****"
set :password,    "******"



set :scm,         :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none`

set :model_manager, "doctrine"
# Or: `propel`

role :web,        domain                         # Your HTTP server, Apache/etc
role :app,        domain, :primary => true       # This may be the same as your `Web` server

# General config stuff
set :keep_releases,  5
set :shared_files,      ["app/config/parameters.yml", "app/config/parameters_dev.yml", "app/config/parameters.yml"] # This stops us from having to recreate the parameters file on every deploy.
set :shared_children,   [app_path + "/logs", web_path + "/uploads"]
set :use_composer, true
set :update_vendors, true

set :branch, `git tag`.split("\n").last


set :deploy_via, :copy
#set :deploy_via, :rsync_with_remote_cache
set :update_vendors, true
set :vendors_mode, "install"

set :composer_options, "--no-dev --verbose --prefer-dist --optimize-autoloader --no-progress"


# User details for the production server
set :user, "*****"
set :use_sudo, false
ssh_options[:forward_agent] = true
ssh_options[:keys] = %w(*********)


# Run migrations before warming the cache
#before "php app/console cache:clear"
task :upload_parameters do
  origin_file = "app/config/parameters.yml"
  destination_file = latest_release + "/app/config/parameters.yml" # Notice the
  latest_release

  try_sudo "mkdir -p #{File.dirname(destination_file)}"
  top.upload(origin_file, destination_file)
end



before "deploy:share_childs", "upload_parameters","symfony:cache:warmup", "symfony:doctrine:migrations:migrate"



after "deploy" do
    run "cd ******** && php app/console cache:clear --env=prod && php app/console assetic:dump --env=prod"
end

# Be more verbose by uncommenting the following line
logger.level = Logger::MAX_LEVEL
这是我的日志:

DL是

deprecated, please use Fiddle
  * 2014-08-21 12:32:33 executing `deploy'
  * 2014-08-21 12:32:33 executing `deploy:update'
 ** transaction: start
  * 2014-08-21 12:32:33 executing `deploy:update_code'
    triggering before callbacks for `deploy:update_code'
--> Updating code base with copy strategy
    executing locally: "git ls-remote https://github.com/********** HEA
D"
Username for 'https://github.com': 
Password for '******'
    command finished in 108591ms
  * getting (via checkout) revision 1fae0d14fc741d4a0c5d948f7161a1e05649a58e to
C:/Users/user/AppData/Local/Temp/20140821083421
    executing locally: git clone -q https://github.com/reynermedia/symfony C:/Us
ers/user/AppData/Local/Temp/20140821083421 && cd C:/Users/user/AppData/Local/Tem
p/20140821083421 && git checkout -q -b deploy 1fae0d14fc741d4a0c5d948f7161a1e056
49a58e
Username for 'https://github.com':
Password for '****':
    command finished in 276697ms
  * Compressing C:/Users/user/AppData/Local/Temp/20140821083421 to C:/Users/user
/AppData/Local/Temp/20140821083421.tar.gz
    executing locally: tar czf 20140821083421.tar.gz 20140821083421
    command finished in 16760ms
    servers: ["54.244.228.172"]
 ** sftp upload C:/Users/user/AppData/Local/Temp/20140821083421.tar.gz -> /tmp/2
0140821083421.tar.gz
    [54.244.228.172] /tmp/20140821083421.tar.gz
    [54.244.228.172] done
  * sftp upload complete
  * executing "cd ********/releases && tar xzf /tmp/20140821083421.tar.g
z && rm /tmp/20140821083421.tar.gz"
    servers: ["54.244.228.172"]
    [54.244.228.172] executing command
    command finished in 2800ms
  * 2014-08-21 12:53:57 executing `deploy:finalize_update'
  * executing "chmod -R g+w ********/releases/20140821083421"
    servers: ["54.244.228.172"]
    [54.244.228.172] executing command
    command finished in 872ms
--> Creating cache directory
  * executing "sh -c 'if [ -d *****/releases/20140821083421/app/cache
 ] ; then rm -rf *******/releases/20140821083421/app/cache; fi'"
    servers: ["54.244.228.172"]
    [54.244.228.172] executing command
    command finished in 778ms
  * executing "sh -c 'mkdir -p *********/releases/20140821083421/app/cach
e && chmod -R 0777 ***********/releases/20140821083421/app/cache'"
    servers: ["54.244.228.172"]
    [54.244.228.172] executing command
    command finished in 808ms
  * executing "chmod -R g+w *********/releases/20140821083421/app/cache"
    servers: ["54.244.228.172"]
    [54.244.228.172] executing command
    command finished in 805ms
  * 2014-08-21 12:54:00 executing `deploy:share_childs'
    triggering before callbacks for `deploy:share_childs'
  * 2014-08-21 12:54:00 executing `upload_parameters'
  * executing "mkdir -p ************/releases/20140821083421/app/config"
    servers: ["54.244.228.172"]
    [54.244.228.172] executing command
    command finished in 773ms
    servers: ["54.244.228.172"]
 ** sftp upload app/config/parameters.yml -> **********/releases/201408210
83421/app/config/parameters.yml
    [54.244.228.172] *********/releases/20140821083421/app/config/paramet
ers.yml
    [54.244.228.172] done
  * sftp upload complete
  * 2014-08-21 12:54:02 executing `symfony:cache:warmup'
--> Warming up cache
  * executing "sh -c 'cd ***********/releases/20140821083421 && php app/con
sole cache:warmup --env=prod --no-debug'"
    servers: ["54.244.228.172"]
    [54.244.228.172] executing command
*** [err :: 54.244.228.172] PHP Warning:  Module 'apc' already loaded in Unknown
 on line 0
*** [err :: 54.244.228.172] PHP Warning:  require(***********/releases/2014
0821083421/app/../vendor/autoload.php): failed to open stream: No such file or d
irectory in ***********/releases/20140821083421/app/autoload.php on line 5
 ** [out :: 54.244.228.172]
 ** [out :: 54.244.228.172] Warning: require(***********/releases/201408210
83421/app/../vendor/autoload.php): failed to open stream: No such file or direct
ory in /var/www/library/releases/20140821083421/app/autoload.php on line 5
*** [err :: 54.244.228.172] PHP Fatal error:  require(): Failed opening required
 '/var/www/library/releases/20140821083421/app/../vendor/autoload.php' (include_
path='.:/usr/share/pear:/usr/share/php') in **********/releases/2014082108
3421/app/autoload.php on line 5
 ** [out :: 54.244.228.172]
 ** [out :: 54.244.228.172] Fatal error: require(): Failed opening required '**********/releases/20140821083421/app/../vendor/autoload.php' (include_path=
'.:/usr/share/pear:/usr/share/php') in ***********/releases/20140821083421/
app/autoload.php on line 5
    command finished in 903ms
*** [deploy:update_code] rolling back
  * executing "rm -rf ***********/releases/20140821083421; true"
    servers: ["54.244.228.172"]
    [54.244.228.172] executing command
    command finished in 919ms
failed: "sh -c 'sh -c '\\''cd **********/releases/20140821083421 && php ap
p/console cache:warmup --env=prod --no-debug'\\'''" on 54.244.228.172
多亏了@rolerbi,dededeploy通过了错误,似乎一切都做得很好。 但在最后它只是回滚。。。 下面是我的日志

 ** [out :: 54.244.228.172] 11:55:59 [file+] **********/releases/201408220
72838/app/../web/js/compiled/min_signup.js
    command finished in 78664ms
  * 2014-08-22 11:55:42 executing `symfony:cache:warmup'
--> Warming up cache
  * executing "sh -c 'cd **********/releases/20140822072838 && php app/con
sole cache:warmup --env=prod --no-debug'"
    servers: ["54.244.228.172"]
    [54.244.228.172] executing command
*** [err :: 54.244.228.172] PHP Warning:  Module 'apc' already loaded in Unknown
 on line 0
 ** [out :: 54.244.228.172] Warming up the cache for the prod environment with d
ebug false
    command finished in 12389ms
  * executing "chmod -R g+w **********/releases/20140822072838/app/cache"
    servers: ["54.244.228.172"]
    [54.244.228.172] executing command
    command finished in 843ms
    triggering after callbacks for `symfony:cache:warmup'
  * 2014-08-22 11:55:55 executing `symfony:doctrine:migrations:migrate'
    triggering before callbacks for `symfony:doctrine:migrations:migrate'
  * executing "sh -c 'cd **********/releases/20140822072838 && php app/con
sole --no-ansi doctrine:migrations:status --env=prod --no-debug'"
    servers: ["54.244.228.172"]
    [54.244.228.172] executing command
    command finished in 1391ms
*** [deploy:update_code] rolling back
  * executing "rm -rf **********/releases/20140822072838; true"
    servers: ["54.244.228.172"]
    [54.244.228.172] executing command
    command finished in 2183ms
failed: "sh -c 'sh -c '\\''cd **********/releases/20140822072838 && php ap
p/console --no-ansi doctrine:migrations:status --env=prod --no-debug'\\'''" on ****************
该行强制在安装供应商之前预热缓存。替换为:

before "deploy:share_childs",  "upload_parameters"
after  "symfony:cache:warmup", "symfony:doctrine:migrations:migrate"

代替

after "deploy" do
    run "cd ******** && php app/console cache:clear --env=prod && php app/console     assetic:dump --env=prod"
end
使用


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

但是,它会在代码的更高层检查服务器变量($_server('argv')),因此我只是在vhosts中设置,将其添加到文件中: SetEnv argv/var/www/njc forms/current


希望这对其他人有所帮助。

这是您在这台服务器上进行的第一次部署吗?您能在错误发生之前向我们提供完整的日志堆栈吗
logger.level=logger::TRACE
@alterPHP:这是第一次部署,但应用程序已经在服务器上。它试图改进我的部署过程。@rolebi:一旦我有了新日志级别的日志,我会立即更新我的帖子。你是否先玩了deploy:setup命令?非常感谢。真的好多了。但我有另一个问题,一切都顺利通过结束,只是。。。回降。我已经用新的更新了我的帖子messages@Salestrip关于原则:迁移:迁移错误:您的数据库设置是否在目标服务器上?原则:迁移:迁移是故意的还是仅仅通过复制/粘贴来实现的?我删除了原则:迁移:迁移,它就可以工作了!最后非常感谢你!
after "deploy" do
    run "cd ******** && php app/console cache:clear --env=prod && php app/console     assetic:dump --env=prod"
end
set :assets_install,      true
set :dump_assetic_assets, true