XAMPP Mercurial installation on Windows Apache --> HgWebDir.cgi Script Error

吃可爱长大的小学妹 提交于 2019-12-22 00:31:51

问题


I try to publish multiple existing mercurial repository-locations though XAMPP Apache via CGI Python script hgwebdir.cgi ... as in this tutorial https://www.mercurial-scm.org/wiki/HgWebDirStepByStep

I get the following error from the apache error logs, when I try to access the repository path with a browser:

Premature end of script headers: 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

This is the path of the file where the script fails (and if I remove it, I get an empty HTML page shown with no visual elements in it):

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

Does anybody have a clue for me?


回答1:


this is just a wild ass guess but I suspect the line endings in your ini file may be messed up. You may want to try opening your ini file in something like VIM and see if there's any funky characters in there. It sucks that in 2010 we still have to consider these things, but it is what it is./shrug




回答2:


Okay, after all it was just a whole lot of directory-location-problems and a big version-problem (needed to use Python 2.6 with Mercurial 1.5.1). Got it working now. If I happen to write a full windows-guide, I'll add a comment.




回答3:


I've just been having the same compatibility versions issue. Tried with Mercurial 1.8 and Python 2.7, it didn't work.

Finally, I had to use Python 2.6.6. this time worked very well :).



来源:https://stackoverflow.com/questions/2675764/xampp-mercurial-installation-on-windows-apache-hgwebdir-cgi-script-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!