Execute python in a php script using shell_exec()

前端 未结 6 1021
自闭症患者
自闭症患者 2021-01-02 21:45

I\'m experiencing a weird problem in trying to execute python in a php server (LAMP). (safe_mode off)

if I type:

$output = shell_exec(\"ls -lah\");
e         


        
6条回答
  •  南方客
    南方客 (楼主)
    2021-01-02 22:12

    I think kernel not able to find the path for python where it is installed..if you can do echo $PATH..it will show all the paths where to be search a command if given add your python part there and then it may work or you can give absolute path(other than /usr/bin/) see if it works..I need to test it too.

提交回复
热议问题