Skip to content

Commit 6d29999

Browse files
authored
Fixes
1 parent c2085f3 commit 6d29999

3 files changed

Lines changed: 13 additions & 29 deletions

File tree

config/var/www/admin/control-panel/api.php

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -172,26 +172,8 @@ function getPhpServiceStatus() {
172172
}
173173

174174
function findActivePhpFpmService() {
175-
// Common PHP-FPM service name patterns to check (ordered by likelihood)
176-
$php_patterns = [
177-
'php8.4-fpm',
178-
'php8.3-fpm',
179-
'php8.2-fpm',
180-
'php8.1-fpm',
181-
'php-fpm',
182-
'php-fpm8.4',
183-
'php84-fpm',
184-
];
185-
186-
// Try each pattern
187-
foreach ($php_patterns as $service_name) {
188-
$status = getSystemServiceStatus($service_name);
189-
if ($status === 'active') {
190-
return $service_name;
191-
}
192-
}
193-
194-
// Fallback: Use systemctl to find any active PHP-FPM service
175+
// Use systemctl to find any active PHP-FPM service
176+
// This approach is more flexible and works with any PHP version
195177
$services_output = SystemCommand::getSystemdServices(); // codacy:ignore - Static utility class pattern
196178

197179
if ($services_output === false || empty($services_output)) {
@@ -222,9 +204,11 @@ function findActivePhpFpmService() {
222204
$service_name = preg_replace('/\.service$/', '', $service_name);
223205

224206
// Check if it contains both "php" and "fpm" (case insensitive)
207+
// This matches: php-fpm, php8.4-fpm, php-fpm8.4, php84-fpm, phpfpm, etc.
225208
if (stripos($service_name, 'php') !== false && stripos($service_name, 'fpm') !== false) {
226209
// Validate the service name matches our flexible pattern for PHP-FPM services
227-
// Pattern: php + optional version/text + fpm + optional version/text
210+
// Pattern allows: php[version]fpm or php-fpm[version] or any combination
211+
// Examples: php-fpm, php8.4-fpm, php-fpm8.4, php84-fpm, phpfpm84
228212
if (preg_match('/^php[a-zA-Z0-9\.\-_]*fpm[a-zA-Z0-9\.\-_]*$/', $service_name)) {
229213
// Double-check that it's actually active before returning
230214
$status = getSystemServiceStatus($service_name);

config/var/www/admin/control-panel/external-services/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ The module is already integrated into the EngineScript admin dashboard:
2121

2222
```html
2323
<!-- In index.html -->
24-
<link rel="stylesheet" href="external-services/external-services.css?v=2025.11.21.05">
25-
<script type="module" src="external-services/external-services.js?v=2025.11.21.05"></script>
24+
<link rel="stylesheet" href="external-services/external-services.css?v=2025.11.21.09">
25+
<script type="module" src="external-services/external-services.js?v=2025.11.21.09"></script>
2626
```
2727

2828
```javascript
2929
// In dashboard.js
30-
import { ExternalServicesManager } from './external-services/external-services.js?v=2025.11.21.05';
30+
import { ExternalServicesManager } from './external-services/external-services.js?v=2025.11.21.09';
3131

3232
class EngineScriptDashboard {
3333
constructor() {

config/var/www/admin/control-panel/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/{FONTAWESOME_VER}/css/all.min.css" rel="stylesheet" crossorigin="anonymous">
1313

1414
<!-- Custom Styles -->
15-
<link rel="stylesheet" href="dashboard.css?v=2025.11.21.09">
16-
<link rel="stylesheet" href="external-services/external-services.css?v=2025.11.21.09">
15+
<link rel="stylesheet" href="dashboard.css?v=2025.11.21.10">
16+
<link rel="stylesheet" href="external-services/external-services.css?v=2025.11.21.10">
1717

1818
<!-- Preload Critical Resources -->
19-
<link rel="modulepreload" href="dashboard.js?v=2025.11.21.09" crossorigin="use-credentials">
20-
<link rel="modulepreload" href="modules/api.js?v=2025.11.21.09" crossorigin="use-credentials">
19+
<link rel="modulepreload" href="dashboard.js?v=2025.11.21.10" crossorigin="use-credentials">
20+
<link rel="modulepreload" href="modules/api.js?v=2025.11.21.10" crossorigin="use-credentials">
2121
</head>
2222
<body>
2323
<!-- Loading Screen -->
@@ -374,6 +374,6 @@ <h3>Uptime Robot</h3>
374374
</div>
375375

376376
<!-- Scripts -->
377-
<script type="module" src="dashboard.js?v=2025.11.21.09" data-cfasync="false"></script>
377+
<script type="module" src="dashboard.js?v=2025.11.21.10" data-cfasync="false"></script>
378378
</body>
379379
</html>

0 commit comments

Comments
 (0)