linux - php shell_exec can't return "pidof php" on CentOS
I am using shell_exec command to get the back end processes of PHP. Like:
$dir = shell_exec("ls -la"); //returns directory listing
$date = shell_exec("date"); //returns date
$pid = shell_exec("pidof php"); //returns nothing !!!
If I run"pidof php"
from command console as root, it gives me the correct result. I'm usingPHP 5.5
andCentOS 6.5
.
What additionally I need to do to get the processes?
N.B: If I run the file from command line, it gives me the correct result. But the same file when running from browser, can't return the processes.