The problem that PHP calls python script not to be executed

php
$output = shell_exec("python D:\test.py");



 Python   test.py
    from os import startfile  -sharp
    path = "D:\Wildlife.wmv"
    startfile(path)

the video is not played when the php file is called, but I can execute python test.py with the cmd command line. In addition, I print print (12345) in test.py; then I also return 12345 when I execute PHP.
what is the reason for this

?
Apr.22,2022

what I see from your discussion is that PHP cannot call shell script execution, so have you ever considered not having permission?


try to use exec ('python D:\ test.py', $output, $return_var) and print $return_var (return status after command execution) to see what the status code is.

Menu