0

I have the following cgi script which tries to run a python code upon button submit from a user form.

   #!home/ann/anaconda2/lib/python2.7

   print "Content-type:text/html\r\n\r\n"
   print '<html>'
   print '<head>'
   print '<title>First CGI Program</title>'
   print '</head>'
   print '<body>'
   print '<form action="./myfile.py" method="get">'
   print '<p> Click here: <button type="submit">submit</button>'
   print '</form>'
   print '</body>'
   print '</html>'

The file which i'm trying to run (myfile.py) is trying to connect to sqlite database. However when I run this code console prints this error and script doesn't execute at all.

   File "/home/ann/anaconda2/lib/python2.7/CGIHTTPServer.py", line  248, in run_cgi
   os.execve(scriptfile, args, env)
   OSError: [Errno 13] Permission denied

Any advice on how to solve this is appreciated.

1 Answer 1

1

Ok. I think this might be useful for people with similar issues. I made it work by including both

      #!usr/bin/env python
      #!home/ann/anaconda2/lib/python2.7 

at the beginning of my script.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.