From 657d37468134ff69a2254cca9775f11ef39510e4 Mon Sep 17 00:00:00 2001 From: Anthony Date: Tue, 17 Jun 2025 23:54:56 +0800 Subject: [PATCH] added debug --- scripts/debug_litespeed.php | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 scripts/debug_litespeed.php diff --git a/scripts/debug_litespeed.php b/scripts/debug_litespeed.php new file mode 100644 index 0000000..ccd75af --- /dev/null +++ b/scripts/debug_litespeed.php @@ -0,0 +1,41 @@ +&1', $output, $return_var); + echo "Return code: $return_var\n"; + echo "Output: " . implode("\n", $output) . "\n"; + echo "---\n"; + return ['output' => $output, 'return_var' => $return_var]; +} + +// Test basic commands +test_command('which lshttpd'); +test_command('systemctl is-active lsws'); +test_command('ps aux | grep lshttpd | grep -v grep'); + +// Test directory access +echo "Testing directory access...\n"; +$test_dirs = ['/opt/litespeed', '/opt/lsws', '/usr/local/lsws']; +foreach ($test_dirs as $dir) { + echo "Directory $dir: " . (is_dir($dir) ? "EXISTS" : "NOT FOUND") . "\n"; +} + +// Test JSON output +echo "Testing JSON output...\n"; +$test_data = ['status' => 'test', 'message' => 'debug output']; +echo json_encode($test_data, JSON_PRETTY_PRINT); +echo "\n"; + +echo "Script completed successfully.\n"; +?> \ No newline at end of file