1. 程式人生 > >python apache2 Internal Server Error

python apache2 Internal Server Error

今天寫老是出現這個問題,我不太會弄web程式設計,這裡只單純記錄下我的解決方案 :

首先確認是不是和如下的程式碼一樣,關鍵的語句都要有,如果在瀏覽器中還不能執行

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
 
 
print "Content-Type: text/plain;charset=utf-8"
print
 
print "Hello World!"


1 你這個python 指令碼是不是加了執行的許可權chmod +x foo.py
2 apache2 配置檔案裡面,是否可以解析python 指令碼:

參考:
1 : http://stackoverflow.com/questions/378811/getting-python-to-work-internal-server-error
2 : http://docs.python.org/howto/webservers.html