Vagrant PHP and PuPHPet is the Dogs Bollocks!


Posted by Andrew McCombe on Tue May 21, 2013

In The Beginning…

I’ve been a PHP Web Developer for a long long time and have spent many hours setting up development environments in order to practice my trade. From full blown towers running full cdrom installations of RedHat 6.2 through to a laptop running FreeBSD and then Slackware. I used to compile the LAMP stack from source, eventually ending up with a huge install script that would wget the latest Apache, MySQL and PHP sources, compile them, make and install.

However, over the years this got tedious and I eventually settled for running Ubuntu server on a VirtualBox Virtual Machine and installing the LAMP stack via ‘Tasksel’. Everything was fine; I could use my years of Linux Sysadmin skills to create new MySQL databases, add new websites, configure Apache and install other cool new stuff too (like Solr). Then the world moved on and my VM was outdated and I couldn’t reliably develop for the latest PHP.

Enter Vagrant…

I didn’t really feel like going through the hassle of installing a newer distro version, setting up all the sites and users etc so I began to look around for an alternative. Vagrant looked perfect and I played with it for a while but couldn’t get a full development environment up and running without either manually installing the LAMP stack from scratch and losing it the next time I ran ‘vagrant destroy’ or spending hours trying to set up some Puppet manifests to do the job for me. I want to develop my site, not spend a lifetime getting a development environment perfect.

…and PuPHPet

Lucky for me then that Juan Treminio took the trouble to do all this work and make it available on Github. Not only has he uploaded his Puppet manifests but he has also created a fantastic GUI to help you get your environment set up perfectly. You can set up your Apache VirtualHosts, choose which PHP modules you’d like installing and set up MySQL databases. Once you have chosen your settings you simply download the configuration as a Zip file, extract and run ‘vagrant up’. Thats it!.

Within 10 minutes I had my current website up and running on the new Vagrant VM and have been developing on it for the past week.

If you’ve had experience with PuPHPet, why not leave a comment below?