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.
7. 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
8. 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
9. And hosts were announcing HHVM support
• WP Engine
• DreamHost
• Pagely
• SiteGround
• Kinsta
• Etc.
32. No matter where you host your site,
you can use HGV to test your code
33. 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
37. While HGV installs, make yourself a drink
It should only take about 30 minutes
38. 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/
42. Force your site to PHP 7
vagrant ssh
sudo nano -w /etc/nginx/conf.d/www-[sitename].conf
43. 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!