Symfony Process - execute command from service Symfony Process - execute command from service symfony symfony

Symfony Process - execute command from service


This is pretty much all you need to do really. I always set the working directory and assume this is needed so that the Symfony command is run from the root of the project

$process = new Process(    'app/console execute:my:command');$process->setWorkingDirectory(getcwd() . "../");$process->start();

For debugging purposes I generally set

$process->setOptions(['suppress_errors' => false]);

as well