HHVM

Synopsis

This module facilitates installing and un installing the HHVM which is a popular build server to your machine. HipHop Virtual Machine (HHVM) is a process virtual machine based on just-in-time (JIT) compilation, serving as an execution engine for PHP and Hack programming languages. By using the principle of JIT compilation, executed PHP or Hack code is first transformed into intermediate HipHop byte code (HHBC), which is then dynamically translated into the x86-64 machine code, optimized and natively executed. Let us see about the HHVM module in upcoming topics.

Help Command

The help command guides the users regarding the purpose and as well as about the options that are included in the HHVM module. It lists out the alternative parameters of HHVM module. It also describes the syntax for installing the HHVM module. The help command for HHVM module is shown as below.

cleopatra HHVM help

The syntax for declaring the help command is not case sensitive which is an added advantage. The following screenshot visualize you about the help command under HHVM.

kevells@corp:/# cleopatra HHVM help
******************************


 This command allows you to install HHVM, the popular Build Server.

 HHVM, hhvm

       - install
       Installs HHVM through package manager
       example: cleopatra hhvm install

       - uninstall
       Uninstalls HHVM through package manager
       example: cleopatra hhvm uninstall

------------------------------
End Help
******************************

Installation

The command used for installing the HHVM to the users machine is shown below.

cleopatra HHVM install

After inputting the command above, the following process occurs as shown in the tabular format.

Parameters Alternative Parameter Options Comments
Install The Oracle Java JDK 1.7? (Y/N) Inspite of HHVM we can use hhvm also. Y(Yes) If the user wish to proceed the installation process they can input as Y.
Install The Oracle Java JDK 1.7? (Y/N) Inspite of HHVM we can use hhvm also. N(No) If the user wish to quit the installation process they can input as N.|

Finally, installation process gets completed. The following screenshot pictorially represents the process of installing HHVM.

kevells@corp:/# cleopatra HHVM install
Install HHVM? (Y/N)
Y
*******************************
*        Pharaoh Tools        *
*          ! HHVM !        *
*******************************
Creating /tmp/cleopatra-temp-script-41870275104.sh
chmod 755 /tmp/cleopatra-temp-script-41870275104.sh 2>/dev/null
Changing /tmp/cleopatra-temp-script-41870275104.sh Permissions
Executing /tmp/cleopatra-temp-script-41870275104.sh
--2015-01-16 14:19:14--  http://dl.hhvm.com/conf/hhvm.gpg.key
Resolving dl.hhvm.com (dl.hhvm.com)... 140.211.166.134
Connecting to dl.hhvm.com (dl.hhvm.com)|140.211.166.134|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1707 (1.7K) [application/pgp-keys]
Saving to: ‘STDOUT’

100%[=====================================================================================================>] 1,707       --.-K/s   in 0.001s

2015-01-16 14:19:16 (1.68 MB/s) - written to stdout [1707/1707]

OK
deb http://dl.hhvm.com/ubuntu trusty main
Get:1 http://dl.hhvm.com trusty InRelease [2,104 B]
Hit http://downloads.hipchat.com stable InRelease
Ign http://security.ubuntu.com trusty-security InRelease
Ign http://extras.ubuntu.com trusty InRelease
Ign http://in.archive.ubuntu.com trusty InRelease
Get:2 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Hit http://downloads.hipchat.com stable/main amd64 Packages
Get:3 http://dl.hhvm.com trusty/main amd64 Packages [1,669 B]
Hit http://extras.ubuntu.com trusty Release.gpg
Get:4 http://security.ubuntu.com trusty-security Release [62.0 kB]
Ign http://in.archive.ubuntu.com trusty-updates InRelease
Hit http://downloads.hipchat.com stable/main i386 Packages
Get:5 http://dl.hhvm.com trusty/main i386 Packages [20 B]
Hit http://extras.ubuntu.com trusty Release
Ign http://in.archive.ubuntu.com trusty-backports InRelease
Hit http://extras.ubuntu.com trusty/main Sources
Hit http://in.archive.ubuntu.com trusty Release.gpg
Hit http://extras.ubuntu.com trusty/main amd64 Packages
Get:6 http://security.ubuntu.com trusty-security/main Sources [63.1 kB]
Get:7 http://in.archive.ubuntu.com trusty-updates Release.gpg [933 B]
Hit http://extras.ubuntu.com trusty/main i386 Packages
Hit http://in.archive.ubuntu.com trusty-backports Release.gpg
Get:8 http://security.ubuntu.com trusty-security/restricted Sources [2,061 B]
Hit http://in.archive.ubuntu.com trusty Release
Get:9 http://security.ubuntu.com trusty-security/universe Sources [17.4 kB]
Get:10 http://in.archive.ubuntu.com trusty-updates Release [62.0 kB]
Get:11 http://security.ubuntu.com trusty-security/multiverse Sources [716 B]
Get:12 http://security.ubuntu.com trusty-security/main amd64 Packages [196 kB]
Ign http://downloads.hipchat.com stable/main Translation-en_IN
Ign http://dl.hhvm.com trusty/main Translation-en_IN
Ign http://downloads.hipchat.com stable/main Translation-en
Hit http://in.archive.ubuntu.com trusty-backports Release
Ign http://dl.hhvm.com trusty/main Translation-en
Hit http://in.archive.ubuntu.com trusty/main Sources
Get:13 http://security.ubuntu.com trusty-security/restricted amd64 Packages [8,875 B]
Get:14 http://security.ubuntu.com trusty-security/universe amd64 Packages [84.2 kB]
Hit http://in.archive.ubuntu.com trusty/restricted Sources
Hit http://in.archive.ubuntu.com trusty/universe Sources
Ign http://extras.ubuntu.com trusty/main Translation-en_IN
Hit http://in.archive.ubuntu.com trusty/multiverse Sources
Get:15 http://security.ubuntu.com trusty-security/multiverse amd64 Packages [1,166 B]
Ign http://extras.ubuntu.com trusty/main Translation-en
Get:16 http://security.ubuntu.com trusty-security/main i386 Packages [187 kB]
Hit http://in.archive.ubuntu.com trusty/main amd64 Packages
Hit http://in.archive.ubuntu.com trusty/restricted amd64 Packages
Hit http://in.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://in.archive.ubuntu.com trusty/multiverse amd64 Packages
Hit http://in.archive.ubuntu.com trusty/main i386 Packages
Hit http://in.archive.ubuntu.com trusty/restricted i386 Packages
Get:17 http://security.ubuntu.com trusty-security/restricted i386 Packages [8,846 B]
Hit http://in.archive.ubuntu.com trusty/universe i386 Packages
Get:18 http://security.ubuntu.com trusty-security/universe i386 Packages [84.2 kB]
Hit http://in.archive.ubuntu.com trusty/multiverse i386 Packages
Get:19 http://security.ubuntu.com trusty-security/multiverse i386 Packages [1,412 B]
Hit http://in.archive.ubuntu.com trusty/main Translation-en
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/multiverse Translation-en
Hit http://in.archive.ubuntu.com trusty/multiverse Translation-en
Hit http://security.ubuntu.com trusty-security/restricted Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Hit http://in.archive.ubuntu.com trusty/restricted Translation-en
Hit http://in.archive.ubuntu.com trusty/universe Translation-en
Get:20 http://in.archive.ubuntu.com trusty-updates/main Sources [155 kB]
Get:21 http://in.archive.ubuntu.com trusty-updates/restricted Sources [2,061 B]
Get:22 http://in.archive.ubuntu.com trusty-updates/universe Sources [97.6 kB]
Get:23 http://in.archive.ubuntu.com trusty-updates/multiverse Sources [3,550 B]
Get:24 http://in.archive.ubuntu.com trusty-updates/main amd64 Packages [398 kB]
Get:25 http://in.archive.ubuntu.com trusty-updates/restricted amd64 Packages [8,875 B]
Get:26 http://in.archive.ubuntu.com trusty-updates/universe amd64 Packages [239 kB]
Get:27 http://in.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [9,373 B]
Get:28 http://in.archive.ubuntu.com trusty-updates/main i386 Packages [390 kB]
Get:29 http://in.archive.ubuntu.com trusty-updates/restricted i386 Packages [8,846 B]
Get:30 http://in.archive.ubuntu.com trusty-updates/universe i386 Packages [240 kB]
Get:31 http://in.archive.ubuntu.com trusty-updates/multiverse i386 Packages [9,567 B]
Hit http://in.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://in.archive.ubuntu.com trusty-updates/multiverse Translation-en
Hit http://in.archive.ubuntu.com trusty-updates/restricted Translation-en
Hit http://in.archive.ubuntu.com trusty-updates/universe Translation-en
Hit http://in.archive.ubuntu.com trusty-backports/main Sources
Hit http://in.archive.ubuntu.com trusty-backports/restricted Sources
Hit http://in.archive.ubuntu.com trusty-backports/universe Sources
Hit http://in.archive.ubuntu.com trusty-backports/multiverse Sources
Hit http://in.archive.ubuntu.com trusty-backports/main amd64 Packages
Hit http://in.archive.ubuntu.com trusty-backports/restricted amd64 Packages
Hit http://in.archive.ubuntu.com trusty-backports/universe amd64 Packages
Hit http://in.archive.ubuntu.com trusty-backports/multiverse amd64 Packages
Hit http://in.archive.ubuntu.com trusty-backports/main i386 Packages
Hit http://in.archive.ubuntu.com trusty-backports/restricted i386 Packages
Hit http://in.archive.ubuntu.com trusty-backports/universe i386 Packages
Hit http://in.archive.ubuntu.com trusty-backports/multiverse i386 Packages
Hit http://in.archive.ubuntu.com trusty-backports/main Translation-en
Hit http://in.archive.ubuntu.com trusty-backports/multiverse Translation-en
Hit http://in.archive.ubuntu.com trusty-backports/restricted Translation-en
Hit http://in.archive.ubuntu.com trusty-backports/universe Translation-en
Ign http://in.archive.ubuntu.com trusty/main Translation-en_IN
Ign http://in.archive.ubuntu.com trusty/multiverse Translation-en_IN
Ign http://in.archive.ubuntu.com trusty/restricted Translation-en_IN
Ign http://in.archive.ubuntu.com trusty/universe Translation-en_IN
Fetched 2,347 kB in 42s (55.6 kB/s)
Reading package lists...
Temp File /tmp/cleopatra-temp-script-41870275104.sh Removed
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
 libboost-filesystem1.54.0 libboost-program-options1.54.0
 libboost-regex1.54.0 libboost-thread1.54.0 libgflags2 libgoogle-glog0
 libjemalloc1 libmemcached10 libonig2 libtbb2 libunwind8
The following NEW packages will be installed:
 hhvm libboost-filesystem1.54.0 libboost-program-options1.54.0
 libboost-regex1.54.0 libboost-thread1.54.0 libgflags2 libgoogle-glog0
 libjemalloc1 libmemcached10 libonig2 libtbb2 libunwind8
0 upgraded, 12 newly installed, 0 to remove and 228 not upgraded.
Need to get 13.8 MB of archives.
After this operation, 4,036 kB of additional disk space will be used.
Get:1 http://dl.hhvm.com/ubuntu/ trusty/main hhvm amd64 3.4.2~trusty [12.9 MB]
Get:2 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main libboost-filesystem1.54.0 amd64 1.54.0-4ubuntu3.1 [34.2 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main libboost-program-options1.54.0 amd64 1.54.0-4ubuntu3.1 [115 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main libboost-regex1.54.0 amd64 1.54.0-4ubuntu3.1 [261 kB]
Get:5 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main libboost-thread1.54.0 amd64 1.54.0-4ubuntu3.1 [26.5 kB]
Get:6 http://in.archive.ubuntu.com/ubuntu/ trusty/main libgflags2 amd64 2.0-1.1ubuntu1 [65.9 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu/ trusty/main libunwind8 amd64 1.1-2.2ubuntu3 [48.3 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu/ trusty/main libgoogle-glog0 amd64 0.3.3-1 [61.3 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu/ trusty/main libmemcached10 amd64 1.0.8-1ubuntu2 [83.4 kB]
Get:10 http://in.archive.ubuntu.com/ubuntu/ trusty/universe libjemalloc1 amd64 3.5.1-2 [76.8 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu/ trusty/universe libonig2 amd64 5.9.1-1ubuntu1 [89.1 kB]
Get:12 http://in.archive.ubuntu.com/ubuntu/ trusty/universe libtbb2 amd64 4.2~20130725-1.1ubuntu1 [94.7 kB]
Fetched 13.8 MB in 4min 15s (54.2 kB/s)
Selecting previously unselected package libboost-filesystem1.54.0:amd64.
(Reading database ... 180191 files and directories currently installed.)
Preparing to unpack .../libboost-filesystem1.54.0_1.54.0-4ubuntu3.1_amd64.deb ...
Unpacking libboost-filesystem1.54.0:amd64 (1.54.0-4ubuntu3.1) ...
Selecting previously unselected package libboost-program-options1.54.0:amd64.
Preparing to unpack .../libboost-program-options1.54.0_1.54.0-4ubuntu3.1_amd64.deb ...
Unpacking libboost-program-options1.54.0:amd64 (1.54.0-4ubuntu3.1) ...
Selecting previously unselected package libboost-regex1.54.0:amd64.
Preparing to unpack .../libboost-regex1.54.0_1.54.0-4ubuntu3.1_amd64.deb ...
Unpacking libboost-regex1.54.0:amd64 (1.54.0-4ubuntu3.1) ...
Selecting previously unselected package libboost-thread1.54.0:amd64.
Preparing to unpack .../libboost-thread1.54.0_1.54.0-4ubuntu3.1_amd64.deb ...
Unpacking libboost-thread1.54.0:amd64 (1.54.0-4ubuntu3.1) ...
Selecting previously unselected package libgflags2.
Preparing to unpack .../libgflags2_2.0-1.1ubuntu1_amd64.deb ...
Unpacking libgflags2 (2.0-1.1ubuntu1) ...
Selecting previously unselected package libunwind8.
Preparing to unpack .../libunwind8_1.1-2.2ubuntu3_amd64.deb ...
Unpacking libunwind8 (1.1-2.2ubuntu3) ...
Selecting previously unselected package libgoogle-glog0.
Preparing to unpack .../libgoogle-glog0_0.3.3-1_amd64.deb ...
Unpacking libgoogle-glog0 (0.3.3-1) ...
Selecting previously unselected package libmemcached10:amd64.
Preparing to unpack .../libmemcached10_1.0.8-1ubuntu2_amd64.deb ...
Unpacking libmemcached10:amd64 (1.0.8-1ubuntu2) ...
Selecting previously unselected package libjemalloc1.
Preparing to unpack .../libjemalloc1_3.5.1-2_amd64.deb ...
Unpacking libjemalloc1 (3.5.1-2) ...
Selecting previously unselected package libonig2.
Preparing to unpack .../libonig2_5.9.1-1ubuntu1_amd64.deb ...
Unpacking libonig2 (5.9.1-1ubuntu1) ...
Selecting previously unselected package libtbb2.
Preparing to unpack .../libtbb2_4.2~20130725-1.1ubuntu1_amd64.deb ...
Unpacking libtbb2 (4.2~20130725-1.1ubuntu1) ...
Selecting previously unselected package hhvm.
Preparing to unpack .../hhvm_3.4.2~trusty_amd64.deb ...
Unpacking hhvm (3.4.2~trusty) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Setting up libboost-filesystem1.54.0:amd64 (1.54.0-4ubuntu3.1) ...
Setting up libboost-program-options1.54.0:amd64 (1.54.0-4ubuntu3.1) ...
Setting up libboost-regex1.54.0:amd64 (1.54.0-4ubuntu3.1) ...
Setting up libboost-thread1.54.0:amd64 (1.54.0-4ubuntu3.1) ...
Setting up libgflags2 (2.0-1.1ubuntu1) ...
Setting up libunwind8 (1.1-2.2ubuntu3) ...
Setting up libgoogle-glog0 (0.3.3-1) ...
Setting up libmemcached10:amd64 (1.0.8-1ubuntu2) ...
Setting up libjemalloc1 (3.5.1-2) ...
Setting up libonig2 (5.9.1-1ubuntu1) ...
Setting up libtbb2 (4.2~20130725-1.1ubuntu1) ...
Setting up hhvm (3.4.2~trusty) ...
********************************************************************
* HHVM is installed.
*
* Running PHP web scripts with HHVM is done by having your webserver talk to HHVM
* over FastCGI. Install nginx or Apache, and then:
* $ sudo /usr/share/hhvm/install_fastcgi.sh
* $ sudo /etc/init.d/hhvm restart
* (if using nginx)  $ sudo /etc/init.d/nginx restart
* (if using apache) $ sudo /etc/init.d/apache restart
*
* Detailed FastCGI directions are online at:
* https://github.com/facebook/hhvm/wiki/FastCGI
*
* If you're using HHVM to run web scripts, you probably want it to start at boot:
* $ sudo update-rc.d hhvm defaults
*
* Running command-line scripts with HHVM requires no special setup:
* $ hhvm whatever.php
*
* You can use HHVM for /usr/bin/php even if you have php-cli installed:
* $ sudo /usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60
********************************************************************
Processing triggers for libc-bin (2.19-0ubuntu6) ...
[Pharaoh Logging] Adding Package hhvm from the Packager Apt executed correctly
... All done!
*******************************
Thanks for installing , visit www.pharaohtools.com for more
******************************


Single App Installer:
--------------------------------------------
HHVM: Success
------------------------------
Installer Finished
******************************

Un installation

The command used for un installing the hhvm is shown below.

cleopatra HHVM uninstall

Benefits

  • The parameters used in help and installation and un installation operations are not case sensitive which is an added advantage while compared to others.
  • It is well-to-do in both Ubuntu and as well as Cent OS.
  • HHVM has the ability to use live type information to produce more efficient native code, leading to higher web server throughput and lower latency.
comments powered by Disqus

Edit this document!

This file can be edited directly through the Web. Anyone can update and fix errors in this document with few clicks -- no downloads needed.

  1. Go to HHVM on GitHub.
  2. Edit files using GitHub's text editor in your web browser (see the 'Edit' tab on the top right of the file)
  3. Fill in the Commit message text box at the bottom of the page describing why you made the changes. Press the Propose file change button next to it when done.
  4. Then click Send a pull request.
  5. Your changes are now queued for review under the project's Pull requests tab on GitHub!

For an introduction to the documentation format please see the reST primer.