A Vagrant project which aims you to get a feature rich PHP development box (VM). It provides a quite good number of tools and libraries, including those related to the latest technologies. The box is based on a fresh Ubuntu 12.04 built using veewee and provisioned by Vagrant via Chef.
- Apache 2, node.js
- PHP (5.4), Composer, PHPUnit, xDebug
- MySQL, Memcached, MongoDB (10gen), SQLite
- NFS, GhostScript, ImageMagick, Vim, Ruby (Gems: Compass, Less, SASS)
-
Install VirtualBox and Vagrant.
-
Open a Terminal,
cd
to your working directory, clone the project:git clone git://github.com/morafabio/vagrant-php-development-box.git
-
Edit the Vagrantfile.sample and customize it as you need. Save it as Vagrantfile.
-
Run
vagrant up
to provision it, should take a few minutes. -
(If you want to get a shell type
vagrant ssh
).
VM IP: 33.33.33.10
System user: vagrant
System password: vagrant
MySQL user: root
MySQL password: root
xDebug Remote: 33.33.33.1
- You can add multiple projects and mountpoints editing
Vagrantfile
. Look forweb_apps
definition.
Here's the outline:
"host_project_folder" host side, where your project resides
"guest_project_folder" vm side, where host_project_folder is mounted on via vboxsf
"guest_docroot" vm side, the Apache2 docroot
"server_name" Apache2: ServerName
"server_aliases" Apache2: ServerAlias
"php_timezone" php.ini project's timezone
And an example:
web_apps = {
"site1" => {
"host_project_folder" => "../web-app-1/",
"guest_project_folder" => "/home/vagrant/web-app-1",
"guest_docroot" => "/home/vagrant/web-app-1/web",
"server_name" => "webapp1.test.local",
"server_aliases" => ["*.webapp1"],
"php_timezone" => "Europe/Rome"
},
"site2" => {
"host_project_folder" => "../web-app-2/",
"guest_project_folder" => "/home/vagrant/web-app-2",
"guest_docroot" => "/home/vagrant/web-app-2/web",
"server_name" => "webapp2.test.local",
"server_aliases" => [],
"php_timezone" => "America/New_York"
}
}
- Run
vagrant provision
.
- Reorganize the chef cookbook provisioning strategy, in order to get the latest recipes version.
- A CentOS version and a 32 bit edition: make the base box compatibile with other O.S..
- VirtualBox Guest Additions should be easily upgradable.
Workaround thevboxsf
[cache bug] (https://forums.virtualbox.org/viewtopic.php?f=3&t=33201)
Some projects from which I took the code and inspiration, thanks!
- symfony-vagrant
- veewee
- Chef Cookbooks: look for README.md inside each directories' for details.