簡體   English   中英

Python內部服務器錯誤

[英]Python Internal Server Error

我是Python Web開發的新手,我編寫了以下代碼並將其上傳到服務器的根目錄( public_html ):

import web
urls = ('/','index')
app = web.application(urls, globals())
class index:
    def GET(self):
        greeting = "Hello World"
        return greeting

app.run()

我的.htaccess文件是:

AddType text/html py
AddHandler cgi-script .py .cgi

當我打開網站時,出現以下錯誤:

Internal Server Error

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

Please contact the server administrator, webmaster@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

我的cPanel錯誤日志顯示:

[Thu Jul 30 10:44:42 2015] [error] [client 1.1.1.1] client denied by server configuration: /home/user/public_html/.htaccess
[Thu Jul 30 10:36:53 2015] [error] [client 1.1.1.1] attempt to invoke directory as script: /home/user/public_html/cgi-bin/, referer: http://example.com/

我搜索過的大多數地方都說應該給.py文件755權限。我也做了同樣的事情,此外,甚至給了.htaccess文件755權限。

可能的解決方案是什么?

我相信它與py或.htaccess文件權限都沒有問題,它的全部有關在配置部分中提供對.htaccess下文件的訪問權限。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM