Answer the question
In order to leave comments, you need to log in
How is the work with the console using php?
Hey! Please tell me how to work with the Linux console using php? Share libraries if possible. Thank you.
Answer the question
In order to leave comments, you need to log in
https://symfony.com/doc/current/components/process.html
Normal cross-platform asynchronous work with processes.
use Symfony\Component\Process\Process;
use Symfony\Component\Process\Exception\ProcessFailedException;
$process = new Process('ls -lsa');
$process->run();
// executes after the command finishes
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}
echo $process->getOutput();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question