I want my php file to run in background.
When I googled, I found that exec() is used to run in background. I am using a CentOS server.
So, in order to use exec, what are all the basic things I should install?
I don't even know how to run in terminal.
What steps should I follow to run a php script in background using exec()?
I found this example on Google, but I don't know what to use in $cmd.
function execInBackground($cmd) {
if (substr(php_uname(), 0, 7) == "Windows"){
pclose(popen("start /B ". $cmd, "r"));
}
else {
exec($cmd . " > /dev/null &");
}
}