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
精彩评论