The Video is available in HD
If you have read my last blog post, I have chosen to use one Linux box to locally develop web applications. In the last post, I discussed how I setup the Python/Django environment. In this one, I’m going to talk about PHP.
As usual, I installed the LAMP server:
1 2 |
sudo apt-get update sudo apt-get install lamp-server^ |
I have all my PHP projects in “~/Sites”, I wanted to serve them from there. So removed the www directory.
1 |
sudo rm -rf /var/www |
Then I added my ~/Sites directory as a synced folder to be mounted as /var/www in the linux guest box. www-data is the user and group permission on these directories so Apache has no issues handling them.
My updated vagrant file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# -*- mode: ruby -*- # vi: set ft=ruby : # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.synced_folder "~/Sites", "/var/www", :owner => 'www-data', :group => 'www-data' config.vm.box = "precise64" config.vm.network :private_network, ip: "192.168.234.131" config.vm.hostname = "tardis.dev" end |
Upgraded PHP to PHP 5.5 and installed PHPMyAdmin:
1 2 3 4 5 |
sudo apt-get install python-software-properties sudo add-apt-repository ppa:ondrej/php5 sudo apt-get update sudo apt-get install php5 sudo apt-get install phpmyadmin |
Updated my /etc/hosts to update the local dev domains to the IP address of the vagrant box 🙂
1 |
192.168.234.131 tardis.dev |