Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!hq-usenetpeers.eweka.nl!81.171.88.15.MISMATCH!eweka.nl!lightspeed.eweka.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:: [': 0.03; 'subject:skip:c 10': 0.07; 'x86': 0.07; 'python': 0.09; '===========': 0.09; 'rod': 0.09; 'cc:addr:python-list': 0.10; 'subject:error': 0.11; 'aug': 0.13; 'apache': 0.13; '"internal': 0.16; '#name': 0.16; '.py': 0.16; '404': 0.16; 'code?': 0.16; 'gilles': 0.16; 'win7': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'instance': 0.17; 'subject:] ': 0.19; '+0200': 0.20; 'trying': 0.21; 'import': 0.21; 'error.': 0.21; 'file:': 0.22; 'help.': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'script': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'handling': 0.27; 'prevent': 0.27; 'skip:# 10': 0.27; 'options': 0.27; 'there.': 0.28; 'cgi': 0.29; 'source': 0.29; "i'm": 0.29; 'basic': 0.30; 'error': 0.30; 'running': 0.32; 'could': 0.32; 'handle': 0.33; 'thanks': 0.34; 'server': 0.35; 'subject:?': 0.35; 'there': 0.35; 'characters': 0.36; 'modules': 0.36; 'should': 0.36; 'charset:us-ascii': 0.36; 'unable': 0.36; 'bad': 0.37; 'data': 0.37; 'some': 0.38; 'sure': 0.38; 'where': 0.40; 'your': 0.60; 'received:unknown': 0.63; 'information': 0.63; 'more': 0.63; 'request.': 0.64; 'lives': 0.71; 'subject:Basic': 0.84 Date: Mon, 20 Aug 2012 07:59:39 -0400 From: Rod Person To: Gilles Subject: Re: [CGI] Basic newbie error or server configuration error? In-Reply-To: <6c84389rqmrj01cppc0ppiedqd44o4mfdf@4ax.com> References: <6c84389rqmrj01cppc0ppiedqd44o4mfdf@4ax.com> X-Mailer: Claws Mail 3.8.0cvs30 (GTK+ 2.16.6; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 58 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345464328 news.xs4all.nl 6982 [2001:888:2000:d::a6]:45394 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27483 On Mon, 20 Aug 2012 13:41:20 +0200 Gilles wrote: > Hello > > Apache fails running this basic CGI script that I found on the Net: > > www.acme.com/cgi-bin/test.py?name=myname > =========== > #!/usr/bin/env python > > # Import modules for CGI handling > import cgi, cgitb > > cgitb.enable() > > # Create instance of FieldStorage > form = cgi.FieldStorage() > > # Get data from field 'name' > #name = form['name'].value > name = form.getvalue('name') > =========== > > This is what I get: > =========== > "Internal Server Error > > The server encountered an internal error or misconfiguration and was > unable to complete your request. > > Additionally, a 404 Not Found error was encountered while trying to > use an ErrorDocument to handle the request." > =========== > > FWIW, the script lives in www/cgi-bin/ where it should, was chmoded to > 755, and I put the following .htaccess file: > =========== > Options +ExecCGI > AddHandler cgi-script .py > =========== > > I'm not sure where to look for an error. Could it be some non-printed, > bad characters that prevent Python from compiling the source code? > > Thanks for any help. Check the Apache error log, there should be more information there. -- Rod Person http://www.rodperson.com rodperson@rodperson.com Sent From Claws Mail 3.8.0cvs30 Win7 x86 GTK+ 2.16.6/GLib 2.24.0