mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
fix: SystemController php-fpm detection — probe phpX.Y-fpm from running PHP version first
This commit is contained in:
1
TODO.md
1
TODO.md
@@ -2,3 +2,4 @@
|
||||
|
||||
## Fixes
|
||||
- [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
|
||||
|
||||
@@ -290,10 +290,15 @@ class SystemController
|
||||
'detail' => $nginxVersion,
|
||||
];
|
||||
|
||||
// php-fpm (try versioned unit names first)
|
||||
$phpFpmStatus = null;
|
||||
$phpFpmUnit = null;
|
||||
foreach (['php8.3-fpm', 'php8.2-fpm', 'php8.1-fpm', 'php-fpm'] as $unit) {
|
||||
// php-fpm — probe running PHP version's unit first, then fall back
|
||||
$phpFpmStatus = null;
|
||||
$phpFpmUnit = null;
|
||||
$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);
|
||||
if ($s !== null && $s !== 'unknown') {
|
||||
$phpFpmStatus = $s;
|
||||
|
||||
Reference in New Issue
Block a user