• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Basic Question

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic