Phabricator重写规则配置问题

5

我遇到了安装phabricator的问题。实际上,这似乎是一件简单的事情。我已经完全复制了示例代码。

apache2.conf:

<VirtualHost *>
  # Change this to the domain which points to your host.
  ServerName localhost

  # Change this to the path where you put 'phabricator' when you checked it
  # out from GitHub when following the Installation Guide.
  #
  # Make sure you include "/webroot" at the end!
  DocumentRoot /var/www/phabricator/webroot

  RewriteEngine on
  RewriteRule ^/rsrc/(.*)     -                       [L,QSA]
  RewriteRule ^/favicon.ico   -                       [L,QSA]
  RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]
</VirtualHost>


<Directory "/var/www/phabricator/webroot">
  Require all granted
</Directory>

每当我在浏览器中输入服务器IP地址时,会出现以下错误提示:
Request parameter '__path__' is not set. Your rewrite rules are not configured correctly.

我发现这是Phabricator代码的一部分:
if (!isset($_REQUEST['__path__'])) {
    self::didFatal(
        "Request parameter '__path__' is not set. Your rewrite rules ".
        "are not configured correctly.");
}

有人知道如何解决这个问题吗?

(涉及IT技术,可能是程序错误或故障)

1
我遇到了同样的问题,但是没有一个答案能够帮助我。有人可以帮忙吗? - andreybleme
2个回答

1
我也遇到了同样的问题。只需要放置


RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]

从您的apache2.conf中删除以下行。
RewriteRule ^/rsrc/(.*)     -                       [L,QSA]

RewriteRule ^/favicon.ico   -                       [L,QSA]

谢谢!在Webmin/Virtualmin服务器上,只需使用第一行就可以让它正常工作 :)文档中也有写明,但我太糊涂了没看到。 - butcarudev
我正在按照指南尝试在GoDaddy共享主机上安装此程序。我遇到了路径未设置的问题。我无法访问apache2.conf文件,我尝试将其放入.htaccess文件中,但是结果出现了500服务器错误。有什么想法吗? - Frantumn
1
我遇到了同样的问题,但是没有一个答案能够帮助我。有人可以帮忙吗? - andreybleme

1

我在使用Phab时遇到了类似的问题,并通过以下方法解决:

  1. 将Directory段放置在VirtualHost段内。
  2. 您的系统中是否运行其他虚拟服务器?如果是,请指定端口*:80(或尝试不同的端口请记得在声明VirtualHost段之前添加Listen 8081)。
  3. 最后,将Directory段的内容替换为以下内容:

    Order allow,deny
    Allow from all
    

我面临相同的问题,但是没有任何答案对我有帮助。有人可以帮忙吗? - andreybleme

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接