0

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 ?

2
  • Not really, as my code runs ok locally, my problem is with hosting the projet, because when I do, the python script doesn't run, no matter what the script is. Commented Aug 6, 2021 at 13:11
  • could be a permissions issue, does the username running the python have the appropriate permissions ? Commented Aug 6, 2021 at 13:48

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.