Use PHP_BINARY directly instead of trying to build path to PHP binary (#13690)

This commit is contained in:
Jellyfrog
2022-01-20 15:50:43 +01:00
committed by GitHub
parent fb90b1813f
commit 36d8d9102e
2 changed files with 4 additions and 4 deletions

View File

@@ -119,7 +119,7 @@ class EnvHelper
if (! file_exists($env_file)) {
copy(base_path('.env.example'), $env_file);
$key = trim(exec(PHP_BINDIR . '/php ' . base_path('artisan') . ' key:generate --show'));
$key = trim(exec(PHP_BINARY . ' ' . base_path('artisan') . ' key:generate --show'));
self::writeEnv([
'APP_KEY' => $key,

View File

@@ -54,7 +54,7 @@ if (php_sapi_name() == 'cli' && isset($_SERVER['TERM'])) {
}
if (is_file($install_dir . '/composer.phar')) {
$exec = PHP_BINDIR . "/php '" . $install_dir . "/composer.phar'";
$exec = PHP_BINARY . " '" . $install_dir . "/composer.phar'";
// If older than 1 week, try update
if (time() - filemtime($install_dir . '/composer.phar') > 60 * 60 * 24 * 7) {
@@ -80,8 +80,8 @@ if (is_file($install_dir . '/composer.phar')) {
echo "Error: Failed to download $installer_url\n";
} elseif (@hash_file('SHA384', $dest) === $good_sha) {
// Installer verified
shell_exec(PHP_BINDIR . "/php $dest");
$exec = PHP_BINDIR . "/php '$install_dir/composer.phar'";
shell_exec(PHP_BINARY . " $dest");
$exec = PHP_BINARY . " '$install_dir/composer.phar'";
} else {
echo "Error: Corrupted download, signature doesn't match for $installer_url\n";
}