Matthew Daly's Blog

I'm a web developer in Norfolk. This is my blog...

16th August 2013 9:49 pm

A Starting Boilerplate for PHP Development With Vagrant

I’ve recently started using Vagrant for PHP development. It’s an incredibly useful and convenient tool - never again will I have to faff about installing XAMPP on someone’s laptop so they can demonstrate the new site, instead I can just install Vagrant and Virtualbox, clone the repository, and run vagrant up, and nip off and make a cuppa, safe in the knowledge that when I get back the install will be, if not done, then at least in progress. Also, it means it’s easy to run the same OS for development and production.

I’ve used PuPHPet a bit, but I’ve found Puppet to be a little complex for what I wanted, so I switched to using the shell provisioner instead. As a starting point for future projects, I’ve thrown together a basic Vagrant configuration based on that provided by PuPHPet, that includes the following:

  • A full LAMP stack, running on Ubuntu 12.04
  • APC
  • PHPMyAdmin
  • Git
  • A blank SQL file - this is automatically run on vagrant up, so you can place any commands needed to set up your database in here.
  • msmtp - just amend the username and password in to point to a Gmail account and your web app should be able to send emails via that account quickly and easily

It’s available here, and if you haven’t discovered the benefits of Vagrant yet, it would be a good place to start.

Recent Posts

Enforcing a Coding Standard With PHP Codesniffer

Decorating Laravel Repositories

My First Laravel Package

Integrating Behat With Laravel

Testing Laravel Middleware

About me

I'm a web and mobile app developer based in Norfolk. My skillset includes Python, PHP and Javascript, and I have extensive experience working with CodeIgniter, Laravel, Django, Phonegap and Angular.js.