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
0
votes
0 answers

Laravel Symfony Process doesn't stop

I'm trying to run the following script in a Laravel controller: public function importLinkedin(Request $request) { $process = new Process("node node/test.js"); $process->run(); if (!$process->isSuccessful()) { throw new…
Adam Winster
  • 69
  • 1
  • 9
0
votes
0 answers

Nodejs error when executing from Laravel using Symfony Process

I am trying to execute a Nodejs file from a Laravel controller using Symfony Process: $process = new Process('node node/test.js'); $process->run(); if (!$process->isSuccessful()) { throw new ProcessFailedException($process); } echo…
Adam Winster
  • 69
  • 1
  • 9
0
votes
0 answers

Enqueue controller action process

Symfony 2.8 Using https://github.com/j-guyon/CommandSchedulerBundle to manage periodic Command executions. Each of these Command executions invokes an specific Service based on the Command arguments. Being in the Services (all of them implementing…
NorthmaN
  • 105
  • 2
  • 11
0
votes
2 answers

Run python from laravel

I'm trying to run a python script from Laravel, with Symfony Process component like this : My controller : public function access(Request $request) { $process = new Process(['test.py', 'helloworld']); $process->run(); …
Nielson
  • 49
  • 10
0
votes
0 answers

Symfony\Component\Process\Process unable to run audit2allow

I'm trying to execute audit2allow using Symfony\Component\Process\Process. When I run exec("audit2allow -a -M a2a"); in PHP, it works just fine, a2a.pp and a2a.te is produced. $process = new Process(['audit2allow', '-a', '-M', 'a2a']); …
bilogic
  • 449
  • 3
  • 18
0
votes
1 answer

Symfony\Process package in Laravel (for python files)

I am trying to run python files in Laravel Project.Therefore, i use the Symfony\Process package.My code looks like this: use Symfony\Component\Process\Process; use Symfony\Component\Process\Exception\ProcessFailedException; $process = new…
Vagtse
  • 121
  • 1
  • 15
0
votes
0 answers

Symfony/process Permission denied

I'm using Symfony/Process to run a test from Laravel Dusk in a route of web.php in Laravel. This is the code that I'm using: Route::get('/scraping', function () { $process = new Process('cd pathtoartisan && C:\xampp\php\php.exe artisan dusk…
Mmelo
  • 31
  • 1
  • 6
0
votes
0 answers

Execute Laravel/Symfony/Artisan Command in Background not working on live

I am using Laravel symfony process for background call in laravel on linux server. I have created artisan commands which takes long time to execute, so I have situation to call artisan command on background on button click. I got the solution but…
Ankit
  • 1
  • 1
0
votes
0 answers

Run a detached endless job in Symfony

Symfony: 4.1 PHP: 7.1 I have working websocket server using Ratchet. The websocket itself works fin. I can run it from the terminal using Symfony's commands php bin/console app:websocket:execute I'm having trouble getting around some of these…
DerpyNerd
  • 4,743
  • 7
  • 41
  • 92
0
votes
1 answer

docker and python using symfony process

I am using Laradock and want to be able to run a python script from my laravel app using Symfony Process. From inside the root on my container I can run "python3 script_name.py arg1" and it runs just fine. pip list shows all modules needed. When I…
caro
  • 863
  • 3
  • 15
  • 36
0
votes
1 answer

Running AMPL code from PHP (Laravel Process)

I'm trying to run an ampl .run (or any ampl code) file from Laravel using Symfony Process. My code is as below: $commandArray = array('./ampl'); $process = new Process($commandArray); …
toing_toing
  • 2,334
  • 1
  • 37
  • 79
0
votes
2 answers

Symfony Process - Background tasks

I would like to run a background process, which is orphaned, with Symfony Process component. I can't use kernel.terminate event. This is what I have tried to do: This is process I would like to run: // script.php $f = fopen('test'.uniqid().'.txt',…
michail_w
  • 4,318
  • 4
  • 26
  • 43
0
votes
1 answer

Run Node.js script from PHP - output is truncated to 512 characters

We run node.js CLI script from PHP with Symfony Process. The script always print whole response as JSON in one line. The response is somehow truncated on 512 characters. I only found that xdebug.var_display_max_data => 512 => 512 in php.ini but…
0
votes
1 answer

Symfony Background Process FFmpeg video converting

I am trying to convert a video with FFmpeg and everything works fine, but now I'm trying to do the converting process in the background, so I don't have to wait for the process to be done in a minute or so. Is there any suggestion in how I can do…
Did
  • 493
  • 5
  • 19
0
votes
1 answer

Symfony process control

I'm beginner in Symfony, I wanna know if there is any way to control the process of my functions ( I mean to stop it or to run it.. at any time I want) I found this case using the Symfony process library : use…
Shosiria
  • 75
  • 1
  • 11