views:

175

answers:

7

My main development, and workstation, is on an MS stack in .NET. I'm using IIS for my web endeavors, and everything works great.

However, I have a need to be able to work on and test on a LAMP stack for various reasons. I have various clients that are running on LAMP stacks and need help with projects.

My question is, given that I do most of my work on an MS stack, what should I do about getting up and running on a LAMP stack + PHP IDE?

Things I'm considering:

  • Running a virtual machine that runs Ubuntu for my LAMP or something along with Eclipse.
  • Run a WAMP stack instead. I'm not liking this one too much because I'd have to run Apache under a different port, and I'd really like to isolate the two development environments. Also, the production environment with definitely not be a WAMP stack.

So, what should I do? Please include pros and cons in your answers. Also, tips on installation would be helpful if there are some gotchas I might not be aware of.

+1  A: 

I'd go with virtual machines; they're great, and nowadays pretty much close to native speeds, especially for applications like serving web pages.

samoz
A: 

I'd download Virtual PC (free) from Microsoft and set up a Virtual Machine with your Linux distro of choice (I prefer SuSe). Like you said, load up your development environment (Eclipse is a solid choice), install the packages for your distro (SuSe makes it crazy easy to do) and you're up and running.

The downside to this is going to be performance. Your VM is going to be a little sluggish (especially running Eclipse, since it's written in Java).

You could go with the WAMP stack and un-install IIS (unless, of course, you're going to still be using the machine for Microsoft development...in which case, you're right, you'll need to run one on a different port) to overcome the performance issues but you'll lose your MS environment.

Justin Niessner
+1  A: 

Another option is installing Ubuntu using wubi. It allows you to install Ubuntu like it was a regular windows program (shows up in add/remove programs) and it adds an item to the windows boot loader. This way you can experience the Linux environment in its almost native form (it runs on NTFS instead of ext3 or something else) without having to partition your drive, and when your done, a simple uninstall and its gone.

Jason Miesionczek
+2  A: 

Unless you need something outside of PHP or MySQL, a really good choice is xampp. This provides all of the tools for a windows native install of apache, php, mysql, and a handful of other useful tools all in one go. It's very convenient and I have had a great time with it for several projects.

TokenMacGuy
I would second this option. I think xamp is now called WampServer which I would stongly recommend as a complete apache/Mysql/php package. I personally use gvim as my editor but thats cause I am old grumpy and set in my ways. With php its difficult for IDEs to implement the usual code completion and refactoring tricks you get with C# or Java so any editor with good PHP/SQL syntax highligting would do.
James Anderson
uhm, wamp and xampp are two different projects ... http://www.apachefriends.org/en/xampp.html and http://www.wampserver.com/en/ ...
back2dos
+3  A: 

Definitely go with the VM solution on this one.

For any given customer, you can spin up and configure, at will, a development and server environment that is as similar to their production environment you want.

So if Customer X is on Ubuntu Server 8.x, you can start that VM. Customize as you see fit to how that customer's production environment is. Any changes you make to that environment don't stomp on other customers environments. Customer Y is on some Debian platform in another VM, totally separate.

When you need to develop a solution, fix a defect, check out a change, whatever, you then fire up your Dev VM. Whatever flavour of OS is up to you of course. Again, separate from your customers' environments.

Keep your development VM separate from your customer environment VMs. Keep all your VMs on a separate physical HDD in your machine. Speedy! Definitely don't define your VMs on your C: drive.

This all has the benefit of being portable. If/when your physical machine's hard drive dies, you have a backup, or at least you have it on another HDD in your box. If THAT dies, you lose almost nothing (well, only that since your last backup!). If you want to move everything to another faster machine, easy enough... just remove the HDD into the new machine.

Which VM Host? Your choices range from Virtual PC, to VMWare Server, Sun VirtualBox, and more. I'd recommend VMWare Server. It can run your VMs headless if you choose. You won't need to have the console open on your desktop. VMWare Server can create the images as well, whereas I had problems creating VMs in VMWare Workstation. VMWare Server's performance feels slick... almost nonexistant (Win 2003, 4GB RAM total, 2 VMs with 512 RAM each). I rarely feel the effect of running those clients.

p.campbell
A: 

It is just easy to setup a Sun VirtualBox on your windows machine and spin up the Ubuntu or Fedora image and get your Linux up and running. I found that it is much easier to work on a Linux box if you are working on a LAMP project. Plus you really don't need Eclipse. I just had my Linux machine setup with everything and used notepad++ to ftp connect to my linux box and edit my php code from my windows box. Once I am done, I save my changes and test it out the website. Using Eclipse actually did not help initially. So after lot of trial and error, I found this setup working perfectly fine without needing to VNC or switching back and forth with my windows workstation. Notepad++ is awesome for PHP dev.

CodeToGlory
+1  A: 

as suggested, WAMP and XAMPP are perfect candidates ... i develop my code on a windows machine, testing on WAMP, and never experienced any problems ... there is some funky linux stuff you can't access from PHP on a WAMP, but this is nothing you'll run into often ... oh and you will find that rights management on linux takes a little more time, since PHP will need to have access to files created with FTP ... but you get used to that as well ... :)

as for PHP ... best thing around for PHP is the Zend IDE, which now essentially became an eclipse plugin ... there's also PHP eclipse, but that's not soooo amazingly good ... well, it wasn't last time i checked out 1.5 years ago ... :) ... for windows, there is FlashDevelop, with rudimentary support for PHP ...

if you are not going to maintain projects, but are rather going to write things from scratch, you should look into symfony ... or, my alltime favourite for writing PHP: haXe ... its a high, strongly typed, OO language with powerful features (enums with parameters, structural subtyping, generics etc.) that can be compiled/translated to JavaScript, PHP, C++, nekoML, nekoVM bytecode, AVM1 bytecode and AVM2 bytecode ... there are efforts for JVM and CLR as well ... the generated PHP code is not too beatiful, but perfectly readable ... coming from a serious language as C#, PHP will make you scream, really ... so you should maybe give haXe a shot, if you can ... there a link to many haXe IDEs on haxe.org ... the mentioned FlashDevelop is the best for windows ...

good luck then ... ;)

back2dos