Laravel 4 w/ Vagrant - Global Box
A basic Ubuntu 12.04 Vagrant setup with Laravel4 and PHP 5.5.
Requirements
- VirtualBox - Free virtualization software Download Virtualbox
- Vagrant 1.3+ - Tool for working with virtualbox images Download Vagrant
- Git - Source Control Management Download Git
Setup
- Clone this repository
git clone http://github.com/bryannielsen/Laravel4-Vagrant.git
- (the first time you run vagrant it will need to fetch the virtual box image which is ~300mb so depending on your download speed this could take some time)
- Vagrant will then use puppet to provision the base virtual box with our LAMP stack (this could take a few minutes)
Note: You may have to change permissions on the www/app/storage folder to 777 under the host OS
For example: chmod -R 777 www/app/storage/
Usage
Some basic information on interacting with the vagrant box
Fabric Commands
All the fabric commands need to be prefixed with fab vagrant
, for example fab vagrant composer
will run a composer update.
composer:'comand string'
- This will run the composer command that you request. Ex:fab vagrant composer:'install'
artisan:'command string'
- Similar to above but for artisan commands. Ex:fab vagrant artisan:'migate'
setProject:projectname
- Set the project folder to be the specified name in the parent folder.restoreDb
- restore the current projects last database dumpbackupDb
- Backup the current project's database
Port Forwards
- 8888 - Apache
- 8889 - MySQL
- 5433 - PostgreSQL
Default MySQL/PostgreSQL Database
- User: root
- Password: (blank)
- DB Name: database
PHPmyAdmin
Accessible at http://localhost:8888/phpmyadmin using MySQL access credentials above.
PHP XDebug
XDebug is included in the build but disabled by default because of the effect it can have on performance.
To enable XDebug:
- Set the variable
$use_xdebug = "1"
at the beginning ofpuppet/manifests/phpbase.pp
- Then you will need to provision the box either with
vagrant up
or by running the commandvagrant provision
if the box is already up - Now you can connect to XDebug on port 9001
XDebug Tools
Note: All XDebug settings can be configured in the php.ini template at puppet/modules/php/templates/php.ini.erb
Virtual Machine Specifications
- OS - Ubuntu 12.04
- Apache - 2.4.6
- PHP - 5.5.4
- MySQL - 5.5.32
- PostgreSQL - 9.1
- Beanstalkd - 1.4.6
- Redis - 2.2.12
- Memcached - 1.4.13