I've always edited code survive a website with an FTP connection in Coda or similar, however I have just written my first PHP web application for user newbies etc and I am very wary that i am have to a much better plan than "live editing". I am on hosting that is shared and so i think such things as SVN and GIT are most likely out but can there be any software/scripts/solutions that will permit me to push code live to some web server and also have the master copy on my small Mac.

What exactly are peoples encounters with web applications/deployment and hosting that is shared?

i personally use a cakephp spend tool i authored – which uses “rsynch” and just uploads the delta (changes made to date). with your a rsync script it's fast to upload transformed files. only dependent on 1-2 seconds.

with another project I must commit everything and by hand "svn update" the server constantly. very annoying + you have to commit even "test stages".

so in the end I suggest while using above delta upload. Make certain you do not upload any tmp stuff as well as worse, override atmosphere based files like uploads, cached files etc. Using batch scripts like rsynch you are able to usually exclude some sites.

my configuration for instance is

server      xxx

username    xxx

password    xxx

local       C:...app

remote      /var/world wide web/site

protocol    ftp

permissions ignore

condition       timesize

exclude     _*

exclude     *__*

exclude     *~*

exclude     .svn

exclude     .git

exclude     /tmp

exclude     /files/uploads/*

exclude     /webroot/files/tmp

exclude     /webroot/img/content/*

I've written my very own deployment system to prevent editing on live.

It runs in a variety of stages - they're:

  1. SVN export from local repository (which means you do not get lots of .svn sites)
  2. rsync released code to reside server - however in --dry-run mode to help you see what's really going to increase to reside. This command has some excludes onto it: --exclude application/tmp
  3. rsync in normal mode

Some extra supplies I have place in.

  • Because I am running the code on multiple web servers behind a lot balancer, I exclude core.php and database.php. I've then symlinked individuals files on each one of the web servers to some centrally accessible NFS.
  • The rsync to reside runs, however it only uploads it once (towards the NFS). The deploy script then runs an order on the remote server (via ssh) to start an rsync between your NFS and web servers. It is a party script which means I'm able to easily manage the net nodes and just how the files get pressed out.

Hope that can help!