如何在Fedora17上将FCGI与Python(和Django)结合使用?
我在访问我的“index.fcgi”时遇到问题;我一直收到500个内部服务器错误。 这是我的错误日志:如何在Fedora17上将FCGI与Python(和Django)结合使用?,python,apache,fedora,fastcgi,Python,Apache,Fedora,Fastcgi,我在访问我的“index.fcgi”时遇到问题;我一直收到500个内部服务器错误。 这是我的错误日志: [Thu Aug 09 19:40:17 2012] [warn] [client 127.0.0.1] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server [Thu Aug 09 19:40:17 2012] [error] [client 127.0.0.1] Premature
[Thu Aug 09 19:40:17 2012] [warn] [client 127.0.0.1] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Thu Aug 09 19:40:17 2012] [error] [client 127.0.0.1] Premature end of script headers: index.fcgi
以下是我的.htaccess文件中的内容:
Options +ExecCGI
Options +Indexes
AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.fcgi/ [QSA,L]
这是我的index.fcgi:
#!/usr/bin/python2.7
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
print "Content-type: text/html\n\n"
print
print "<html>"
print "<body>"
print "<b>test</b>"
print "</body>"
print "</html>"
#/usr/bin/python2.7
从django.core.servers.fastcgi导入runfastcgi
runfastcgi(method=“threaded”,daemonize=“false”)
打印“内容类型:text/html\n\n”
打印
打印“”
打印“”
打印“测试”
打印“”
打印“”
我甚至删除了django导入和runfastcgi组件,但仍然无法看到我的页面
为什么这会发生在我身上?我确实安装了mod_python、mod_wsgi、mod_fcgid、mod_fcgi,但似乎没有任何东西能让它运行…有一种方法可以解决这个问题:将cd放到index.fcgi所在的目录,然后运行
/index.fcgi
-这将为您提供确切的错误