Introduction to HHVM | Features and How to install in Ubuntu

0
274
Introduction to HHVM | Features and How to install in Ubuntu
Introduction to HHVM | Features and How to install in Ubuntu

Intense Feed : A Small introduction about HHVM, Features and how to install in Ubuntu 13.0 VPS. the guide help you to know more about HHVM, Read carefully.

What is HHVM ?

HHVM (HipHop Virtual Machine) is a Process virtual machine based on Just-In-Time (JIT) converts PHP code into a high-level bytecode (commonly known as an intermediate language). This bytecode is then translated into x64 machine code dynamically at runtime by a just-in-time (JIT) compiler. In these respects, HHVM has similarities to virtual machines for other languages including C#/CLR and Java/JVM.

HHVM is developed by Facebook, with the projects source code hosted on GitHub and licensed under the terms of PHP License and Zend License.

History behind HHVM :

In early 2008 Facebook began working on HipHop (now HPHP), a PHP execution engine; its original motivation was to convert Facebook massive PHP code base into C++ in order to save resources and increase the application performance. The original release was known as HPHPc a PHP to C++ compiler.

For next 2 years Facebook continued working on HipHop adding HPHPi ( a developer mode version of HPHP) and HipHop debugger known as HPHPd, this allowed developers to watch and step through the code and interactively debug PHP applications running on the HipHop platform.

HHVM supports Hack, PHP 5 and the major features of PHP 7. We are aware of minor incompatibilities, so please open issues when you find them. HHVM also supports many extensions as well.

  • The Hack Language
  • JIT Compilation
  • HNI
  • Proxygen and FastCGI support
  • hphpd debugger
  • …. and more

You can learn full about HHVM at HHVM.com official site.

Installation process :

HHVM is officially supported on most major linux platforms. There is experimental, hope-to-be official support on Mac OS X 10.10. And work is being done to support HHVM on Windows.

The easiest way to get going with HHVM is to use one of supported prebuilt packages. Currently prebuilt packages are available for:

  • Ubuntu 15.10 (Wily Werewolf)
  • Ubuntu 15.04 (Vivid)
  • Ubuntu 14.04 (Trusty)
  • Debian 8 (Jessie)
  • Debian 7 (Wheezy)

Test HHVM

After installing HHVM, change to the directory where your code lives, and start-up HHVM:

hhvm -m server -p 8080

-m represents the mode and here indicates that HHVM is running in HTTP server mode.

p configures the TCP port that HHVM uses to listen to HTTP requests. The default port is 80, the standard HTTP port. However, that port requires root access, so for this example, we will use port 8080.

Once you have HHVM running, write a simple Hello World program named hello.php:

<?hh
echo "Hello World!";

Save this hello.php in the same directory that you ran the hhvm command from above. Then, load http://localhost:8080/hello.php in your browser and verify you see Hello World! appear.

Configure HHVM

The out-of-the-box HHVM configuration wont need tweaking by most new users. Notably, the JIT compiler that gives HHVM its speed is on by default. If you want to take a look at the configuration used, its at /etc/hhvm/php.ini.

Running HHVM automatically at boot as a service (instead of just on the command line as above) unfortunately does require some configuration. See the proxygen documentation for details.

Source : www.hhvm.com

So abovr was the introduction with HHVM, features, how to install, get started and test HHVM. I hope you like the article very much. For any problem in HHVM go to official site. You will find a lot of articles related to HHVM there.

LEAVE A REPLY

Please enter your comment!
Please enter your name here