I have created a command in Symfony. This will run and insert data into the database. I have already tested and it is running fine.
Now my problem is I need to execute this command from the web interface where user clicks on the button and this insertion needs to take place. This insertion will take about 30-45 minutes. So I need to run it in background.
I have heard about Process
in Symfony.
So I have created a controller with a route which when called executes following lines.
use Symfony\Component\Process\Process;
$process = new Process('php bin/console app:import:records' . ' > NUL');
$process->run();
return new Response('successfully done', Response::HTTP_OK);
But nothing is happening. It only displays last respnose message.
Can anybody help me ?