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.
This commit is contained in:
parent
3549da5b12
commit
e693afab8a
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue