could not execute bin folder of a package from cgi bin script using python
#!/usr/bin/python
import cgi, cgitb
cgitb.enable()
import os
import sys
form = cgi.FieldStorage()
pdb1 = form.getvalue('pdb')
template1 = form.getvalue('template')
os.chdir("/home/ashish/project/findsite-1.0/src")
os.system('../bin/findsite -s pdb1 -t template1 -o pdb1.findsite')
print "Content-type:text/html\r\n\r\n"
print "<html>"
print "<head>"
print "<title>SITE FINDER</title>"
print "</head>"
print "<body>"
print "<h2> Selected pdb1 is %s</h2>" % pdb1
print "</body>"
print "</html>"
the above findsite function is working and giving outputs when run directly on the terminal using python filename.py and generating outputs but it is not running when embedded in cgi script. i have no idea why this is creating problem only when used with cgi script.
Iam using ubuntu 10.10 and apache2 server
Last edited by ashish hasani; 04-03-2012 at 11:14 AM.
|