pbrodka
pbrodka

Reputation: 1137

How do you manage PHP Project Development Lifecycle?

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?

Upvotes: 12

Views: 3066

Answers (6)

Karthik SWOT
Karthik SWOT

Reputation: 1217

This is my own PHP Development lifecycle.

  1. Create a GIT Private Repository on Github or Bitbucket.
  2. Connect the GIT with cPanel. (It's very easy to commit the changes to the repo as well as a production server).
  3. Develop on Localhost(probably on Xampp on Windows) with Visual Studio Code or Sublime Text
  4. Initialise GIT and connected with the private repository.
  5. Push the changes to the GIT repository (master/branches) - master changes will upload to the production server automatically.

Upvotes: 0

Peter J. Nicholls
Peter J. Nicholls

Reputation: 165

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!

Upvotes: 0

Francisco Soto
Francisco Soto

Reputation: 10402

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.

Upvotes: 0

Colonel Sponsz
Colonel Sponsz

Reputation: 1721

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.

Upvotes: 10

friol
friol

Reputation: 7096

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.

Upvotes: 1

Patryk Kordylewski
Patryk Kordylewski

Reputation: 1269

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.

Upvotes: 0

Related Questions