This is a Vagrant box built on CentOS 6 and the Puppet provisioner.
- Install Vagrant and VirtualBox
- run
vagrant up
- Place your PHP code in a new directory called
webroot
- run
vagrant open
to launch a web browser (currently, theopen
command only implemented on OS X)
By default, the virtual machine will use bridged networking, so your VM will need to be able to obtain an IP address via DHCP. Bridged networking has the advantage of being able to run multiple vagrant boxes simutaneousy, without TCP port conflicts.
See Vagrantfile
and puppet/manifests/default.pp
for customization options.
- LAMP
- Choice of PHP version: 5.3, 5.4, 5.5, HHVM
- Choice of MySQL version: 5.1, 5.5
- popular PHP extensions: xml, mcrypt, mbstring, GD, php-imagemagick, etc
- HTTPS support
- postfix
- TODO: Solr
- mod_fastcgi + php-fpm
- Apache Worker MPM
- Zend OPcache (5.5 only)
- APC (<= 5.4 only)
- memcached
- TODO: Varnish
- compass
- drush
- capistrano
- git, svn, bzr, mercurial
- XDebug
- XHProf
- yum-cron
- iptables
- TODO: fail2ban
- TODO: iptables
XHProf is installed in /usr/share/pear
. The web interface is available at http://example.com/xhprof
.
XDebug has debug, profile, and trace triggers enabled. To use these triggers, add one of the following queries to your URL:
/?XDEBUG_SESSION_START=idekey
(connects to your debugger on port 9000)/?XDEBUG_PROFILE
(stores a cachegrind file in /tmp)/?XDEBUG_TRACE
(stores a trace file in /tmp)
- A development / production switch. This will be important when e.g. XDebug is added in the future.
- Optional support for Apache virtualhosts (the choice to omit this currently is intentional, since the intent is a dedicated vagrant box per project, but vhosts may be needed someday).
- Automatic updates to host OS's /etc/hosts file, so that sites don't have to be accessed via IP.
We have found Trevor works well as a Git submodule. To add the submodule and some symbolic links to the top of your repository, follow these steps:
git submodule add [email protected]:metaltoad/trevor.git
ln -s trevor/Vagrantfile .
ln -s trevor/puppet .
git add Vagrantfile puppet
git commit
Note that symlinks won't work if you have collaborators using Windows.