Search code examples
phpsymfonycapistranocapifonyproc-open

Proc_open and Capifony issue


I'm trying to use Capifony with my web app in Symfony2.1 to accelerate the deployment process.

Here is my deploy.rb file :

default_run_options[:pty] = true
set :application, "mywebsite"
set :domain,      "mywebsite.com"
set :deploy_to,   "~/git/mywebsite.git"
set :app_path,    "app"

set :repository,  "git@github.com:myname/mywebsite.git"
set :scm,         :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none`
set :user, "myserveruser"  # The server's user for deploys


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

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 Symfony2 migrations will run

set :use_composer, true
set :update_vendors, true


set :use_sudo,      false
set :keep_releases,  3
set :shared_files,      ["app/config/parameters.yml"]
set :shared_children,   [app_path + "/logs", web_path + "/uploads"]

set :deploy_via, :rsync_with_remote_cache
set :ssh_options, { :forward_agent => true }
ssh_options[:keys] = %w(/.ssh/id_rsa)
ssh_options[:port] = xxxx


# Be more verbose by uncommenting the following line
logger.level = Logger::MAX_LEVEL

And here is my error :

 The Process class relies on proc_open, which is not available on your PHP installation.

when the script runs php composer.phar update

more details here : http://pastebin.com/hNJaMvwf

But I'm in a shared hosting and my hoster told me that I can't have proc_open enabled, is there a way to get it working though ?

Thanks a lot for your help !


Solution

  • Composer needs to be able to run command-line processes (it does this using the symfony/process component). There is no way to have Composer run if your host does not support proc_open.

    As an alternative deployment strategy, you could upload the vendor/ directory manually to the production machine (you can use the upload functionality in your Capistrano recipe). That said, virtual servers are affordable these days, and I would not recommend deploying Symfony2 applications to a shared hosting anyway. Maybe you should be looking for a different hosting solution?