A preinstalled Vagrant box with PHP HipHop / HHVM and Ubuntu 13.10 (Saucy Salamander)
Here’s an excellent downloadable Vagrant box that’s brings you a preinstalled HHVM / HipHop for PHP within a Ubuntu 13.10 server. When you are reading this, you probably know what this is all about, but here’s a short introduction for everybody else:
Facebook is the most used website in the world. And it’s a highly active site, permanent updates, requests, interaction etc. And it’s built in PHP. Therefore the Facebook developers are using PHP at the most advanced level. To get even more out of PHP, they created a pendant to the “Java Virtual Machine” in which Java is running: HipHop (or HHVM), a virtual machine that runs COMPILED PHP code. Don’t get confused with the term “virtual machine”, as this article is about a Vagrant box, which is also a virtual machine, in this case HipHop would be a virtual machine running within a virtual machine. Sound weird, but is totally okay as Vagrant is just a dev tool, nothing for production. Anyway, running PHP within HipHop makes PHP much much faster. Some benchmarks show increases up to 600%, in most cases you will gain 100%-150% performance, so you app will run 2 – 2.5 times faster.
Please note: HipHop is built by Facebook and FOR Facebook. So its focus is on the Facebook architecture, therefore not all PHP functions are supported (as Facebook simply don’t use them, like mysql/mysqli commands, here you have to use PDO).
Vagrant box on GitHub:
https://github.com/adrienbrault/hhvm-vagrant