Live data from Hacker News

Ask HN: How do you deploy your PHP apps to production?

news.ycombinator.com

11–20 of 57 posts

Re: Ask HN: How do you deploy your PHP apps to production?

#11
Capistrano, despite being written in Ruby, will deploy PHP. I've used it to deploy WordPress and SMF installs once or twice. The advantage here is that you don't have to choose git over svn or any CVS for that matter. You can keep your configs separate and link them in.

Re: Ask HN: How do you deploy your PHP apps to production?

#13
We use Mercurial here. Easy, secure (ssh with keys) never forget files, small transfer size, possibility of committing regularly when the client has access to the files. With hooks, the update is done as soon as the changesets are received.

In some cases we can even create websites on the fly with a simple "hg clone"

I guess Git allows more or less the same workflow but Mercurial is easier for your designers.

Re: Ask HN: How do you deploy your PHP apps to production?

#17
We have build scripts for phing, exports from subversion, migrates the database, loads stored procs, triggers and views, creates symlinks for data here and there, creates our dojo build layers, and builds a couple of executables we need.

Capistrano is better for the simple stuff, but once we started doing more we moved to phing.

Re: Ask HN: How do you deploy your PHP apps to production?

#18
I deploy a large symfony php app with capistrano.

The only big change I needed to add was to tell it not to run the server restarting code, other then that it wasn't that hard.

Rollback support, and the fact that I don't have to login to the server and run commands each time I deploy is great.

Re: Ask HN: How do you deploy your PHP apps to production?

#19
I've tried out a few different tools now; the only two I've had any real success with were Capistrano and Fabric.

Capistrano works well, great git integration, but it does have some rails-isms you need to override to make it work sanely. The capistrano-php extension can help with that: http://github.com/namics/capistrano-php but you'll need to use gem to manage it. You'll also definitely want the multistage plugin which doesn't come standard. There were some bugs present in the CVS integration which may be a problem depending on your source control system.

I've also tried Fabric: http://docs.fabfile.org/0.9.2/ I liked the tool. I found it a bit more low level then Capistrano but also a little simpler to work with. It comes prepackaged (albeit an older version) in Ubuntu without any dependencies other than stock python which our sysadmin preferred to using Ruby gems. I do recommend the new version found in pip though. The two main problems with Fabric are its lack of any integration plugins and the Paramiko SSH library it uses has no support for SSH key forwarding (there is a workaround: http://lincolnloop.com/blog/2009/sep/22/easy-fabric-deployme... but it has its own set of problems).

In the end, neither worked out for me. Capistrano had to much of a learning curve for my co-workers and Fabric wouldn't work with our SSH setup. For now, I'm using a script in our working directory that I SSH to, run, and it updates the code in place. Crude, but ultimately effective. That said, definitely looking forward to a replacement.

Post reply on HN