Skip to content

Commit 7c15038

Browse files
committed
Merge branch 'patch-1'
2 parents 92ceab4 + 88bbd9c commit 7c15038

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/Commands/Concerns/InstallsRoadRunnerDependencies.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Spiral\RoadRunner\Http\PSR7Worker;
88
use Symfony\Component\Process\Exception\ProcessSignaledException;
99
use Symfony\Component\Process\ExecutableFinder;
10+
use Symfony\Component\Process\PhpExecutableFinder;
1011
use Symfony\Component\Process\Process;
1112

1213
trait InstallsRoadRunnerDependencies
@@ -62,11 +63,13 @@ protected function findComposer()
6263
{
6364
$composerPath = getcwd().'/composer.phar';
6465

65-
if (file_exists($composerPath)) {
66-
return '"'.PHP_BINARY.'" '.$composerPath;
66+
$phpPath = (new PhpExecutableFinder)->find();
67+
68+
if (! file_exists($composerPath)) {
69+
$composerPath = (new ExecutableFinder())->find('composer');
6770
}
6871

69-
return 'composer';
72+
return '"'.$phpPath.'" '.$composerPath;
7073
}
7174

7275
/**
@@ -88,6 +91,7 @@ protected function ensureRoadRunnerBinaryIsInstalled(): string
8891

8992
if ($this->confirm('Unable to locate RoadRunner binary. Should Octane download the binary for your operating system?', true)) {
9093
tap(new Process(array_filter([
94+
(new PhpExecutableFinder)->find(),
9195
'./vendor/bin/rr',
9296
'get-binary',
9397
'-n',

src/Commands/StartRoadRunnerCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Laravel\Octane\RoadRunner\ServerProcessInspector;
77
use Laravel\Octane\RoadRunner\ServerStateFile;
88
use Symfony\Component\Console\Command\SignalableCommandInterface;
9+
use Symfony\Component\Process\PhpExecutableFinder;
910
use Symfony\Component\Process\Process;
1011

1112
class StartRoadRunnerCommand extends Command implements SignalableCommandInterface
@@ -66,7 +67,7 @@ public function handle(ServerProcessInspector $inspector, ServerStateFile $serve
6667
$server = tap(new Process(array_filter([
6768
$roadRunnerBinary,
6869
'-o', 'http.address='.$this->option('host').':'.$this->option('port'),
69-
'-o', 'server.command=php ./vendor/bin/roadrunner-worker',
70+
'-o', 'server.command='.(new PhpExecutableFinder)->find().' ./vendor/bin/roadrunner-worker',
7071
'-o', 'http.pool.num_workers='.$this->workerCount(),
7172
'-o', 'http.pool.max_jobs='.$this->option('max-requests'),
7273
'-o', 'http.pool.supervisor.exec_ttl='.$this->maxExecutionTime(),

0 commit comments

Comments
 (0)