Computing.Net > Forums > Web Development > CGI-bin can't access

CGI-bin can't access

Reply to Message Icon

Original Message
Name: Daemon Rose
Date: August 10, 2004 at 06:27:41 Pacific
Subject: CGI-bin can't access
OS: WinXP
CPU/Ram: AMD 2 ghz
Comment:

Hey guys, hopefully this one's a simple one. Basically I am trying to write a python script and get it to be executable form a webpage. I have the script (it is called python_METAR.py) in my CGI-BIN directory, but for some reason I cannot seem to get it to run. Now I know the script is correct (I can run it from telnet on the server fine) but I cannot ever seem to find a way to access that @#$@$ script from http. Since it's in my CGI-BIN directory I thought I could just call www.endevouraerospace.com/python_METAR.py (or else www.endevouraerospace.com/cgi-bin/python_METAR.py) but the first doesn't find anything, the 2nd gives me a Internal Server 500 error. I have permissions set correctly, the CGI-bin is setup to execute correctly, and I have the correct paht for python in the first line of my script....what could I be doing wrong???? I can't get anything (CGI, perl, python) to run out of this thing, though the webmaster swears it's active. It seems like I am accessing the bin incorrectly, but I don't know how else I can run the program (for example I even have a webpage "chugga.html" in that folder but I can't even display it????
Could someone please give me an example of using a CGI-bin with a dummy server (say blah.com or something? :) This has really got me confused, and unfortunately the webserver staff have not yet been able to help me resolve the issue (they still think the code must be incorect).
oh p.s. if it matters my python code is the following,
#!/usr/local/bin/python
print "Content-Type: text/html\n"
print "Hello, CGI world!"

Thanks for your help guys,


Report Offensive Message For Removal

Response Number 1
Name: FishMonger
Date: August 10, 2004 at 09:16:50 Pacific
Subject: CGI-bin can't access
Reply: (edit)

You should have a blank line after the Content-Type: text/html. So, add another line break to the first print statement.

change:
print "Content-Type: text/html\n"

to this:
print "Content-Type: text/html\n\n"


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: CGI-bin can't access

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software