【问题标题】:XAMPP Mercurial installation on Windows Apache --> HgWebDir.cgi Script ErrorWindows Apache 上的 XAMPP Mercurial 安装 --> HgWebDir.cgi 脚本错误
【发布时间】:2011-02-10 04:06:44
【问题描述】:

我尝试通过 XAMPP Apache 通过 CGI Python 脚本 hgwebdir.cgi 发布多个现有的 mercurial 存储库位置...如本教程中的https://www.mercurial-scm.org/wiki/HgWebDirStepByStep

当我尝试使用浏览器访问存储库路径时,我从 apache 错误日志中收到以下错误:

脚本头提前结束:hgwebdir.cgi

[Tue Apr 20 16:00:50 2010] [error] [client 91.67.44.216] Premature end of script headers: hgwebdir.cgi
[Tue Apr 20 16:00:50 2010] [error] [client 91.67.44.216]   File "C:/hostdir/xampp/cgi-bin/hg/hgwebdir.cgi", line 39\r
[Tue Apr 20 16:00:50 2010] [error] [client 91.67.44.216]     test = c:/hostdir/mercurial/test/\r
[Tue Apr 20 16:00:50 2010] [error] [client 91.67.44.216]             ^\r
[Tue Apr 20 16:00:50 2010] [error] [client 91.67.44.216] SyntaxError: invalid syntax\r

这是脚本失败的文件路径(如果我删除它,我会得到一个空的 HTML 页面,其中没有可视元素):

[paths]
test = c:/hostdir/mercurial/test/
/hg = c:/hostdir/mercurial/**
/ = c:/hostdir/mercurial/

有人知道吗?

【问题讨论】:

    标签: windows apache mercurial cgi xampp


    【解决方案1】:

    我刚刚遇到了同样的兼容性版本问题。用 Mercurial 1.8 和 Python 2.7 试过,没用。

    最后,我不得不使用 Python 2.6.6。这次效果很好:)。

    【讨论】:

      【解决方案2】:

      好吧,毕竟这只是一大堆目录位置问题和一个大版本问题(需要将 Python 2.6 与 Mercurial 1.5.1 一起使用)。现在可以工作了。如果我碰巧写了一个完整的 windows 指南,我会添加评论。

      【讨论】:

        【解决方案3】:

        这只是一个疯狂的猜测,但我怀疑您的 ini 文件中的行尾可能搞砸了。您可能想尝试在 VIM 之类的文件中打开您的 ini 文件,看看里面是否有任何时髦的字符。糟透了,2010年我们还要考虑这些事情,但事实就是如此。/耸耸肩

        【讨论】:

        • 我对此进行了测试,但事实并非如此。上面的错误仍然显示在 HTTP-Responses 中,但是错误日志现在给了我一个“幻数代码错误”,让我认为 mercurial 和 python 的版本不匹配。但似乎没有哪些版本兼容的列表。在这里发布了一个关于此的问题:stackoverflow.com/questions/2680802/… 我真的认为有人应该制作一个关于如何在 Windows XAMPP 上安装 hgwebdir 的完整教程,因为我敢打赌有很多人在寻找这个解决方案。无论如何谢谢!
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-03-20
        • 2014-02-09
        • 2021-01-03
        • 2013-09-17
        • 2017-01-11
        • 1970-01-01
        • 2012-01-13
        相关资源
        最近更新 更多