Php – How to make the PHP development environment more efficient

development-environmentlinuxPHPwindows

I want to start a home-brew pet project in PHP.

I've spent some time in my life developing in PHP and I've always felt it was hard to organize the development environment efficiently.

In my previous PHP work, I've used a windows desktop machine and a linux server for development.

This configuration had it's advantages: it's easy to configure Apache (and it's modules)/PHP/MySql on a linux box, and, at the time, this configuration was the same like on production server.

However, I never successfully set up a debug connection between my Eclipse install and X-debug on server. Transferring files from my local workspace to the server was also very annoying (either ftp or Bazaar script moving files from repository to web root).

For my new setup, I'm considering installing everything on my local machine. I'm afraid that it will slow down workstation performance (LAMP + Eclipse), and that compatibility problems will kick-in.

What would you recommend? Should I develop using two separate machines? On one? Do you have experience using one of above configurations in your work?

Best Answer

Sandbox. If at all possible, you should have a complete environment on your machine including database, web server, caches and what else that is part of the actual live installation. This does not mean you need 10 load balancing web servers or a million row database, rather it should contain enough of it to be representative of the real installation. You should also be able to re-create this sandbox with a simple command (including populating databases, installing environment etc).

This applies to all languages and not just PHP.

Related Topic