symfony/process - Process silently not starting symfony/process - Process silently not starting symfony symfony

symfony/process - Process silently not starting


Your process most likely dies before it manages to finish its work. It's because PHP kills it after the response is returned back to the client and connection is closed.

Process::start() is used to start a process asynchronously. You need to either wait() for it to finish or check if it has finished yet with isRunning():

$process->start();$process->wait(function ($type, $buffer) {    // do sth while you wait});

Alternatively, use Process::run() instead of Process:start().

Use message queues if you want to process something in background.


Just one update for 2020 .... i was getting an silent error, and did this to debug

$process = new Process($command);$process->run();print_r($process->getErrorOutput());