If you are getting error as “sh: whoami/command not found” with php exec function.
You need to check the apache error logs. Because in my case apache logs was showing below error.
[Thu Sep 04 19:41:27 2014] [error] [client xxx.xxx.xxx.xx] sh: whoami: command not found
The problem was the env_path setting in the conf file. So to resolve the problem edit the suphp.conf file and change env_path as below.
#vi /etc/suphp.conf
;PATH environment variable
env_path=/bin:/usr/bin
Change To.
;PATH environment variable
env_path=”/bin:/usr/bin”
and then
#service httpd restart
Then problem was solved.