httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian McMeans" <imcme...@telus.net>
Subject python script and CGI
Date Wed, 03 Jul 2002 00:54:15 GMT
I've got a python script that I can't get to work. The script works when
called from command line, but not when called as a CGI program. I'm running
apache 2 and python 2.2, here is the script.

###############
#!/bin/python
import urllib2, cgi, cgitb
cgitb.enable()

print "Content-Type: text/html\n"     # HTML is following

print urllib2.urlopen('http://google.com/').read()
################

I can make other scripts work in apache, for example if the last line of the
script is replaced by "print 'hello'", then it works. So I've got no idea
why this script doesn't work.  Does anyone have any idea?

The script works from console, similar scripts work in CGI. Is python unable
to open connections from apache, or something? I'm really stuck with this
problem.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message