views:

612

answers:

4

Hello. I've worked on several PHP projects and always I have problems with organizing my work. Where do you develop your application - on localhost, remote server or maybe production one(!) ? When I work on my localhost after making some major path I send new files by ftp - but sometimes it happens to forget about one file and it is just tiring to browse several directiores to copy changed files. What best practises do you propose?

A: 

I'm developing on a development machine which has an identical enviroment like the production one - that prevents some different behaviour because of different versions or configs. after finishing i just move all the files on to the production server.

Winmerge is a nice and free windows tool to diff your files between development and production machine.

Endlessdeath
Isn't that like having a control version system without the ability to go back in time?
Francisco Soto
+1  A: 

Google App Engine has an apposite tool that automatically uploads to the production environment files that are modified; don't know if there's something similar for PHP. So, doing a dev2prod script (a script that does this automatically) should be a good solution.

To do local source file management, everyone may suggest you to use a source code control system.

friol
+7  A: 

This is how we manage our commercial site:

  1. Develop in a local sand box
  2. Check-in to SVN
  3. Automated build/test from SVN onto internal dev server
  4. Scripted deploy using rsync to staging server for QA/UAT
  5. Scripted deploy onto production servers.

Staging and production servers are both hosted by the ISP and are hardware and version matched and run RHEL, internal Dev server is version matched CentOS.

This way, when code hits the production servers there shouldn't be any nasty surprises as even the deploy scripts get checked in stage 4.

Colonel Sponsz
We do something similar except we use an SVN checkout to make the stage build (allows a revision # or tag to be specified - in case the trunk is undeployable) - then use rsync to ensure production exactly matches stage.
DavidWinterbottom
A: 

Develop in your local machine with the same exact configuration as your development enviroment (that is apache mods, php extensions and so on), using a version control system (I prefer SVN) to keep track of modified files and what not.

Then you can write a script in your production or testing enviroment to copy/update files off the repository to the web server path.

Francisco Soto