Installing HHVM on Ubuntu

Mascote do LinuxPro com a mão apoiada no servidor ativo do caminho verde, apontando para o caminho cinza encerrado do HHVM

Note (2026): the original text covered Ubuntu 14.04/16.04 and HHVM 3.15.2 running PHP. HHVM dropped PHP: the 3.30 series (2018) was the last compatible one; 4.0 (11 February 2019) only runs Hack. On 27 October 2023, Meta stopped publishing official releases. For WordPress, Laravel, MediaWiki, and the rest of the PHP ecosystem, the current path is PHP 8.5 + PHP-FPM + OPcache. The 2017 commands remain at the end, only as history.

In 2017, HHVM was the performance shortcut: Facebook's JIT, WordPress and Laravel faster than Ubuntu's PHP 5.6/7.0. Nine years later, Zend Engine won the game — PHP 7, then 8, proper OPcache, JIT in 8.0, and in 2026, PHP 8.5.10 (27 August) already comes with built-in OPcache. Anyone still typing apt install hhvm with PHP in mind is installing a VM for another language.

From HipHop to Hack: what HHVM was

Facebook grew tired of interpreting PHP in 2010. First came HPHPc: a PHP-to-C++ transpiler. Compiling the entire site at every deployment was slow, eval() did not exist, and the performance ceiling arrived. In 2011, Jason Evans announced the successor: HipHop Virtual Machine. Code becomes HHBC bytecode; the JIT translates it to x86-64 at runtime. In the first quarter of 2013, facebook.com abandoned HPHPc.

Along with HHVM 3.0 (March 2014) came Hack: PHP with gradual typing, without goto and without variable variables. The VM began serving two languages. In September 2018, Fred Emmott stated the obvious — PHP 7 had diverged too far. 3.30 would be the last with PHP. On 11 February 2019, 4.0 removed <?php from the map. Those who wanted fast WordPress stayed with PHP-FPM; HHVM remained for Meta's Hack (and, for a time, Slack's).

What changed since 2017

  • Ubuntu 14.04 and 16.04 ended. Current LTS releases: 24.04 (PHP 8.3 in the repositories) and 26.04 Resolute (PHP 8.5 by default).
  • PHP 8.5 shipped on 20 November 2025; the patch from 27 August 2026 is 8.5.10. OPcache stopped being an optional extension — it is in the core. JIT with a default buffer of 64 MB.
  • The repository dl.hhvm.com and the GPG key 0x5a16e7281be7a449 from this post no longer serve PHP. The later key (0xB4112585D386EB94) does not bring back an HHVM that runs Laravel either.
  • On 27 October 2023, Paul Bissonette announced: no official releases, no GCC, the code remains on GitHub for those who compile it. There is no apt package reliable for PHP production.

2026: PHP 8.5 and PHP-FPM on Ubuntu

If the goal of the 2017 post was “faster PHP on Ubuntu,” this is it today. On 26.04, PHP 8.5 is already in the official archive:

sudo apt update
sudo apt install php-cli php-fpm php-mysql php-xml php-mbstring php-curl php-zip php-gd php-intl php-bcmath
php -v
# PHP 8.5.x (cli) … with Zend OPcache v8.5.x
systemctl status php8.5-fpm --no-pager

On 24.04 LTS the archive provides 8.3. For 8.5, Ondřej Surý's PPA (the same one as always):

sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.5-cli php8.5-fpm php8.5-{mysql,xml,mbstring,curl,zip,gd,intl,bcmath}
sudo update-alternatives --set php /usr/bin/php8.5
php -v

There is no package php8.5-opcache: OPcache is part of the runtime. FPM socket: /run/php/php8.5-fpm.sock.

OPcache and JIT, what HHVM promised

The gains HHVM sold in 2016 (Kinsta, WordPress, Drupal) are delivered by PHP 8 with OPcache enabled and, for CPU workloads, with JIT. In FPM:

sudo tee /etc/php/8.5/fpm/conf.d/99-opcache.ini <<'EOF'
opcache.enable=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=32
opcache.max_accelerated_files=20000
opcache.validate_timestamps=0
opcache.jit=tracing
opcache.jit_buffer_size=64M
EOF
sudo systemctl restart php8.5-fpm
php -i | grep -E 'opcache.enable|opcache.jit'

validate_timestamps=0 in production: after deployment, restart FPM. JIT helps little with plain WordPress (database I/O); it helps in CPU-bound sections. Do not enable Xdebug in front of JIT.

Nginx in front of FPM

HHVM spoke FastCGI. So does PHP-FPM. In Nginx, fastcgi_pass points to the version's socket:

location ~ .php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php8.5-fpm.sock;
}
sudo apt install nginx
sudo nginx -t && sudo systemctl reload nginx

Those hosting multiple sites on the same Ubuntu machine can still add a control panel on top — this blog's older coverage is in ISPConfig on Debian and in the history of ISPConfig.

Still want Hack?

Then HHVM makes sense. Not for PHP. The runtime lives at facebook/hhvm (commits continue in 2026); the language at hacklang.org. A ready-made package for current Ubuntu is not the production route: Meta no longer publishes releases. Compile from git, use an old Docker image or the company's internal binary. Extension .hack, typechecker hh_client, HTTP through built-in Proxygen or FastCGI. WordPress, Laravel, and Composer are not on that list.

Historical record: what this post installed in 2017

Ubuntu 14.04/16.04, old GPG key, HHVM 3.15.2 speaking PHP 5 and part of 7. Do not run this on a new machine.

# NÃO use em 2026 — chave e série obsoletas
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
sudo add-apt-repository "deb http://dl.hhvm.com/ubuntu $(lsb_release -sc) main"
sudo apt-get update
sudo apt-get install hhvm
hhvm --version
# HipHop VM 3.15.2 (rel)

The output at the time: compiler tags/HHVM-3.15.2, repo schema 608339137764e8365964a1adaa7a27d125b6076f. The original “About HHVM” still talked about “Hack and PHP.” That phrase died in 4.0.

Wrap-up

HHVM won the argument of 2014–2017: JIT, Hack, facebook.com without HPHPc. PHP 7/8 copied the performance lesson and kept the ecosystem. In 2026, on Ubuntu, apt install php-fpm is this how-to's successor. The orange H on the cover still belongs to the VM — but the VM now speaks Hack, not the index.php of your WordPress.

The kernel underneath: Linux turns 35. A container around it, if applicable: The history of Docker.