I am trying to call python script from php, everything works perfect in plain php like this:
$data = $_POST['text'];
$result=exec('python_file.py ' . escapeshellarg(json_encode($data)));
$resultData = json_decode($result, true);
The problem is, when I use the same line in laravel 3.2.13 function in one of my bundles controllers, it doesn't execute the command and gives no error!
Is there any help?
This is how my laravel function looks like :
public function action_test(){
$text="Test";
$result=exec('python_file.py ' . escapeshellarg(json_encode($text)));
$resultData = json_decode($result, true);
dd($result);
}
Thank You
exec('python_file.py ' . escapeshellarg(json_encode($text)), $result);[Errno 2] No such file or directory: '.\\config.xml'