0

我从文件中的以下内容开始:

<?php phpinfo();

它输出以下内容:

HHVM Version 3.12.1
...etc...

我将文件更改为:

<?hh phpinfo();

我收到服务器错误 500 响应,然后检查 /var/log/hhvm/error.log 中的 hhvm 日志:

Fatal error: /path/to/my/file.php appears to be a Hack file, but you do not appear
to be running the Hack typechecker. See the documentation at 
http://docs.hhvm.com/hack/typechecker/setup for information on getting it running.
You can also set `-d hhvm.hack.lang.look_for_typechecker=0` to disable this check
(not recommended).

错误消息中提供的文档链接将我带到假定类型检查器已安装的页面。但是,它提供了安装类型检查器的链接。单击该链接告诉我:

There are two ways to get the typechecker: automatically when you install HHVM or
by compiling it.

啊,但我确实安装了 HHVM,这就是我得到上面显示的第一个输出的方式:

HHVM Version 3.12.1
...etc...

此外,文档说明了这一点:

The typechecker client is generally installed at /usr/bin/hh_client while the
typechecker server is generally installed at /usr/bin/hh_server.

这是我在运行$ ls -la /usr/bin/hh_client /usr/bin/hh_server 时看到的

-rwxr-xr-x 1 root root 3689005 Feb 29 22:07 /usr/bin/hh_client
-rwxr-xr-x 1 root root 3876085 Feb 29 22:07 /usr/bin/hh_server

从所有迹象来看,类型检查器看起来像是已安装!

这是我在 Ubuntu 14.04 上安装它的方法:

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
sudo add-apt-repository "deb http://dl.hhvm.com/ubuntu $(lsb_release -sc) main"
sudo apt-get update
sudo apt-get install hhvm
sudo update-rc.d hhvm defaults
sudo /usr/share/hhvm/install_fastcgi.sh

在 /etc/hhvm/server.ini 里面我有这个:

;hhvm.server.port = 9000
hhvm.server.file_socket=/var/run/hhvm/hhvm.sock

我已确保在我的所有配置中都有以下内容:

fastcgi_pass unix:/var/run/hhvm/hhvm.sock;

我已经重新启动了所有服务器。

我已经在运行 Ubuntu 14.04 的两个不同系统上执行了整个过程(包括 Ubuntu 14.04 的全新最小安装),结果相同。

4

1 回答 1

4

问题是您没有为类型检查设置代码,而不是没有安装类型检查器。根据错误发送给您的文档,您需要.hhconfig在代码库的根目录下创建一个文件。

于 2016-03-17T19:47:16.337 回答