Cant get php exec to work

前端 未结 3 1567
孤城傲影
孤城傲影 2021-01-17 03:15

I\'ve been fighting with this for a few hours now, and I can\'t seem to work it out. tried exec(), shell_exec(), and system(). Nothing works. I have this:

ex         


        
3条回答
  •  梦谈多话
    2021-01-17 04:16

    To get the output, you need to pass a second parameter, or you can get the last line of output by echo'ing it.

    From the PHP manual:

    string exec ( string $command [, array &$output [, int &$return_var ]] )

    Return Values:

    The last line from the result of the command. If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function. To get the output of the executed command, be sure to set and use the output parameter.

提交回复
热议问题