开发者

shell_exec return NULL

when i run the code

shell_exec('ping -c 4 127.0.0.1')

it returns NULL, but when I run the same command (ping -c 4 127.0.0.1) in ssh, it returns perfectly...

and yes, the script can run shell_exec, I tried shell_exec('ls') and it returns correctly, and shell_exec('ping -V') returns ping utility, iputils-ss020927 so ping is开发者_JS百科 being called, but I just get no response...

any help? thanks!


Solved:

Ping cannot be executed as a user. Root must run chmod +s 'type -p ping' in order for users to run ping

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜