From eda574ce429f4e9ebaeb3f333eed72a709dfc9a5 Mon Sep 17 00:00:00 2001 From: Edmund Tan Date: Tue, 22 Jul 2025 02:04:29 +0800 Subject: [PATCH] fix install script3 --- UI/install.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/UI/install.sh b/UI/install.sh index 8f4d62b..102d046 100644 --- a/UI/install.sh +++ b/UI/install.sh @@ -144,14 +144,8 @@ install_web_server() { # Determine required PHP packages PHP_PACKAGES="php${PHP_VERSION} php${PHP_VERSION}-curl" - # Check if json extension needs to be installed separately (older PHP versions) - if apt-cache show "php${PHP_VERSION}-json" >/dev/null 2>&1 && \ - ! apt-cache show "php${PHP_VERSION}-json" 2>/dev/null | grep -q "virtual package"; then - PHP_PACKAGES="$PHP_PACKAGES php${PHP_VERSION}-json" - log "INFO" "Will install php${PHP_VERSION}-json separately" - else - log "INFO" "JSON support is included in main PHP package" - fi + # JSON support is bundled in modern PHP versions (php-cli, php-fpm, etc.) + log "INFO" "Skipping php${PHP_VERSION}-json as it's bundled in php${PHP_VERSION}-cli" if [[ "$WEB_SERVER" == "apache" ]]; then # Install Apache and PHP @@ -364,6 +358,13 @@ test_installation() { # Test PHP if php -v > /dev/null 2>&1; then log "SUCCESS" "PHP is working" + + # Test JSON support + if php -r 'var_dump(function_exists("json_encode"));' 2>/dev/null | grep -q "bool(true)"; then + log "SUCCESS" "PHP JSON support is available" + else + log "WARNING" "PHP JSON support may not be available" + fi else log "ERROR" "PHP is not working" fi