phpservercommand-line-interfacehhvmhacklang

How to start HHVM CLI Server


HHVM 3.19 has added something called CLI server mode: https://hhvm.com/blog/2017/04/13/hhvm-3-19.html

The idea of the CLI server is that some caches can be shared and that the startup costs of HHVM can be avoided. The documentation has no information about how to run it unfortunately: https://docs.hhvm.com/hhvm/advanced-usage/CLI-server

The actual code for the CLI-server can be found here: https://github.com/facebook/hhvm/blob/master/hphp/runtime/server/cli-server.cpp

But I see no callable endpoints and I can't find any other documentation about it online. So... who's got an example of how to call it?


Solution

  • You can see a list of ini options related with CLI-Server in the following

    https://docs.hhvm.com/hhvm/configuration/INI-settings#cli-server

    According this information, you have to use the option hhvm.use_remote_unix_server in order to start CLI Server. Below is an example:

    hhvm --mode server -d hhvm.server.type=fastcgi -d hhvm.server.port=9000 -d hhvm.use_remote_unix_server=yes -d hhvm.unix_server_path=/tmp/sock2

    I use Nginx - fastcgi to use HHVM, when I run localhost/info.php I get the following information:

    phpinfo hhvm

    I have to say that I haven't tested any CLI Server functionality, I have just tested the start options and I should do some research, But I hope this information can helps.

    Best Regards Javi