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

PHP (symfony/process) could not find Python

I'm trying to run a Python script within my laravel application which processes a file and stores it in a specific directory. Laravel should use that processed file further. When running a local Laravel server using php artisan serve and call the…
FryingPan
  • 81
  • 2
0
votes
1 answer

How can I use many commands Process Component?

I need to execute many commands with Process Component. $commands = [ ["mkdir", "-p", path)], ["cd", path], ["rm", "-f", $archiveName, $sqlDbName . '.sql'], …
rcn
  • 53
  • 3
0
votes
1 answer

How to run python function in laravel with symfony process?

I have a python function which returns string data, code runs fine after run import mysql.connector mydb = mysql.connector.connect( host="localhost", user="root", passwd="", database="db_absensi" ) mycursor = mydb.cursor() def…
0
votes
0 answers

Symfony 6.1 - How to start a Command as a Process from Controller?

I am currently working on a Symfony 6.1 project. I want to execute a Command as a Process from a Controller. However, I do not get it working. Everytime I execute the Command it fails with the Exit Code: (). The Command itself works like a charm if…
schwaluck
  • 115
  • 9
0
votes
0 answers

Run js command with Symfony's Component Process

I want to run npm-like commands with Symfony's Component Process. The actual command is relaxed htmlFile.html. The command works when I run it with CLI, but when I run it with Process I get the error below. The command "node -v" failed. Exit Code:…
0
votes
0 answers

Symfony process 'python' command not found

So I'm trying to use the Symfony process to call a Python script from a controller in my Laravel project. $process = new Process(['python', 'C:\projects\laravel_project\src\public\car_tuner.py', $args]); $process->run(); if…
0
votes
1 answer

Calling python script from laravel using symfony process component

currently im working on project that require me to use python and laravel .I've searched a lot in the internet and apparently the solution to call python function is to use symphony. Im pretty sure that i already tried everything and somehow it…
0
votes
1 answer

Run python script from larave framework

Hi everyone who i can i pass laravel parameter with symfony process code i use it to run python script use Symfony\Component\Process\Process; use Symfony\Component\Process\Exception\ProcessFailedException; $process = new…
0
votes
1 answer

Symfony Process 'stop' method doesn't work

I have this code: $process = Process::fromShellCommandline('bash ./receive.sh \ url=' . env('SGW_URL') . ' \ cert=certs/privateKey.p12?' . env('SGW_CERT_PASS'), '/var/www/sgwClientFiles/'); $process->run(); …
Mr_T
  • 15
  • 1
  • 1
  • 4
0
votes
1 answer

Symfony/process/process library in Yii2

I use Symfony/process/process library in Yii2 for background process. $process = new Process(['yii','test/action']); $process->run(); It work fine in localhost but it does not work in server. {name: "Exception",…} code: 0 file:…
0
votes
1 answer

How can I use Symfony Process Component in Laravel to display a chart generated in Python Plotly?

I'm trying to display a plot that is generated with plotly in python, inside my laravel application. When I execute python3.8 ../storage/app/public/rcs/line-chart.py command in my terminal from the public directory of my laravel project, the plot is…
Farzin
  • 359
  • 1
  • 4
  • 21
0
votes
3 answers

Difficulty with running Python script from Laravel Controller using Symfony Process

I want to run a Python script test.py from my Laravel controller, where the script imports a Python module. At first I was getting a module not found error for the python package I import into the python script after testing that the python script…
user16643150
0
votes
1 answer

Artisan runing command ps -f | grep node

I used Laravel for my framework and build script by Laravel command (Artisan) / (Symfony/process) In my method, I used the command ps -f | grep node to find my all-node process pid. I try to run this command to the terminal - running well method…
yuanganteng
  • 171
  • 9
0
votes
1 answer

Laravel running Python script return error libraries not found

I am running a Python script in Laravel using the new process and process->run() method. $process = new Process(['python3', 'public/python/ARIMA/' . $scriptName]); $process->setTimeout(180); $process->run(); The problem is that the process->run it…
Danilo Patrucco
  • 110
  • 3
  • 10
0
votes
1 answer

How to run Symfony Process function inside queue jobs on laravel

Now i'm doing some project use laravel framework. do i able to run Symfony Process function inside a queue jobs? use Symfony\Component\Process\Process; use Symfony\Component\Process\Exception\ProcessFailedException; right now i want to run some…
ferdinand
  • 325
  • 2
  • 14