从php exec和shell_exec执行命令但不能正常工作

I am executing a command from php using exec & shell_exec but it is not working.

It is working fine when I execute it using terminal but not working when I try to execute it using php.

Please help me to do that.

My code is as below:

shell_exec("emulator -avd avd8");

and

exec("emulator -avd avd8");

When I execute this from terminal it execute the emulator but I execute same from php and it do nothing.