Capifony + Symfony2: FileLoaderLoadException, Невозможно импортировать файл settings.ini из config.yml - PullRequest
2 голосов
/ 11 февраля 2012

У меня возникает следующая проблема при попытке заставить Capifony работать при развертывании моего приложения, разработанного с помощью Symfony2.Я развернул его на общем сервере веб-хостинга ... Надеюсь, кто-нибудь сможет пролить свет:

Это журнал при вызове cap deploy:

    /Applications/MAMP/htdocs/mtg
My-Mac:mtg $ cap deploy
  * executing `deploy'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    executing locally: "svn info http://path.to/svn/my-app/  -rHEAD"
    command finished in 3362ms
  * getting (via checkout) revision 67 to /var/folders/kv/htk616w153q26vlhlp5g7xqw0000gn/T/20120211124452
    executing locally: svn checkout -q  -r67 http://path.to/svn/my-app/ /var/folders/kv/htk616w153q26vlhlp5g7xqw0000gn/T/20120211124452
    command finished in 6517ms
    compressing /var/folders/kv/htk616w153q26vlhlp5g7xqw0000gn/T/20120211124452 to /var/folders/kv/htk616w153q26vlhlp5g7xqw0000gn/T/20120211124452.tar.gz
    executing locally: tar chzf 20120211124452.tar.gz 20120211124452
    command finished in 190ms
    servers: ["server.com"]
Password: 
 ** sftp upload /var/folders/kv/htk616w153q26vlhlp5g7xqw0000gn/T/20120211124452.tar.gz -> /tmp/20120211124452.tar.gz
    [server.com] /tmp/20120211124452.tar.gz
    [server.com] done
  * sftp upload complete
  * executing "cd /var/chroot/home/content/62/8680462/html/capifony/releases && tar xzf /tmp/20120211124452.tar.gz && rm /tmp/20120211124452.tar.gz"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 9561ms
  * executing `deploy:finalize_update'
  * executing "chmod -R g+w /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 12790ms
  * executing "if [ -d /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/app/cache ] ; then rm -rf /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/app/cache; fi"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 271ms
  * executing "mkdir -p /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/app/cache && chmod -R 0777 /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/app/cache"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 264ms
  * executing "chmod -R g+w /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/app/cache"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 122ms
  * executing `deploy:share_childs'
  * executing "mkdir -p /var/chroot/home/content/62/8680462/html/capifony/shared/app/logs"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 131ms
  * executing "if [ -d /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/app/logs ] ; then rm -rf /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/app/logs; fi"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 241ms
  * executing "ln -nfs /var/chroot/home/content/62/8680462/html/capifony/shared/app/logs /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/app/logs"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 115ms
  * executing "mkdir -p /var/chroot/home/content/62/8680462/html/capifony/shared/web/uploads"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 148ms
  * executing "if [ -d /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/web/uploads ] ; then rm -rf /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/web/uploads; fi"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 106ms
  * executing "ln -nfs /var/chroot/home/content/62/8680462/html/capifony/shared/web/uploads /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/web/uploads"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 131ms
  * executing "mkdir -p /var/chroot/home/content/62/8680462/html/capifony/shared/vendor"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 100ms
  * executing "if [ -d /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/vendor ] ; then rm -rf /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/vendor; fi"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 154ms
  * executing "ln -nfs /var/chroot/home/content/62/8680462/html/capifony/shared/vendor /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/vendor"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 301ms
  * executing "mkdir -p /var/chroot/home/content/62/8680462/html/capifony/shared/app/config"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 243ms
  * executing "touch /var/chroot/home/content/62/8680462/html/capifony/shared/app/config/parameters.ini"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 180ms
  * executing "ln -nfs /var/chroot/home/content/62/8680462/html/capifony/shared/app/config/parameters.ini /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/app/config/parameters.ini"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 210ms
  * executing "if [ -d web/css ] ; then mkdir -p web/css; fi"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 100ms
  * executing "if [ -d web/images ] ; then mkdir -p web/images; fi"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 98ms
  * executing "if [ -d web/js ] ; then mkdir -p web/js; fi"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 104ms
  * executing "find /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/web/css /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/web/images /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452/web/js -exec touch -t 201202111245.31 {} ';'; true"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 2351ms
    triggering after callbacks for `deploy:finalize_update'
  * executing `symfony:assets:install'
  * executing "cd /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452 && /usr/local/php5_3/bin/php app/console assets:install web --env=prod"
    servers: ["server.com"]
    [server.com] executing command
*** [err :: server.com] PHP Deprecated:  Comments starting with '#' are deprecated in /web/conf/php5.ini on line 1256 in Unknown on line 0
*** [err :: server.com] PHP Deprecated:  Comments starting with '#' are deprecated in /web/conf/php5.ini on line 1257 in Unknown on line 0
*** [err :: server.com] 
*** [err :: server.com] Deprecated: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0
 ** [out :: server.com] 
 ** [out :: server.com] 
 ** [out :: server.com] 
 ** [out :: server.com] [Symfony\Component\Config\Exception\FileLoaderLoadException]
 ** [out :: server.com] Cannot import resource "/home/content/62/8680462/html/capifony/releases/20120211124452/app/config/parameters.ini" from "/home/content/62/8680462/html/capifony/releases/20120211124452/app/config/config.yml".
 ** [out :: server.com] 
 ** [out :: server.com] 
 ** [out :: server.com] 
 ** [out :: server.com] 
 ** [out :: server.com] 
 ** [out :: server.com] 
 ** [out :: server.com] [InvalidArgumentException]
 ** [out :: server.com] The "/home/content/62/8680462/html/capifony/releases/20120211124452/app/config/parameters.ini" file is not valid.
 ** [out :: server.com] 
 ** [out :: server.com] 
 ** [out :: server.com] 
    command finished in 3582ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452; true"
    servers: ["server.com"]
    [server.com] executing command
    command finished in 13568ms
failed: "sh -c 'cd /var/chroot/home/content/62/8680462/html/capifony/releases/20120211124452 && /usr/local/php5_3/bin/php app/console assets:install web --env=prod'" on server.com

Это мое развертываниеrb:

set :application, "My App"
set :domain,      "server.com"
set :deploy_to,   "/var/chroot/home/content/62/8680462/html/capifony"
set :app_path,    "app"

set :repository,  "http://path.to/svn/"
set :scm,         :subversion
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, `subversion` or `none`

#set   :deploy_via,    :rsync_with_remote_cache
set   :deploy_via,    :copy

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

role :web,        "server.com"                         # Your HTTP server, Apache/etc
role :app,        "server.com"                         # This may be the same as your `Web` server
role :db,         "server.com", :primary => true       # This is where Rails migrations will run

set  :keep_releases,  3

set :shared_files,      ["app/config/parameters.ini"]
set :shared_children,     [ app_path + "/logs", "web/uploads", "vendor"]
set :update_vendors, false
set :user, "root"
set :use_sudo, false
# set :dump_assetic_assets, false
set :php_bin, "/usr/local/php5_3/bin/php"
#set :symfony_lib, "/var/chroot/home/content/62/8680462/html/vendor/symfony"

Обратите внимание, что я установил update_vendors в false, потому что Git не работает на сервере, поэтому я вручную скопировал и загрузил файлы в общую папку.Я использую PHP 5.3.6 на локальном и удаленном компьютере.

Спасибо

1 Ответ

1 голос
/ 12 февраля 2012

Похоже, что у вас нет parameters.ini в общей папке (/var/chroot/home/content/62/8680462/html/capifony/shared/app/config/parameters.ini).

Вы запускали cap deploy:setup и cap deploy:cold до cap deploy? Если вы хотите, вы можете создать его вручную перед запуском cap deploy.

...