Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Way of the Future

15,603 views

Published on

With the performance gains promised by HHVM and PHP 7, WordPress site admins are living in pretty exciting times. The PHP world at large is in a proverbial space race, and every WordPress site will (eventually) benefit. But early adopters and folks who manage their own servers shouldn’t be the only ones who get early access to these face melting bumps in speed. In this talk, I’ll be introducing you to things you can do to get your code ready for these next generation hosting environments. And we’ll cover where you can host your code once it’s ready. If you’re interested in attending this talk, a passing familiarity with the command line helps, but isn’t a hard requirement.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Way of the Future

  1. 1. I'm Jason Cosper I work at WP Engine
  2. 2. I created Hipster Ipsum I organize the Bakersfield WordPress Meetup I maintain the Force Strong Passwords plugin
  3. 3. @boogah
  4. 4. When I gave this talk five months ago...
  5. 5. I was pushing HHVM Hard
  6. 6. The numbers were compelling WordPress 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
  7. 7. 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
  8. 8. And hosts were announcing HHVM support • WP Engine • DreamHost • Pagely • SiteGround • Kinsta • Etc.
  9. 9. Legacy PHP bad
  10. 10. But I was being myopic
  11. 11. Don't get me wrong HHVM is still fast
  12. 12. But PHP is PHP
  13. 13. PHP 7 is PHP on steroids
  14. 14. Let's take a look at some numbers boogah.org/55vs7
  15. 15. 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
  16. 16. All these numbers are pretty awesome
  17. 17. However, 67.9% of all PHP sites are currently powered by versions that should be considered dead
  18. 18. They have ceased to be
  19. 19. Why should anyone give a !?
  20. 20. Nobody builds sites for the past You build them for the future
  21. 21. The futch
  22. 22. vagrantup.com
  23. 23. Vagrant creates & configures virtual development environments
  24. 24. This means less yak shaving & more working
  25. 25. Varying Vagrant Vagrants is the industry standard for WordPress development
  26. 26. There is another
  27. 27. It does PHP 7 & HHVM And it was made for WordPress development
  28. 28. HGVgithub.com/wpengine/hgv
  29. 29. Built by WP Engine for our Mercury platform
  30. 30. No matter where you host your site, you can use HGV to test your code
  31. 31. 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
  32. 32. Installing HGV is easyish
  33. 33. 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 git brew install caskroom/cask/brew-cask brew cask install vagrant brew cask install virtualbox vagrant plugin install vagrant-ghost
  34. 34. Install cd ~ mkdir vagrant cd vagrant git clone --recursive https://github.com/wpengine/hgv.git cd hgv vagrant up
  35. 35. While HGV installs, make yourself a drink It should only take about 30 minutes
  36. 36. 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/
  37. 37. Just import your site and see what breaks
  38. 38. PHP 7 & WordPress boogah.org/php7wp
  39. 39. Switching your environment is a piece of cake
  40. 40. Force your site to PHP 7 vagrant ssh sudo nano -w /etc/nginx/conf.d/www-[sitename].conf
  41. 41. Force your site to PHP 7 Change this: cache.php.example.test php; php.example.test php; To this: cache.php.example.test php7; php.example.test php7; Save your changes!
  42. 42. Force your site to PHP 7 service nginx restart
  43. 43. Questions?

×