Chapter 8. Configuring and Deploying HHVM
At the language level, HHVM is meant to be a drop-in replacement for the standard PHP interpreter. When running scripts from the command line, this promise generally holds. However, the way you configure and deploy it to serve web apps is different, not least because of its just-in-time (JIT) compiler.
In this chapter, you’ll learn the basics of setting up HHVM to serve web traffic. Of course, many details will depend on your specific application and infrastructure, so this chapter can’t be a complete guide. The aim is to give you a good enough understanding of HHVM that you can figure out how to integrate it with your setup.
This chapter doesn’t cover setting up the Hack typechecker, which is only used during development. For that, see Chapter 1.
Specifying Configuration Options
HHVM has a vast set of configuration options—far too many to cover them all in detail in this book. Many of them aren’t meant for end users anyway; they’re for people hacking on HHVM itself. In this section, we’ll cover how to set configuration options, and what the most important ones are.
HHVM uses configuration files in INI format, which is the same format that the standard PHP interpreter uses. You can specify a configuration file with the -c
flag:
$ hhvm -c config.ini file.php
INI format is very straightforward. Each option consists of a key/value pair. Each pair is on its own line in an INI file, with the key and value separated by an equals sign (whitespace ...
Get Hack and HHVM now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.