2012-02-11 5 views
2

私は、CapifonyにSymfony2で開発したアプリケーションを配備しようとすると、次の問題が発生します。私はホープ誰かがいくつかの光を当てることができます...共有Webホスティングサーバーにデプロイしています:Capifony + Symfony2:FileLoaderLoadException、config.ymlからparameters.iniリソースをインポートできません。

キャップデプロイを呼び出すときには、ログです:

/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 

これは私のdeploy.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" 

Gitがサーバー上で動作していないため、私は手動でtarredしてファイルを共有フォルダにアップロードしたので、update_vendorsをfalseに設定しました。 ローカルマシンとリモートマシンの両方でPHP 5.3.6を実行しています。

おかげ

答えて

1

あなたが共有場所(/var/chroot/home/content/62/8680462/html/capifony/shared/app/config/parameters.ini)でparameters.iniを持っていないようです。

cap deploy:setupcap deploy:coldcap deployの前に実行しましたか?必要に応じて、cap deployを実行する前に手動で作成することができます。

+0

IDは実行しました。deploy:setup ... cap展開は何ですか:coldですか?それはcap展開を行うのとまったく同じように思えます。 $ pwd /var/chroot/home/content/62/8680462/html/capifony/shared/app/config $ ls - これは、 lart -rw-r - r-- 1 mygroup inetuser 0 Feb 11 05:45 parameters.ini – Prem

+1

'deploy:cold' - 'cold'アプリケーションをデプロイして起動します。前にアプリケーションをデプロイしていない場合、またはアプリケーションが(他の理由で)現在動作していない場合に便利です。私はそれがsymfony1プロジェクトにとって有益なコマンドだと思いましたが、私はsymfony2プロジェクトには使用しません。 'InvalidArgumentException'は' parameters.ini'ファイルが有効なiniファイルでないときにスローされます。それが整形されていることを確認してください。 –

関連する問題