How To Install hhvm on Ubuntu 18.04

In this tutorial we learn how to install hhvm on Ubuntu 18.04. hhvm is HipHop Virtual Machine, a JIT replacement for PHP - main runtime

Introduction

In this tutorial we learn how to install hhvm on Ubuntu 18.04.

What is hhvm

hhvm is:

HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP. HHVM uses a just-in-time (JIT) compilation approach to achieve superior performance while maintaining the development flexibility that PHP provides.

For the majority of your programs HHVM should be a drop-in replacement for the usual PHP interpreter/engine.

There are three methods to install hhvm on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install hhvm Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install hhvm using apt-get by running the following command:

sudo apt-get -y install hhvm

Install hhvm Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install hhvm using apt by running the following command:

sudo apt -y install hhvm

Install hhvm Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install hhvm using aptitude by running the following command:

sudo aptitude -y install hhvm

How To Uninstall hhvm on Ubuntu 18.04

To uninstall only the hhvm package we can use the following command:

sudo apt-get remove hhvm

Uninstall hhvm And Its Dependencies

To uninstall hhvm and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove hhvm

Remove hhvm Configurations and Data

To remove hhvm configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge hhvm

Remove hhvm configuration, data, and all of its dependencies

We can use the following command to remove hhvm configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge hhvm

References

Summary

In this tutorial we learn how to install hhvm package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.