• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic Question

 
Ram Kas
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic