shell_exec returns empty string

前端 未结 4 1930
隐瞒了意图╮
隐瞒了意图╮ 2021-01-21 03:06

When I execute my command in PHP with shell_exec it always returns an empty string. I tried shell_exec(\'ls -l\'); and it works. I put the command as

4条回答
  •  有刺的猬
    2021-01-21 03:45

    Most of the time php scripts are run by Apache, if thats the case with your script then Apache user may not have enough permissions to run this command. Check that first. If its run as CLI script then check if PHP user can run the script.

提交回复
热议问题