When i try to execute any command thru exec() function i get 127 as return code and command doesn't execute though on shell every command works.

How can i resolve this issue?

Thanks.