humanmade/Salty-WordPress — pull request #68 by joehoyle (2013-12-18 14:43:12+00:00)
Title: Added HHVM (experimental)

As some may have heard, HHVM just announced support for FastCGI (http://www.hhvm.com/blog/1817/fastercgi-with-hhvm), this makes it a lot easier to run with something like WordPress, as you can use the exact same Nginx configuration and then proxy_pass requests to PHP files to the hhvm-fastcgi daemon.

Why would you want to do this? Anybodies guess, I wanted to try out the new toys, and see what the performance improvement over PHP-FPM was. For anyeone wondering, so far I havn't managed to make it perform faster than PHP-FPM (unlike what the article above seems to say). I assume this is because typically a WordPress page load is 80% DB / Network IO where something like HHVM is not going to make a difference.

To actually try this out, you still need to do a few things after highstating. Firstly, PHP-FPM will be running on port `9000` - rather than running much HHVM and FPM side-by-side it's easier to just stop FPM so you can't have to make any alterations to the Nginx conf:

```
sudo service php5-fpm stop
```

Now you are free to start `hhvm-fastcgi`, however - with the current config, `hhvm` needs to be started in the dir you want to run the site from, as Nginx is not currently passing the path to different web roots. For example, to run hhvm on the base wordpress trunk install:

```
cd /srv/www/wordpress.dev
hhvm --mode daemon -vServer.Type=fastcgi -vServer.Port=9000
```

All requests to the hhvm will now be serving WordPress.