Skip to content

Commit a90717f

Browse files
committed
yiisoft#18: Use PHP_BINARY in command line for a child process
1 parent f2384f0 commit a90717f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Command.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ public function actionExec()
8686
private function handleMessage($message)
8787
{
8888
// Executes child process
89-
$cmd = strtr('php {yii} {queue}/exec --verbose={verbose}', [
89+
$cmd = strtr('{php} {yii} {queue}/exec --verbose={verbose}', [
90+
'{php}' => PHP_BINARY,
9091
'{yii}' => $_SERVER['SCRIPT_FILENAME'],
9192
'{queue}' => $this->id,
9293
'{verbose}' => (int) $this->verbose,

tests/QueueTestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ private function prepareCmd($cmd)
4040
$method->setAccessible(true);
4141

4242
return strtr($cmd, [
43+
'php' => PHP_BINARY,
4344
'queue' => $method->invoke($this->getQueue()),
4445
]);
4546
}

0 commit comments

Comments
 (0)