I show you below some dummies examples about I want to do. I need to start a background process using symfony2. This function is in a Controller and I would like to return the response while the command line is running. If I do what I put below it's pretty similar when I call some normal function. I mean, the controller doesn't send back to the user the "ok" untill the process ends.
How can I run it in background?
public function checkAction(Request $request){
$process = new Process('php /home/isma/Documents/kangoosave_backend/app/console fusion:contact:allusers');
$process->start();
return "ok";
}