1

我使用 HHVM 作为守护进程运行,配置如下:

Server {
Port = 80
SourceRoot = /var/www/
}

VirtualHost {
{
Pattern = .*
RewriteRules {
  dirindex {
    pattern = ^/(.*)/$
    to = $1/index.php
    qsa = true
  }
}
}
}

Extensions {
css = text/css
gif = image/gif
html = text/html
jpe = image/jpeg
jpeg = image/jpeg
jpg = image/jpeg
png = image/png
tif = image/tiff
tiff = image/tiff
txt = text/plain
}

我可以访问 /index.php 但不能获取/获取“未找到”。我错过了什么?

4

2 回答 2

3

你错过了 DefaultDocument,像这样更正它:

Server {
  Port = 80
  SourceRoot = /var/www/
  DefaultDocument = index.php
}
于 2013-07-20T03:37:34.673 回答
2

这对我有用:

Server {
  SourceRoot = /var/www/html/directory
  DefaultDocument = index.php
}

我删除了端口,因为我已经在启动时设置了它:

hhvm --mode daemon -vServer.Type=fastcgi -vServer.Port=9000 --config /etc/hhvm.hdf

于 2013-12-16T22:02:16.750 回答