Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

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.

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.

Probably get told off for redirecting an old post but here's how I do it using free tools:

I use Netbeans, Git, bitbucket, source tree, gitflow and FTPloy.

Bitbucket.com : sign up for free account. SourceTree: free from bitbucket. Great tool for managing git repositories. All commits, merges and pulls can be done in here. Issues in bitbucket can be tracked.

In sourcetree, take the master branch and click "git flow" - google gitflow - it's fantastic work flow of feature, hotfix, development, and release branches and sourcetree helps automate the process.

FTPloy.com automates the deployment of your master branch. Free is one repo/server. But worth the upgrade if you want to push development branch to a server sandbox for testing.

Hope this helps someone searching the web!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top