Return-Path: Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 19927 invoked by uid 500); 3 Jul 2002 00:54:04 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 19911 invoked from network); 3 Jul 2002 00:54:03 -0000 Received: from defout.telus.net (HELO priv-edtnes27.telusplanet.net) (199.185.220.240) by daedalus.apache.org with SMTP; 3 Jul 2002 00:54:03 -0000 Received: from cr536745a ([216.232.196.177]) by priv-edtnes27.telusplanet.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with SMTP id <20020703005411.TIZL12258.priv-edtnes27.telusplanet.net@cr536745a> for ; Tue, 2 Jul 2002 18:54:11 -0600 Message-ID: <003e01c2222c$27a511b0$b1c4e8d8@cr536745a> From: "Ian McMeans" To: Subject: python script and CGI Date: Tue, 2 Jul 2002 17:54:15 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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