I use popen and ssh.
In one script, i need to restart the service spamassassin with :
$spamassassin = "service spamassassin restart &";
$spamassmilter = "service spamass-milter restart &";
shell_exec($spamassassin);
shell_exec($spamassmilter);
I want this process restart in the background, because my browser wait the service be restart to stop load the web page.
I try with :
$spamassassin = "service spamassassin restart &";
and
$spamassassin = "service spamassassin restart > exit.txt";
and
$spamassassin = "nohup service spamassassin restart";
But my browser wait the service is restart...
How can i restart the service, without my browser wait until all services are restarted ?
I use popen, ssh, exec
EDIT :
Finally I resolved my problem thanks to @immulatin for this link
Asynchronous shell exec in PHP
i use :
$spamassassin = "service spamassassin restart &> /dev/null &";
$spamassmilter = "service spamass-milter restart &> /dev/null &";
exec($spamassassin);
exec($spamassmilter);