im trying to execute .py file on php. Ive installed my python through anaconda, 3.7
ive tried to use shell_exec command but it doesnt execute the output from .py file. its just open the .py file in sublime.
#the output should be test
print ("test")
the .py file saved test.py
<?php
$command = escapeshellcmd('test.py');
$output = shell_exec($command);
echo $output;
?>
the .php file saved as cb.php
i put them on the same file named test, in htdoc. i type http://localhost/test/cb.php to run the php file on the browser. I expect the .py code should be executed and the php file should output "test" but the test.py file just opened on sublime text which is my default text editor.