diff --git a/src/Illuminate/Foundation/Console/ApiInstallCommand.php b/src/Illuminate/Foundation/Console/ApiInstallCommand.php index dda72efcb615..d8ab378c3bdf 100644 --- a/src/Illuminate/Foundation/Console/ApiInstallCommand.php +++ b/src/Illuminate/Foundation/Console/ApiInstallCommand.php @@ -6,7 +6,8 @@ use Illuminate\Filesystem\Filesystem; use Illuminate\Support\Facades\Process; use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Process\PhpExecutableFinder; + +use function Illuminate\Support\php_binary; #[AsCommand(name: 'install:api')] class ApiInstallCommand extends Command @@ -65,7 +66,7 @@ public function handle() if ($this->option('passport')) { Process::run(array_filter([ - (new PhpExecutableFinder())->find(false) ?: 'php', + php_binary(), defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan', 'passport:install', $this->confirm('Would you like to use UUIDs for all client IDs?') ? '--uuids' : null, @@ -130,7 +131,7 @@ protected function installSanctum() if (! $migrationPublished) { Process::run([ - (new PhpExecutableFinder())->find(false) ?: 'php', + php_binary(), defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan', 'vendor:publish', '--provider', diff --git a/src/Illuminate/Foundation/Console/BroadcastingInstallCommand.php b/src/Illuminate/Foundation/Console/BroadcastingInstallCommand.php index f6b5e4869d08..4dd9cc8d1dc1 100644 --- a/src/Illuminate/Foundation/Console/BroadcastingInstallCommand.php +++ b/src/Illuminate/Foundation/Console/BroadcastingInstallCommand.php @@ -7,8 +7,8 @@ use Illuminate\Filesystem\Filesystem; use Illuminate\Support\Facades\Process; use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Process\PhpExecutableFinder; +use function Illuminate\Support\php_binary; use function Laravel\Prompts\confirm; #[AsCommand(name: 'install:broadcasting')] @@ -155,7 +155,7 @@ protected function installReverb() ]); Process::run([ - (new PhpExecutableFinder())->find(false) ?: 'php', + php_binary(), defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan', 'reverb:install', ]); diff --git a/src/Illuminate/Foundation/Console/ServeCommand.php b/src/Illuminate/Foundation/Console/ServeCommand.php index 6c95b8233f63..f1c51987a078 100644 --- a/src/Illuminate/Foundation/Console/ServeCommand.php +++ b/src/Illuminate/Foundation/Console/ServeCommand.php @@ -8,9 +8,9 @@ use Illuminate\Support\InteractsWithTime; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Process; +use function Illuminate\Support\php_binary; use function Termwind\terminal; #[AsCommand(name: 'serve')] @@ -178,7 +178,7 @@ protected function serverCommand() : __DIR__.'/../resources/server.php'; return [ - (new PhpExecutableFinder)->find(false) ?: 'php', + php_binary(), '-S', $this->host().':'.$this->port(), $server,