Scroll to navigation

HHVM(1) General Commands Manual HHVM(1)

NAME

hhvm - Execute PHP and Hack files

SYNOPSIS

hhvm [OPTIONS] [-f] file [[--]args...]
hhvm --php [PHP-OPTIONS] [-f] file [[--]args...]

DESCRIPTION

hhvm(1) (aka the HipHop Virtual Machine) is an open-source virtual machine designed for executing programs written in Hack and PHP. HHVM uses a just-in-time compilation approach to run programs. HHVM should be used standalone for command line (CLI) scripts or together with a FastCGI-based web server like nginx or apache to serve websites.

This is the command line interface to HHVM.

The simplest way to parse and execute a program is providing a single parameter of a filename. Specifying -f before the filename does this in a more explicit fashion, and allows other OPTIONS to follow.

HHVM has its own set of OPTIONS , but also has the ability to behave like PHP 5.x as well. When the --php flag is specified to hhvm(1) (or the binary is named php ), options available to PHP 5.x can be used.

You may use:

sudo /usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60

to force hhvm(1) to be used even if PHP 5.x is installed on the system.

FILES

These are the default configuration files for HHVM. Right now both .ini and .hdf are supported as HHVM continues to migrate completely to .ini

php.ini

The default ini settings for hhvm(1) are found in /etc/hhvm/php.ini

config.hdf

The default hdf options for hhvm(1) are found in /etc/hhvm/config.hdf

OPTIONS

These are the options you can specify to the hhvm(1) executable.

Shortcut for the --mode debug command line option.

Start admin listener at a specified port. The default value for PORT is -1.

Other arguments.

Unique identifier to compiled server code.

-c , --config FILE
Load specified config (.hdf or .ini) FILE. Use multiple -c to specify multiple config files.

Display the git hash for the compiler.

How many times to repeat execution. The default value for NUM is 1.

-d , --define SETTING
Define an ini setting in the same format ( foo[=bar] ) as provided in a .ini file.

In --mode debug , this executes the debugger command specified by ARG and returns its output in stdout. Multiple --debug-cmd can be specified to execute more than one command.

In --mode debug , load the specified debugger configuration FILE.

In --mode debug , ARG specifies which debugger extension PHP file to load.

In --mode debug , connect to the debugger server at specified PORT.

In --mode debug , initial sandbox to attach to when the debugger is started. The default for ARG is "default".

An extra-header to add to the front of each line of logging.

In --mode run , execute the specified FILE .

In --mode debug , connect to debugger server at specified address. The default for ADDRESS is localhost.

Display the list of command line options with short descriptions.

Unique identifier of server instance.

Run lint on the specified FILE.

MODE can be any of the following values:
run (default): directly executes the program from the command line.
debug (d): starts the debugger.
server (s): starts an HTTP server from command line.
daemon: starts an HTTP server and runs it as a daemon.
replay: replays a previously recorded HTTP request file.
translate (t): translates a hex-encoded stacktrace.

Do not use the default php.ini

Whether to allow any file or directory access without security checking. The default value is 0 (or false).

Start an HTTP server at the specified port. The default PORT is -1.

Emulate the standard php(1) command line. You can specify the options allowed in PHP 5.x.

Use the specified FD for HTTP instead of creating a socket. The default value is -1.

Use the specified FD for SSL instead of creating a socket. The default value is -1.

Display the repository schema id.

FILE specified is temporary and removed after execution.

Run server under the specified USER account.

-v , --config-value SETTING
Individual configuration string in HDF format (name=value), where name can be any valid configuration for a config file. e.g., Section.Name=Value.

Display the hhvm(1) version number.

-w , --show FILE
Directly output the specified FILE and do nothing else.

Set the XHProf run flags.

PHP-OPTIONS

These are the options you can specify to the hhvm(1) executable when explicitly specifying the --php flag, or when the binary is named php . All PHP 5.x options are not supported at this point in time; we are planning to continue to add more option support.

Similar to the same option when not specifying --php . Run HHVM interactively. This lets you enter snippets of PHP code that directly get executed.

Use the specified FILE for configuration options. The file should be .ini format.

Define INI entry specified by SETTING of the form foo=[bar] .

Do not use any configuration (e.g., .ini) file when executing.

Run HHVM code without using script tags, directly on the command line.

Output the current HHVM build version number.

Output source with stripped comments and whitespace.

Load a dynamic extension file.

EXAMPLES

Execute a PHP file.

Execute a PHP file given a certain configuration.

Execute code from the command line using the --php option and -r.

Execute HHVM in server mode using a specified port.

BUGS

The list of current known HHVM issues are found at: https://github.com/facebook/hhvm/issues

AUTHORS

The contributors to HHVM can be found here: https://github.com/facebook/hhvm/graphs/contributors

VERSION INFORMATION

This manpage describes hhvm(1) , version 3.0 and greater

COPYRIGHT

HHVM is licensed under the PHP and Zend licenses except as otherwise noted. The full license can be found at: https://github.com/facebook/hhvm

SEE ALSO

hphpize(1)
http://docs.hhvm.com