httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lee Fellows <lfell...@4lane.com>
Subject Re: python script and CGI
Date Wed, 03 Jul 2002 13:27:54 GMT
On Tue, 2002-07-02 at 20:54, Ian McMeans wrote:
> 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.
> 
> 
  What does happen?  What do you see in the error_log?




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


Mime
View raw message