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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

CGI-bin can't access

Reply to Message Icon

Name: Daemon Rose
Date: August 10, 2004 at 06:27:41 Pacific
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,



Sponsored Link
Ads by Google

Response Number 1
Name: FishMonger
Date: August 10, 2004 at 09:16:50 Pacific
Reply:

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"


0
Reply to Message Icon

Related Posts

See More


e-mango coldfusion develo... Opening Access Databases



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: CGI-bin can't access

Run file from cgi-bin webserber www.computing.net/answers/webdevel/run-file-from-cgibin-webserber/2621.html

SSIs can't read/write subdirectory www.computing.net/answers/webdevel/ssis-cant-readwrite-subdirectory/2001.html

How to point links to CGI-bin www.computing.net/answers/webdevel/how-to-point-links-to-cgibin/1303.html