the future of the php development environment
DESCRIPTION
The future of the php development environment. Talk given at the PHP London UK 2013TRANSCRIPT
The Future of the PHP Development Environment
About the Speaker
• Originally from Cape Town South Africa been living and working in London for 6 years.
• Developing with PHP on the lamp stack since 2002.
• Currently work at Comic Relief on their scalable fundraising platform.
• Follow me on twitter @jeremyquinton
Red Nose Day is back 15th March 2013 so look out for it
http://www.rednoseday.com
The Future of the PHP Development Environment
This talk contains Ruby
The Past
NO PLACE LIKE
127.0.0.1
http://www.php.net/manual/en/install.php
How does a newbie install php?
Some solutions
Homebrew
Package Manager on Linux APT, YUM ETC
PHP
MySQL
EcoSystem around the Lamp Stack has changed drastically
Linux/Windows/Mac OSX
Apache
Nginx
Varnish RedisMemcache
CouchDB
MongoDB
Cassandra
RabbitMQ
ZeroMQ
Gearman
This is not a exhaustive list
PHP has over 150 extensions
The concept of a production snowflake in many ways can be applied to our development environments - http://martinfowler.com/bliki/SnowflakeServer.html
Spot the difference
“Keep development, staging, and production as similar as possible”
- http://12factor.net/
Spot the difference is similar to Dev/Prod Parity Concept
Summary of Past and Present problems
Setting up the modern dev environment, which has many moving, parts isn't straightforward
Uniqueness
Switching between projects with different dependancies is difficult
Local dev environments differ significantly from production
The Present: A solution to these problems
http://www.vagrantup.com/
@mitchellh creator and maintainer of vagrant
$ vagrant up
What is the Vagrant Idea/Concept?
“A tool to transparently manage all the complex parts of modern development within a virtual environment without affecting the everyday workflow of the developer too much.” - http:/.vagrantup.com
ProvisionerProvider - virtualisationVagrant
How vagrant worksBasic Vagrant WorkflowOnce Configured one command to bring up your development environment.
When you finished work for the day
$ vagrant up
$ vagrant haltWhen you done with the dev environment
$ vagrant destroy [vn-name]
Provision the virtual environment
$ vagrant provision
To access the virtual machine via ssh
$ vagrant ssh
Open source project written in Ruby, a command line tool. Supported on most major operating systems.
Vagrant command line options
How vagrant worksVagrant instance is managed with Vagrantfile which is Ruby syntax.
28 configuration options.
Three methods to create a box fileThree methods to create a box file
Download a box file from http://www.vagrant.es
Using the instructions off http://vagrantup.com
VeeWee https://github.com/jedi4ever/veewee
Vagrant config file continued...
Chef - a provisioner
Basic Chef Solo configuration
Quick Recap
Vagrantfile
Provisioner
Provider - virtualisation
VCS
Windows Developer
Mac Osx Developer
Linux Developer
ProductionStagingDeployment
tool
VagrantFile
1. vagrant add box box_name package.box2. vagrant up3. vagrant provision
Chef Solo Scripts
Visualisation of a vagrant workflow
Multi VM Environments
Accurately modeling a separate web and database server within the same development environment.
Modeling a cluster of machines, and how they behave together.
Testing a load balancer configuration, or the effects of “unplugging” a machine.
Multi VM Environments
The Future
New Vagrant ProvidersVagrant 1.1 - Released end of Feb
$ vagrant up --provider=aws
Collaboration is everything
Vagrant 1.1plugin system is completely re-written
Download Virtualbox 4.1.22http://download.virtualbox.org/virtualbox/4.1.22/
Download vagrant package or install via ruby gemshttp://downloads.vagrantup.com/tags/v1.0.5
Add 33.33.33.10 vagrantdemo.com to /etc/hosts
Get the projectgit clone http://www.github.com/jeremyquinton/vagrant_democd vagrant_demo
vagrant up --no-provision
vagrant provision
Browse to vagrantdemo.com
Demo
Questions?
• http://www.vagrantup.com
• http://www.virtualbox.org
• http://www.opscode.com/chef/
• https://github.com/jedi4ever/veewee
• https://github.com/mitchellh/vagrant
Technical resources
Image Sourceshttp://www.photosinbox.com/download/warning-sign.jpg
http://cdn.hdwallpaperspics.com/uploads/2012/12/Future_City_from_Above.jpg
http://d36cz9buwru1tt.cloudfront.net/Powered-by-Amazon-Web-Services.jpg
http://aws.amazon.com/trademark-guidelines/
http://www.canvascreekteambuilding.com/uploads/8/0/1/7/8017325/997680_orig.jpg
http://forbenefitenterprise.com/wp-content/uploads/2010/03/collaboration1.jpg
http://hd.wallpaperswide.com/thumbs/snowflake-t2.jpg
http://blog.azculinary.edu//wp-content/uploads/2010/08/Chef-Meyer_7659.jpg
http://farm7.staticflickr.com/6087/6144237169_e5f225f2d0_o.jpg
http://farm8.staticflickr.com/7078/7006904747_5c746375e9_b.jpg