Capifony: parse error on build_bootstrap.php

Go To StackoverFlow.com

0

I'm trying to deploy for first time my application to production. For this I want to ue Capifony. I followed Capifony.org instructions but I'm stuck with this error

Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php on line 35
Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in app/console on line 13
Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in app/console on line 13

My hosting provider gives PHP 5.2 as default, but I have access to 5.3 so I need to set up php path on Capifony config.

This is my deploy.rb

#Application
set :application, "acme"
set :domain,      "#{application}.com"
set :deploy_to,   "/home/user/public_html/acme"
set :app_path,    "app"

#Repository
set :repository,  "git@bitbucket.org:user/repo.git"
set :scm,         :git
set :deploy_via,  :rsync_with_remote_cache
set :git_enable_submodules, 1 

set :model_manager, "doctrine"

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  :keep_releases,  3

#Symfony2
set :shared_files,      ["app/config/parameters.ini"]
set :shared_children,     [app_path + "/logs", web_path + "/uploads", "vendor"]
set :update_vendors, true
set :dump_assetic_assets, true

#Server connection
set :user, "user"
ssh_options[:forward_agent] = true
ssh_options[:port] = "2222"
set :use_sudo, false

set :php_bin, "/opt/php53/bin/php"

And finally on my development environment I never got those errors.

Edit: Command executed by capifony when error is thrown

/opt/php53/bin/php bin/vendors install --reinstall

Symfony    -> 2.0.12
Capifony   -> 2.1.5
Capistrano -> 2.11.2

console line 13: use Symfony\Bundle\FrameworkBundle\Console\Application;

2012-04-05 17:53
by Axxiss
What version of symfony and capifony do you use? What is on line 13 in your app/console - Anton Babenko 2012-04-06 09:33
I added to the question. It's weird, seems like is using php 5.2 instead 5.3 although 5.3 is specified on the command - Axxiss 2012-04-06 10:14
Is using PHP 5.2, indeed. Both files on the first line have

!/usr/bin/env php

When i modified them and I put the path to PHP 5.3, when updating vendors the problem was gone. But obviously when deploying a new version the problem is still there because get the source code from a repository - Axxiss 2012-04-06 10:43



0

As a workaround, adding PHP 5.3 path at the beginning of the PATH solve this issue.

2012-04-07 09:57
by Axxiss
Ads