Questions tagged [symfony-process]

Symfony Process component executes commands in sub-processes.

Symfony Process is one of the Symfony components that is bundled with Symfony but can also be used separately.

It allows to run sub-processes, view real-time process output, run them asynchronously, kill them with nice API.
Also it can be used to run PHP code in isolation.

Documentation:
http://symfony.com/doc/current/components/process.html

Install using Composer:
composer require symfony/process

Homepage:
https://github.com/symfony/process

102 questions
3
votes
1 answer

Laravel symfony process exceeded the timeout of 60 seconds

I have been having an issue in Laravel which I just can't seem to solve. As a part of our application, we are adding a lot of jobs to a queue and executing them using queue:work. This is setup with Supervisor and is working very well. We are having…
André Gollubits
  • 163
  • 1
  • 3
  • 13
3
votes
0 answers

Symfony Process doesn't execute command

From a controller method, I want to run a Symfony command, in the background. public function collaboratorsSendInvitationsAction($company_id) { $process = new Process( 'php ' . $this->get('kernel')->getRootDir() . '/console nd:company…
fnev.eu
  • 303
  • 2
  • 10
3
votes
1 answer

Colorized output from docker to websocket

This might be a little bit of a complex question but I am open to try any and all suggestions thrown at me. I am running a docker instance which clones a git repository, it is a php 7 apache docker instance: FROM php:7.0-apache With the Symfony…
Stephan-v
  • 19,255
  • 31
  • 115
  • 201
3
votes
2 answers

Error running Process in symfony

I have the following simple command: $process = new Process("php /Users/Name/Sites/App/app/../bin/console cache:clear --env=prod"); $process->run(); when I try to run this it gives me: string(153) " Parse error: parse error in…
adit
  • 32,574
  • 72
  • 229
  • 373
3
votes
0 answers

PHP console command doesn't stop at end of process

I get a strange PHP bug on a PHP 5.6 / Symfony 2.7 project, running on a CentOS6 server through Apache. I have a Symfony console command running as a service which launches some other console commands every 2 seconds. I use the Symfony Process…
3
votes
1 answer

Convert DOC to PDF using unoconv via Symfony Component

I'm trying to convert word documents to PDF, via the commandline using unoconv via PHP. I'm using the Symfony Process Component to run the command via the command line. public function run() { $cmd = 'unoconv --listener & unoconv ' .…
Kiee
  • 10,661
  • 8
  • 31
  • 56
3
votes
2 answers

Parse command line output using Symfony Process

Within my Symfony application I need to do several operation with files: list of files from a directory, decrypt them using gpg, parse the output with an external software and encrypt again. My first question is: is this the right approach for this…
MarcSitges
  • 282
  • 3
  • 11
3
votes
2 answers

Spawning interactive CLI command with Expect exits with 0 early, when run as Symfony Process in Behat context

This is quite an advanced question, perhaps knowledge of Symfony and Behat may not be necessary to understand the problem. So in order to test the input and output of an interactive CLI app bin/albumgrab I've written in PHP using the Symfony Console…
Adam Elsodaney
  • 7,722
  • 6
  • 39
  • 65
3
votes
2 answers

How to get process PID started by Symfony?

How can I get PID of process started by Symfony? The code bellow $process = new \Symfony\Component\Process\Process('vlc'); $process->start(); return $process->getPid(); returns PID 1488. But there is no process (no vlc, no php) in system with same…
Konpaka
  • 322
  • 3
  • 11
3
votes
1 answer

Start a background symfony/process from symfony/console

I'm attempting to create a cli (symfony/console) that manages long-running child processes (symfony/process) that consume a message queue. I have two commands, Consume and Listen. Consume is a wrapper for Listen so it can be run in the background.…
Chad
  • 714
  • 2
  • 9
  • 26
3
votes
1 answer

Ajax polling with Symfony Process component

I am starting a long running task that returns incremental output about the tasks progress with the Symfony Process component. One of the examples shows how to get real time output and another example shows how to run an asynchronous task. What I am…
paul
  • 572
  • 6
  • 24
3
votes
2 answers

Symfony write process output to file

How to write the output of an Asynchronous process to the file. I have the following code in my phpunit bootstrap file: $command = 'exec php ' . $kernel->getRootDir() . '/console ' . 'xxx:servicebus:start-services --env=' .…
Obaid Maroof
  • 1,523
  • 2
  • 19
  • 40
3
votes
2 answers

Symfony2 - process launching a symfony2 command

My goal is to launch some time consuming functions in the background to avoid user to wait before the server response is rendered. I have a Symfony project where I am launching an asynchronous process from a controller. This process will launch a…
Milos Cuculovic
  • 19,631
  • 51
  • 159
  • 265
3
votes
2 answers

Symfony2 and Background processes

I have a class in my Symfony 2.3 project that is doing some http requests and takes some time. I would like to run this task as a background process, so that the server returns an answer to the client and the background process continues running. Do…
Milos Cuculovic
  • 19,631
  • 51
  • 159
  • 265
3
votes
1 answer

Symfony2 Process doest't give feedback in real-time

my idea is to start a minecraft server with the Symfony2 Process Class and want to give feedback to me in real time. So, like described in the Process cookbook part, I try the following code: $process = new Process('sudo java -jar -Xms512M -Xmx1G…
F481
  • 990
  • 8
  • 22