fix: use /bin/rm explicitly in removePool so sudoers path matches

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LP9Q4kfCAYAjJnsbHBrViZ
This commit is contained in:
2026-06-20 21:04:16 +00:00
parent 29e2744609
commit 65a8690750
+1 -3
View File
@@ -48,9 +48,7 @@ php_value[max_execution_time] = 30
public static function removePool(string $username): void { public static function removePool(string $username): void {
foreach (['7.4','8.1','8.2','8.3'] as $ver) { foreach (['7.4','8.1','8.2','8.3'] as $ver) {
$file = str_replace('{ver}', $ver, self::$poolDir) . "/{$username}.conf"; $file = str_replace('{ver}', $ver, self::$poolDir) . "/{$username}.conf";
// Always attempt removal — don't rely on file_exists() which fails when shell_exec("sudo /bin/rm -f " . escapeshellarg($file) . " 2>/dev/null");
// www-data can't read the pool.d directory; rm -f is a no-op if missing
shell_exec("sudo rm -f " . escapeshellarg($file) . " 2>/dev/null");
self::reloadFPM($ver); self::reloadFPM($ver);
} }
} }