apache + hhvm fastcgi



我正在尝试将我的项目从 Apache 2.2 迁移到 Apache 2 + HHVM,并将 Apache 作为反向代理。

在迁移之前,我有这个 apache 配置(制作漂亮的 url):

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(server-status)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)$ index.php/$1 [L]

所以门户网址是这样的:examples.com/post/post-title-as-slug

现在我有 apache 的配置:

<IfModule mod_fastcgi.c>
<FilesMatch .php$>
    SetHandler hhvm-php-extension
</FilesMatch>
<FilesMatch .hh$>
    SetHandler hhvm-hack-extension
</FilesMatch>
Alias /ec /ec
Action hhvm-php-extension /ec virtual
Action hhvm-hack-extension /ec virtual
FastCgiExternalServer /ec -host 127.0.0.1:9000 -pass-header Authorization -idle-timeout 300
</IfModule>

而这个hhvm配置(服务器.ini):

hhvm.server.port = 9000
hhvm.server.type = fastcgi
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = /var/log/hhvm/error.log
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
hhvm.server.source_root = /w3/dr/

仅当我设置如下网址时,此配置才有效: examples.com/index.php/post/post-title-as-slug 但如果网址像: examples.com/post/post-title-as-slug 我收到 404 http 错误。

我想从网址中删除索引.php。

有人知道解决方案吗?

谢谢。

根据Facebook HHVM问题#3472,如果您使用任何mod_rewrite规则,则必须在hhvm配置中设置hhvm.server.fix_path_info = true

最新更新