File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Languages and the fly likes Basic Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Languages » Other Languages
Bookmark "Basic Question" Watch "Basic Question" New topic
Author

Basic Question

Ram Kas
Ranch Hand

Joined: Jul 26, 2006
Posts: 83
I have written a program in Python.

Coe is as follows:



I get an error saying :

Error response

Error code 403.

Message: CGI script is not executable ('/cgi-bin/hello.cgi').

Error code explanation: 403 = Request forbidden -- authorization will not help.


I am working on windows.

What can be problem here?

Thanks in advance.
Dinakar Kasturi
Scott Johnson
Ranch Hand

Joined: Aug 24, 2005
Posts: 518
Which web server are you using?

Have you explicitly allowed CGI's to be executed? (For Apache see: http://httpd.apache.org/docs/2.2/howto/cgi.html.)

The first line of your script says the Python executable is here: /usr/bin/python. Is that correct?
Ram Kas
Ranch Hand

Joined: Jul 26, 2006
Posts: 83
Hi Scott,

I am using the webserver that comes with python.

I used the following code:



My hello.cgi is located in C:\python\cgi-bin.

Can you please tell me where I have gone wrong?

Thanks,
Dinakar Kasturi.
Scott Johnson
Ranch Hand

Joined: Aug 24, 2005
Posts: 518
I've never used that web server. But the path to the python interpreter looks wrong for a windows installation. Change it to point to the correct location. Something like:

#!c:/program files/python/bin/python.exe
 
GeeCON Prague 2014
 
subject: Basic Question