Use phpenmod to enable extensions on linux

This commit is contained in:
Shivam Mathur 2023-02-05 19:45:47 +05:30
parent 39b4e4a983
commit 2f306f9d25
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -48,8 +48,14 @@ enable_extension() {
[ -d "$modules_dir" ] && sudo find "$modules_dir" -path "*disabled*$1" -delete
enable_extension_dependencies "$1" "$2"
enable_cache_extension_dependencies "$1" "$2"
if command -v phpenmod >/dev/null 2>&1; then
mod="${ini_dir:?}"/../mods-available/"$1".ini
[ ! -e "$mod" ] || echo "$2=${ext_dir:?}/$1.so" | sudo tee "$mod" >/dev/null
sudo phpenmod -v "$version" "$1" >/dev/null 2>&1
else
echo "$2=${ext_dir:?}/$1.so" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null
fi
fi
}
# Function to enable array of extensions