|
|
@@ -84,7 +84,22 @@ is_web_alias_new() {
|
|
|
|
|
|
# Prepare web backend
|
|
|
prepare_web_backend() {
|
|
|
- pool=$(find -L /etc/php* -type d \( -name "pool.d" -o -name "*fpm.d" \))
|
|
|
+ pool=$(find -L /etc/php/ -name "$domain.conf" -exec dirname {} \;)
|
|
|
+
|
|
|
+ # Check if multiple-PHP installed
|
|
|
+ regex="socket-(\d+)_(\d+)"
|
|
|
+ if [[ $template =~ ^socket-([0-9])\_([0-9])$ ]]
|
|
|
+ then
|
|
|
+ version="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
|
|
|
+ pool=$(find -L /etc/php/$version -type d \( -name "pool.d" -o -name "*fpm.d" \))
|
|
|
+ else
|
|
|
+ if [ "$pool" == "" ]
|
|
|
+ then
|
|
|
+ version=`echo "<?php echo (float)phpversion();" | php`
|
|
|
+ pool=$(find -L /etc/php/$version -type d \( -name "pool.d" -o -name "*fpm.d" \))
|
|
|
+ fi
|
|
|
+ fi
|
|
|
+
|
|
|
if [ ! -e "$pool" ]; then
|
|
|
check_result $E_NOTEXIST "php-fpm pool doesn't exist"
|
|
|
fi
|
|
|
@@ -102,6 +117,11 @@ prepare_web_backend() {
|
|
|
fi
|
|
|
}
|
|
|
|
|
|
+# Delete web backend
|
|
|
+delete_web_backend() {
|
|
|
+ find -L /etc/php/ -type f -name "$backend_type.conf" -exec rm -f {} \;
|
|
|
+}
|
|
|
+
|
|
|
# Prepare web aliases
|
|
|
prepare_web_aliases() {
|
|
|
i=1
|