Windows Apache上的XAMPP Mercurial安装 - > HgWebDir.cgi脚本错误

时间:2010-04-20 14:08:17

标签: windows apache mercurial cgi xampp

我尝试通过CGI Python脚本hgwebdir.cgi发布多个现有的mercurial存储库位置,通过XAMPP Apache ...如本教程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/

有人对我有任何线索吗?

3 个答案:

答案 0 :(得分:0)

这只是一个疯狂的屁股猜测,但我怀疑你的ini文件中的行结尾可能搞砸了。您可能想尝试打开像VIM这样的ini文件,看看那里是否有任何时髦的角色。这很糟糕,在2010年我们仍然需要考虑这些事情,但事实就是如此./shrug

答案 1 :(得分:0)

好的,毕竟它只是一大堆目录位置问题和一个大版本问题(需要使用Mercurial 1.5.1的Python 2.6)。现在就搞定了。如果我碰巧写了一个完整的Windows指南,我会添加一个评论。

答案 2 :(得分:0)

我刚刚遇到了相同的兼容版本问题。尝试使用Mercurial 1.8和Python 2.7,它没有用。

最后,我不得不使用Python 2.6.6。这次工作得非常好:)。