我想在我的sourceforge資源庫中託管一個示例程序test.py。我從目錄/home/project-web/motiur/cgi-bin/
上傳了我的文件,然後去了motiur.sourceforge.net/cgi-bin/test.py
。不幸的是,我得到了一個錯誤,表明標題提前結束。在sourceforge中設置python
test.py的源代碼:
#!/usr/local/bin/python
import cgi, cgitb
print "Content-type:text/html\n"
print "<html><body>This is another test</body></html>"
確切的錯誤是:
An error has been encountered in accessing this page.
1. Server: motiur.sourceforge.net
2. URL path: /cgi-bin/test.py
3. Error notes: Premature end of script headers: test.py
4. Error type: 500
5. Request method: GET
6. Request query string:
7. Time: 2013-01-12 14:49:39 UTC (1358002179)
順便說一句,我使用FileZilla的窗口和已設置文件權限爲755,即每個人都可以執行該文件。這是一個noob問題,一點幫助將不勝感激。謝謝。
什麼是確切的錯誤? – yannis
@YannisRizos:錯誤在於;訪問此頁面時遇到錯誤。 1.服務器:motiur.sourceforge.net 2. URL路徑:/cgi-bin/test.py 3.錯誤筆記:腳本頭過早結束:test.py 4.錯誤類型:500 5。請求方法:GET 6.請求查詢字符串: 7.時間:2013-01-12 14:49:39 UTC(1358002179) – motiur
@YannisRizos:任何建議..? – motiur