0

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

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

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.

Shivomkara Chaturvedi
  • 1,697
  • 7
  • 28
  • 42

1 Answers1

0

You would require Asynchronous task execution in PHP. Now when you say exec("emulator -avd avd8") the command is executed and php would wait for the output.

try adding '&' at the end may be like exec("emulator -avd avd8 &") to make this a background process.

Refer this link for more information Asynchronous shell exec in PHP

Community
  • 1
  • 1
Suneesh
  • 469
  • 7
  • 21