Pages

Tuesday, March 25, 2014

Installation and Configuration

General Installation Considerations 

Before starting the installation, first you need to know what do you want to use HHVM for. There are two main fields you can use HHVM, as described in the What can HHVM do? section:
  • Websites and web applications (server-side scripting)
  • Command line scripting
For the first and most common form, you need three things: HHVM itself, a web server and a web browser. You probably already have a web browser, and depending on your operating system setup, you may also have a web server (e.g. Apache on Linux and MacOS X). You may also rent webspace at a company that supports HHVM (like Heroku). This way, you don't need to set up anything on your own, only write your HHVM scripts, upload it to the server you rent, and see the results in your browser.
In case of setting up the server and HHVM on your own, you have two choices for the method of connecting HHVM to the server. For many servers, HHVM has a direct module interface (also called SAPI). These servers include Apache. If HHVM has no module support for your web server, you can always use it as FastCGI processor. This means you set up your server to use the FastCGI executable of HHVM to process all HHVM file requests on the server.
If you are also interested to use HHVM for command line scripting (e.g. write scripts autogenerating some images for you offline, or processing text files depending on some arguments you pass to them), you always need the command line executable. For more information, read the section about writing command line HHVM applications. In this case, you need no server and no browser.
From now on, this section deals with setting up HHVM for web servers on Linux with server module interfaces and CGI executables. You will also find information on the command line executable in the following sections.

No comments:

Post a Comment