I am creating an API in PHP which pass some parameters to python and generate a report in pdf format. in report_gen.py file I have code to get parameters and generate pdf. Which is working successfully through command line but when I run PHP file from browser or postman it do not works. I want to run my PHP file through cronjob so it automatically call in specific time.
$data = 'Basic Will Johnyy Willson Smith';
$command = escapeshellcmd("python3 report_gen.py $data");
$output = shell_exec($command); echo $output;