I have a python script that I'm running from my php backend . this is a part of my code:
<?php
function in_gen($conn,$prob,$userId,$probId){
$file_code=fopen("input.py","w");
fwrite($file_code,$prob["probInGen"]);
fclose($file_code);
exec("python input.py > input.txt");
$input_file=fopen("input.txt","r");
$generated_in=fread($input_file,filesize("input.txt"));
My problem that it runs on my local server. but once I hosted it on an online server, it stopped working . any reason why ?