From 158098b9ee9704232ae8dd00f6992451b6abf9b6 Mon Sep 17 00:00:00 2001 From: Master3395 Date: Wed, 31 Dec 2025 22:44:58 +0100 Subject: [PATCH] Enhance venvsetup.sh to conditionally create timezone.ini file - Added logic to check for the successful installation of the timezonedb extension before creating the corresponding .ini file. - Implemented a check to verify the existence of timezonedb.so in the PHP extension directory, improving the robustness of the installation process. These changes ensure that the timezone configuration is only applied when the extension is available, enhancing the reliability of the setup script. --- install/venvsetup.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/install/venvsetup.sh b/install/venvsetup.sh index da7906543..bd5b472eb 100644 --- a/install/venvsetup.sh +++ b/install/venvsetup.sh @@ -1109,7 +1109,13 @@ for version in $(ls /usr/local/lsws | grep lsphp); ./configure --with-php-config=/usr/local/lsws/${version}/bin/php-config${version2} make make install - echo "extension=timezonedb.so" > /usr/local/lsws/${version}/etc/php/${version2}/mods-available/20-timezone.ini + # Only create .ini file if extension was successfully installed + # Check if timezonedb.so exists in the extension directory + ext_dir=$(/usr/local/lsws/${version}/bin/php-config${version2} --extension-dir) + if [[ -f "${ext_dir}/timezonedb.so" ]] ; then + mkdir -p /usr/local/lsws/${version}/etc/php/${version2}/mods-available + echo "extension=timezonedb.so" > /usr/local/lsws/${version}/etc/php/${version2}/mods-available/20-timezone.ini + fi make clean fi done