diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index 021073f4..2f0a00f2 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -97,9 +97,8 @@ class Test extends Command */ public function handle() { - $r = executeCommand("php -m"); - $r = preg_split("/[\r\n]+/", $r); - dd($r); + $r = executeCommand("php -r 'var_export(function_exists(\"pcntl_alarm\"));'"); + dd($r == 'true'); } } diff --git a/nexus/Install/Install.php b/nexus/Install/Install.php index e3c6c00e..aff66e5a 100644 --- a/nexus/Install/Install.php +++ b/nexus/Install/Install.php @@ -38,7 +38,7 @@ class Install ]; protected array $requiredFunctions = [ 'symlink', 'putenv', 'proc_open', 'proc_get_status', 'exec', -// 'pcntl_signal', 'pcntl_alarm', 'pcntl_async_signals' + 'pcntl_signal', 'pcntl_alarm', 'pcntl_async_signals' ]; protected string $lockFile = 'install.lock'; @@ -168,7 +168,13 @@ class Install $disabledFunctions = []; foreach ($this->requiredFunctions as $fn) { - if (!function_exists($fn)) { + if (str_starts_with($fn, "pcntl_")) { + $phpPath = nexus_env('PHP_PATH') ?: 'php'; + $exists = executeCommand("$phpPath -r 'var_export(function_exists(\"$fn\"));'") == 'true'; + if (!$exists) { + $disabledFunctions[] = $fn; + } + } elseif (!function_exists($fn)) { $disabledFunctions[] = $fn; } }