• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Debian

Installing HHVM and Nginx/Apache on Ubuntu/Debian/Mint

How VPS by How VPS
November 1, 2019
in Debian
0
0
SHARES
31
VIEWS
Share on FacebookShare on Twitter

Contents

  1. A Word of Warning
  2. Supported Distributions
  3. Requirements
  4. Installing HHVM
    1. Ubuntu
    2. Debian
    3. Mint
  5. Configuring with Apache/Nginx
  6. Testing HHVM
  7. Want to contribute?


HHVM, or the HipHop Virtual Machine, is a virtual machine for PHP developed by Facebook to improve the performance of PHP applications. Unlike the regular PHP runtime, HHVM uses a just-in-time compiler to convert scripts into native machine code. As a result, third-party benchmarks have shown as much as a 3x load time reduction over PHP-FPM 5.4 for tasks like loading a regular Drupal website.

A Word of Warning

While very fast, HHVM is also still under development and may not run some software properly, or may not support some necessary extensions. Proceed with caution. For a list of supported, integrated PHP extensions, follow this link.

Supported Distributions

  • Ubuntu
    • 10.04 (lucid)
    • 12.04 (precise)
    • 14.04 (trusty)
  • Debian
    • 8 (jessie)
    • 7 (wheezy)
  • Mint
    • 16 (petra)

These are the distributions that Facebook and the HHVM maintainers will support, and the distributions that are still actively maintained for servers. While it is possible to install HHVM on an Ubuntu 14.10 server, doing so is not supported (at the time of writing) by HHVM and may result in bad things happening.

Requirements

  1. One of the distributions above.
  2. Root access for configuration installing packages.

Installing HHVM

Installing HHVM itself is quick and painless, involving not much more than configuring repositories and installing.

Ubuntu

For lucid (10.04) and precise (12.04) users only: Both versions of Ubuntu require the addition of repositories. To streamline the process, we need to make sure that the add-apt-repository command is ready. If you are not using lucid or precise, skip over this set of commands. Otherwise:

sudo apt-get update
sudo apt-get install python-software-properties

For lucid (10.04) users only: HHVM has a few more dependencies that are not included in the base system or repositories.

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.8 g++-4.8 gcc-4.8-base

For precise (12.04) users only: You’ll also need to add a repository to obtain libraries needed to run HHVM.

sudo add-apt-repository ppa:mapnik/boost

HHVM also requires installing a GPG key for its repository.

wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -

Once that’s done, we can add HHVM’s repository to a sources.list file.

echo deb http://dl.hhvm.com/ubuntu DISTRIBUTION_VERSION main | sudo tee /etc/apt/sources.list.d/hhvm.list

Make sure to replace DISTRIBUTION_VERSION with your Ubuntu version’s codename: lucid, precise, or trusty.

Now we can install.

sudo apt-get update
sudo apt-get install hhvm

And we’re done!

Debian

HHVM installation on Debian is similar to Ubuntu, but less fragmented across distributions. You’ll only need one set of commands for jessie or wheezy.

wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
echo deb http://dl.hhvm.com/debian DISTRIBUTION_VERSION main | sudo tee /etc/apt/sources.list.d/hhvm.list
sudo apt-get update
sudo apt-get install hhvm

Make sure to replace DISTRIBUTION_VERSION on the second line with your Debian version’s codename, jessie or wheezy. HHVM should now be installed.

Mint

Mint installation is also very similar to Debian in that it’s simplified.

wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
echo deb http://dl.hhvm.com/mint petra main | sudo tee /etc/apt/sources.list.d/hhvm.list
sudo apt-get update
sudo apt-get install hhvm

Since petra is the only supported Mint distribution at the moment, that’s it!

Configuring with Apache/Nginx

With HHVM comes a nifty configuration script that automatically sets up a CGI handler for either server.

If you are using Nginx, make sure to edit your server’s configuration file (by default /etc/nginx/sites-available/default) to disable FastCGI processing. Look for a section like the following and make sure it either does not exist or is entirely commented out (by adding # to the beginning of each line in the section):

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ /.php$ {
#       fastcgi_split_path_info ^(.+/.php)(/.+)$;
#       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
#       # With php5-cgi alone:
#       fastcgi_pass 127.0.0.1:9000;
#       # With php5-fpm:
#       fastcgi_pass unix:/var/run/php5-fpm.sock;
#       fastcgi_index index.php;
#       include fastcgi_params;
#}

If you are using Apache, there’s nothing specific for you to do.

After that, simply run the following script.

sudo /usr/share/hhvm/install_fastcgi.sh

Testing HHVM

Apache or Nginx should automatically be configured and restarted, and HHVM should now be running on your server. To test it, you can either make a file like this:

<?php phpinfo();

And look for “HipHop” or “HHVM,” or you can run a script like this:

<?php if(defined('HHVM_VERSION')) { echo 'HHVM works!'; }

If “HHVM works!” appears, then you’re all set!

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How to Install Automad CMS on Debian 9

Next Post

Installing Fork CMS on Debian 9

Next Post

Installing Fork CMS on Debian 9

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet