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
2
votes
1 answer

Change GNuPG passphrase using a script

I am struggling to change a GnuPG private key passphrase with a script. This is as far as I get: it returns that the process was successful at the end, but it doesn't change the passphrase. Any other form of options to gpg result in errors and no…
datashaman
  • 8,301
  • 3
  • 22
  • 29
2
votes
1 answer

Symfony/Process exception when running Python3 from Laravel controller on remote server (Debian)

I'm trying to execute a python script (3.6.5) which is located in one folder inside my Laravel app folder. The script is been called from a controller and retrieves the output of the scrpit. I'm using Symfony/process to execute the scrip, like in…
mordecai
  • 529
  • 5
  • 25
2
votes
0 answers

Process Bar for symfony process

i have long running task which i have incorporated as a Process in my symfony project. This is how i call the process $rootDir = $this->get('kernel')->getRootDir(); $adk_process = new Process( 'php ../bin/console app:adkaction ' . $numcampaigns .…
Sky21.86
  • 627
  • 2
  • 9
  • 26
2
votes
1 answer

Symfony Process Eats Terminal Control Codes

So I'm running a Symfony Process for some commands, and I noticed that when I write those to Symfony's OutputInterface it is not showing colors or progress bars. I think that the commands (npm, artisan, ls, etc) are using terminal control codes, and…
Derrek Bertrand
  • 596
  • 7
  • 13
2
votes
2 answers

Laravel 5.1 - Execute a PHP script in the Background

I have a web application written using Laravel 5.1 that runs a script when a user requests a certain page or clicks a button. This should activate the script in the background. I have tried this using Jobs & queues. Here is my code…
ba1ar
  • 534
  • 5
  • 22
2
votes
1 answer

Cannot upgrade to Symfony 3 because of a dependency

I'm trying to upgrade from Symfony 2.8 to Symfony 3, but I cannot update it from Composer. I get this error : hellogerard/jobby dev-master requires symfony/process ^2.7 -> satisfiable by symfony/process[v2.7.0 ... blabla bla v2.8.2] When I look the…
Raphaël Malié
  • 3,912
  • 21
  • 37
2
votes
0 answers

Symfon2 Process is not starting with & - Ampersand

I have a symfony command to send emails. In the terminate listener, I run this command. Below is the command I run, php ../app/console insead:email:prepare & I passed & (Ampersand) sign to the command in order to spawn a new…
2
votes
1 answer

windows - Symfony2 Process crashes when passing env variables

Apologies in advance if this question has already been answered before. It's kind of hard to find something exactly like this. As the title already says, I'm trying to spawn a Symfony2 Process which executes a cmd file on Windows, a shell script on…
Harold
  • 1,372
  • 1
  • 14
  • 25
2
votes
1 answer

Kill process using Symfony

I am trying to kill a process with pid 38456 using Symfony with this code: $process1 = new Process('kill -9 38456'); $process1->run(); Pitifully this doesn't work. I think this is due to permissions (Symfony only can kill its own process) but I am…
amarincolas
  • 141
  • 14
2
votes
2 answers

Access a background process in Symfony2

I would like to create a background process in Symfony2, using the Process component and run it in background, like this: $process = new Process('php myfile.php --option1 --option2'); $process->start(); The script which I want to run here would run…
Przemek
  • 6,300
  • 12
  • 44
  • 61
2
votes
1 answer

Symfony2 background process

How can I run a Symfony2 process in background? My code: class Start extends Symfony\Component\Console\Command\Command { protected function configure() { $this->setName('start'); } protected function execute(InputInterface $input,…
NikitaObukhov
  • 193
  • 1
  • 2
  • 10
2
votes
1 answer

Symfony Class Not Found

I am getting the error: PHP Fatal error: Class 'Symfony\\Component\\Process\\PhpProcess' not found in ... It's my first time using Symfony. I download the files from the GitHub site. Since the downloaded files are of the Process directory, I…
Goaler444
  • 2,591
  • 6
  • 35
  • 53
1
vote
0 answers

How to correctly use real-time Symfony Process Output

I have following Symfony Process which calls a standard git clone command and writes the output in real-time: $process = new Process( [ 'git', 'clone', self::REPOSITORY_URL . $project . '.git', $destinationPath …
1
vote
1 answer

Symfony 6.1 - How to run a background task for inserting entries into the database?

I am currently working on a Symfony 6.1 project and have a database insert that needs to generate quite a lot of entries (30k+). I would like to run this insert process as a background task and once all entries have been created in the database, I…
schwaluck
  • 115
  • 9
1
vote
1 answer

Unable to run a Laravel Artisan command with parameters using Symfony process

I'm trying to start a process with Symfony in my Laravel app on my shared hosting server that will call an Artisan command with parameters like so: $process = new Process(['/usr/local/bin/php', base_path('artisan'), 'queue:work…