way of the future

45

Upload: jason-cosper

Post on 16-Jan-2017

12.150 views

Category:

Technology


0 download

TRANSCRIPT

I'm Jason CosperI work at WP Engine

I created Hipster IpsumI organize the Bakersfield WordPress MeetupI maintain the Force Strong Passwords plugin

@boogah

When I gave this talkfive months ago...

I was pushing HHVM

Hard

The numbers were compellingWordPress 4.1.x with 20 concurrent users.• Requests per second

• PHP 5.5: 256

• PHP 7: 627

• HHVM 3.7: 666

• Latency

• PHP 5.5: 78 milliseconds

• PHP 7: 32 milliseconds

• HHVM 3.7: 30 milliseconds

PHP adoption rates were depressing• PHP 5.3 — 41.4%

• Released: June 30, 2009

• End of Life: August 14, 2014

• PHP 5.4 — 30.1%

• Released: March 1, 2012

• End of Life: September 12, 2015

• PHP 5.5 — 9.3%

• Released: June 20, 2013

• End of Life: June 20, 2016

• PHP 5.6 — 1.5%

• Released: August 28, 2014

• End of Life: August 28, 2017

And hosts were announcing HHVM support

• WP Engine

• DreamHost

• Pagely

• SiteGround

• Kinsta

• Etc.

Legacy PHP bad

But I was being myopic

Don't get me wrongHHVM is still fast

But PHP is PHP

PHP 7 is PHPon steroids

Let's take a lookat some numbers

boogah.org/55vs7

PHP 5.5 vs. PHP 7• WordPress (4.3.1)

• PHP 7 was 2.6 times faster than PHP 5.5

• WordPress (4.3.1) + WooCommerce (2.4.8)

• PHP 7 was 1.4 times faster than PHP 5.5

• WordPress (4.3.1) + bbPress (2.5.8)

• PHP 7 was 6.6 times faster than PHP 5.5

• WordPress (4.3.1) + BuddyPress (2.3.4)

• PHP 7 was 4.7 times faster than PHP 5.5

All these numbers arepretty awesome

However, 67.9% of all PHP sitesare currently powered by versionsthat should be considered dead

They have ceased to be

Why should anyone give a !?

Nobody builds sites for the pastYou build them for the future

The futch

vagrantup.com

Vagrant creates & configuresvirtual development environments

This meansless yak shaving & more working

Varying Vagrant Vagrantsis the industry standardfor WordPress development

There is another

It does PHP 7 & HHVMAnd it was made for WordPress development

HGVgithub.com/wpengine/hgv

Built by WP Enginefor our Mercury platform

No matter where you host your site,you can use HGV to test your code

HGV• Built with members of the 10up team

• Work on your code under PHP 5.5, PHP 7 & HHVM at the same time

• Provision multiple sites using YML files

• Debugging & benchmarking tools

• Xdebug

• XHProf

• Siege

• query-monitor

• debug-objects

• debug-bar

Installing HGV is easyish

Prerequisites• Git

• VirtualBox or VMware

• Vagrant

• The Vagrant Ghost plugin

boogah.org/hgv-prereq

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"brew install gitbrew install caskroom/cask/brew-caskbrew cask install vagrantbrew cask install virtualboxvagrant plugin install vagrant-ghost

Installcd ~mkdir vagrantcd vagrantgit clone --recursive https://github.com/wpengine/hgv.gitcd hgvvagrant up

While HGV installs, make yourself a drinkIt should only take about 30 minutes

Get to work• Local file access

• Use your favorite text editor!

• [HGV_dir]/hgv_data/sites/[sitename]/

• [HGV_dir]/hgv_data/sites/[sitename]/wp-content/[plugins|themes]/

• SSH

• vagrant ssh

• phpMyAdmin

• admin.hgv.test/phpmyadmin/

Just import your siteand see what breaks

PHP 7 & WordPressboogah.org/php7wp

Switching your environment

is a piece of cake

Force your site to PHP 7vagrant sshsudo nano -w /etc/nginx/conf.d/www-[sitename].conf

Force your site to PHP 7Change this:

cache.php.example.test php;php.example.test php;

To this:

cache.php.example.test php7;php.example.test php7;

Save your changes!

Force your site to PHP 7service nginx restart

Questions?