2008/10/18 Graham Dumpleton <[EMAIL PROTECTED]>: > 2008/10/18 Prunikov <[EMAIL PROTECTED]>: >> >> Simple example. >> >> def application(environ, start_response): >> source = 'source' >> >> import urllib2 >> url = 'http://www.google.com/' >> urllib2.urlopen(url) >> >> response_headers = [('Content-type', 'text/html'), >> ('Content-Length', str(len(source)))] >> >> start_response('200 OK', response_headers) >> return [source] >> >> got this in error.log >> >> [Fri Oct 17 23:38:22 2008] [error] [client 127.0.0.1] Premature end of >> script headers: application-d.wsgi.py >> >> ---------------------- >> SERVER_SOFTWARE ::: Apache/2.2.9 (Unix) mod_fastcgi/2.4.2 mod_ssl/ >> 2.2.9 OpenSSL/0.9.7l DAV/2 PHP/5.2.6 mod_wsgi/2.0 Python/2.5.1 > > If you disable PHP module in Apache, do you see the same problem. > > Vaguely remember some shared library versioning issue between PHP and > mod_wsgi/Python causing urllib to crash. > > Will need to see if I can find any reference to it.
BTW, are you sure that is the only error message you get in the Apache error logs? To get this error message with mod_wsgi you would have to be running WSGI application in daemon mode and the daemon process would have had to have crashed. If it has crashed, you should get other error messages in Apache error log about a segmentation fault or similar. What is the actual mod_wsgi configuration you have in Apache configuration files for setting up the application? Are you running on a system with SELinux enabled? Did the hello world program work first before you added use of urllib2? As suggested by Clodoaldo, obviously a good idea to use latest version. Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en -~----------~----~----~----~------~----~------~--~---
