Symfony/process/process library in Yii2

279 views Asked by At

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: "xxx\vendor\symfony\process\Process.php" line: 144 message: "The Process class relies on proc_open, which is not available on your PHP installation." name: "Exception" stack-trace: [,...] type: "Symfony\Component\Process\Exception\LogicException"

help me to solve this problem.

1

There are 1 answers

0
Ivošš On

Try this:

$process = new Process([
    Yii::getAlias('@app/yii'),
    'test/action'
]);
$process->run();