These are the actions that I have taken and I still can't seem to run the script on PHP on my windows 8.1 platform.
Please do note that I have installed Python and have tested it. I am running python 2.7
(1) Step 1: Edited the Apache httpd.conf scripts to run cgi .py scripts
AddHandler cgi-script .cgi .pl .asp .py
(2) Step 2: Added a test script in cgi-bin folder of xampp. It is called
#!/Python27/python
print "Content-type: text/plain\n\n"
print "Hello world"
(3) Step 3: Created a PHP Code called Python.php
$python = exec('python C:\xampp\cgi-bin\BridgePHP.py');
echo "Python is printing: " . $python;
(4) I get the following output in my browser:
Python is printing:
(5) I tested by running using the standard command prompt and the word "Hello World" was printed
I am unsure why php script is unable to run the python script. Is there any other settings that I should do?