Reputation: 107
I followed many of ways in windows to make a command run without interrupting browser. Whenever I try to:
exec("ping 8.8.8.8")
it makes browser to wait for process to complete.
After completion of process it echoes the output.So what i want is to run a command(like ping) without interrupting browser and store output in variable.
In my case I want to show a dialogue until ping is over and show output afterwards.
I tried:
exec(start \B myexecutable.exe)
without success.Also tried
pclose(popen(start \B myexecutable.exe))
Any suggestion is appreciated.
Upvotes: 0
Views: 982
Reputation: 555
Probably late answer but for me this works on Windows & Linux:
if (isWindows()) {
pclose(popen("start /B php myfile.php -args", 'r'));
} else {
exec("php myfile.php -args");
}
You need to activate the php directive
ignore_user_abort(true)
Upvotes: 1