2014-09-03 76 views
0

蟒蛇LAMPP(Linux)的我有一個文件:此文件test.py 權限設置爲777,我試圖運行下面的腳本:運行通過Apache

#!/usr/lib/python2.7 
print("Content-Type: text/html\n") 
print("test") 

我收到以下錯誤:

The server encountered an internal error and was unable to complete your request. 

Error message: 
End of script output before headers: test.py 

If you think this is a server error, please contact the webmaster. 

Error 500 

Python的安裝:

$ python --version 
>> Python 2.7.4 

回答

0

問題解決了,你需要使用所在地點O-- f代碼第一行中的python解釋器,可通過在python解釋器中運行以下腳本(可通過在終端中鍵入python來調用)來找到該代碼:

import sys; sys.executable;