I'm using this command to execute a Python script from who.php:
virtual('../cgi-bin/sigphon/who.py');
on an Apache server, but when I go to the webpage from which command is called (who.php), raw code from the Python file is displayed, like this:
\#!/usr/bin/python print '3' scriptpath = "/compsci/webdocs/morphon/web_docs/cgi-bin/sigphon" import sys, cgi, string, sha, time import cgitb sys.path.insert(0, scriptpath) import easyhtml, member, readdb, common cgitb.enable() # FieldStorage object to hold the form data formdata = cgi.FieldStorage() thisscript = "%s/who.py" % (common.cgibase) def update_text(): return """
etc. ...
I'm able to execute the who.py script from the command line on the same server, from the same directory as who.php, with no issues, and I've tried setting the permissions for all files involved to 777.
I've also tried
echo exec('../cgi-bin/sigphon/who.py');
but to no avail. What's going on here?