0

i want to open and execute a python file using php . for this reason i’m using xamp . my php and python both files resides in htdocs folder. here is the code.

$output = shell_exec("python untitled6.py");
var_dump($output);

i have also tried different methods like

$python = 'C:\\Users\\Imama\\Anaconda2\\python.exe' ;
$pyscript= 'E:\\xamp\\htdocs\\untitled6.py' ;
$cmd = "$python $pyscript";
echo $cmd;
$result= exec($cmd);

i want help regarding plx :(

4

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.