I used this snippet in my controller
$app = new Application($this->container->get('kernel'));
$input = new StringInput('generate:doctrine:entity --no-interaction --entity=ModelBundle:MyTest --fields="title:string(100)"');
$output = new StreamOutput(fopen('php://temp', 'w'));
$app->doRun($input, $output);
It triggered the error "Error: Maximum execution time of 30 seconds exceeded", I increased the Maximum execution time to 100, and still got the same error.
I tried the same command in CLI and worked nice.
I replaced in my controller the command generate:doctrine:entity by container:debug and I didn't get the error "Maximum execution time".
$input = new StringInput('container:debug');
I am using Symfony 2.6.1
Any hint ?
Maybe the command you are calling requires some user input.
Not sure what you want to do but have you tried a simple exec() or passthru() call?