fix: SystemController php-fpm detection — probe phpX.Y-fpm from running PHP version first

This commit is contained in:
Pontoporeia
2026-04-08 17:46:42 +02:00
parent 7117934d07
commit df414346e9
2 changed files with 10 additions and 4 deletions

View File

@@ -2,3 +2,4 @@
## Fixes ## Fixes
- [x] Replace `mb_strlen`/`mb_substr` with `strlen`/`substr` in TfeController, SearchController, Parsedown — mbstring extension not available on production server - [x] Replace `mb_strlen`/`mb_substr` with `strlen`/`substr` in TfeController, SearchController, Parsedown — mbstring extension not available on production server
- [x] SystemController: PHP-FPM status check — dynamically probe `phpX.Y-fpm` unit derived from running PHP version before static fallback list; add `php8.4-fpm` to cover current production PHP 8.4

View File

@@ -290,10 +290,15 @@ class SystemController
'detail' => $nginxVersion, 'detail' => $nginxVersion,
]; ];
// php-fpm (try versioned unit names first) // php-fpm — probe running PHP version's unit first, then fall back
$phpFpmStatus = null; $phpFpmStatus = null;
$phpFpmUnit = null; $phpFpmUnit = null;
foreach (['php8.3-fpm', 'php8.2-fpm', 'php8.1-fpm', 'php-fpm'] as $unit) { $phpMajMin = PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION;
$fpmCandidates = array_unique([
'php' . $phpMajMin . '-fpm',
'php8.4-fpm', 'php8.3-fpm', 'php8.2-fpm', 'php8.1-fpm', 'php-fpm',
]);
foreach ($fpmCandidates as $unit) {
$s = $this->systemdStatus($unit); $s = $this->systemdStatus($unit);
if ($s !== null && $s !== 'unknown') { if ($s !== null && $s !== 'unknown') {
$phpFpmStatus = $s; $phpFpmStatus = $s;