From 5072ff8ba259bb6090b63cd4c5f1222732c867ac Mon Sep 17 00:00:00 2001 From: dicobaja <76435781+dicobaja@users.noreply.github.com> Date: Wed, 19 Mar 2025 21:44:30 +0700 Subject: [PATCH] fix: use `where` instead of `which` for windows host --- system/controllers/settings.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/controllers/settings.php b/system/controllers/settings.php index a1599e8b..4366a32f 100644 --- a/system/controllers/settings.php +++ b/system/controllers/settings.php @@ -146,7 +146,8 @@ switch ($action) { $r = ORM::for_table('tbl_routers')->find_many(); $ui->assign('r', $r); if (function_exists("shell_exec")) { - $php = trim(shell_exec('which php')); + $which = stripos(php_uname('s'), "Win") === 0 ? 'where' : 'which'; + $php = trim(shell_exec("$which php")); if (empty($php)) { $php = 'php'; }