mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-07 03:29: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
|
## 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
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user