Django, apache, mod_wsgi - Error: Premature end of script headers

▼魔方 西西 提交于 2019-12-03 11:12:16

The daemon process crashed. See comments in the mod_wsgi FAQ about what causes crashes:

http://code.google.com/p/modwsgi/wiki/FrequentlyAskedQuestions

and follow links there.

Ultimately the cause can be many things, including loading incompatible mod_python at same time, using Python C extension module that doesn't work with sub interpreters, incompatible shared library versions used by Apache and/or extension modules in PHP etc.

Finally, I found the solution. It's a problem of Multiple Python Versions: http://code.google.com/p/modwsgi/wiki/InstallationIssues#Multiple_Python_Versions.

Thanks all! :P

I had a similar problem on django,apache2,mod_wsgi,python2.6 installed on a virtual machine. I solved the problem incerasing the ram assigned to the virtual machine.

I hope this will help.

Stan

Try to delete this

WSGISocketPrefix /tmp/wsgi

And this

WSGIDaemonProcess mysite processes=5 threads=25
WSGIProcessGroup mysite

On my server it works.

I am getting this same error, and while the underlying cause may be the multiple python versions, I have found that it is happening because of hung queries from Django to my MySQL server. If I run a

show processlist;

at the MySQL prompt, I see that queries are backing up in the queue. If I kill the query at the top, all other open processes immediately complete and my site comes back to life.

Hope this helps someone else. You can also run

show full processlist;

to see the exact query. In my case, it was a django select_related query that created tons of INNER JOIN clauses in the query.

See: http://dev.mysql.com/doc/refman/5.1/en/show-processlist.html

my same issue was resolved like this: remove cgi configure that was added by me someday:

AddHandler cgi-script .py

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!