I need help to figure out how to run a python file from php script. Can someone let me know the complete procedure how to run a python file from php.
Appreciating your help.
Here is simple solution
/*
<complete path of python> '/usr/local/bin/python3';
<python file> 'test.py';
*/
$file_path = '<complete path of python> <python file>';
$command = escapeshellcmd($file_path);
$output = shell_exec($command);
var_dump($output);
let me know, if you face any other issue. Happy coding