check env fix

This commit is contained in:
xiaomlove
2023-06-16 02:48:37 +08:00
parent fa04d1e9eb
commit 3da3352ac0
+4 -2
View File
@@ -169,8 +169,10 @@ class Install
$disabledFunctions = []; $disabledFunctions = [];
foreach ($this->requiredFunctions as $fn) { foreach ($this->requiredFunctions as $fn) {
if (str_starts_with($fn, "pcntl_") && function_exists('exec')) { if (str_starts_with($fn, "pcntl_") && function_exists('exec')) {
$phpPath = nexus_env('PHP_PATH') ?: 'php'; $command = "php -r 'var_export(function_exists(\"$fn\"));'";
$exists = executeCommand("$phpPath -r 'var_export(function_exists(\"$fn\"));'") == 'true'; $result = exec($command, $output, $result_code);
$outputString = implode("\n", $output);
$exists = $outputString == 'true';
if (!$exists) { if (!$exists) {
$disabledFunctions[] = $fn; $disabledFunctions[] = $fn;
} }