From d7610514a55ee520307e4247202cbfdabf5cf8bf Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 17 Mar 2023 11:55:21 +0100 Subject: [PATCH] create_vhost.sh: support php socket also living in php run directory '/run/php'. --- create_vhost.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/create_vhost.sh b/create_vhost.sh index 929e87c..b40c7e4 100755 --- a/create_vhost.sh +++ b/create_vhost.sh @@ -1842,15 +1842,24 @@ if [ "$_type" = "PHP-FPM" ]; then # - if [ "X$unix_socket" = "X" ] ; then - _unix_socket=`ls /tmp/php-${major_php_verison}*.sock 2>/dev/null` + _unix_socket_tmp_dir=`ls /tmp/php-${major_php_verison}*.sock 2>/dev/null` - _unix_socket_arr=(); - if [[ "$(wc -w <<< "$_unix_socket")" -gt 0 ]]; then - for _socket in ${_unix_socket} ; do + if [[ "$(wc -w <<< "$_unix_socket_tmp_dir")" -gt 0 ]]; then + for _socket in ${_unix_socket_tmp_dir} ; do _unix_socket_arr+=("$_socket") done fi + if [[ -d "/run/php" ]]; then + _unix_socket_run_dir="$(ls /run/php/php-${major_php_verison}*.sock 2>/dev/null)" + + if [[ "$(wc -w <<< "$_unix_socket_run_dir")" -gt 0 ]]; then + for _socket in ${_unix_socket_run_dir} ; do + _unix_socket_arr+=("$_socket") + done + fi + fi + echo "" echo -e "\033[32m--\033[m" echo ""