Fix find_fpm_pool_config to work properly on cPanel

- Update find_fpm_pool_config in php-action-executor.sh
- Add proper domain matching for cPool configs
- cPanel names pool configs after the domain, not the username
- Add wildcard matching as fallback
- Function now successfully locates pool config files
- Critical fix for single-domain optimization in Option 4

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
cschantz
2026-02-18 17:30:32 -05:00
parent 7a44ff81d4
commit 17fa38f349
+18 -5
View File
@@ -514,13 +514,26 @@ find_fpm_pool_config() {
local username="$1"
local domain="$2"
# Try using existing function if available
if type find_fpm_pool_config_internal >/dev/null 2>&1; then
find_fpm_pool_config_internal "$username" "$domain"
return $?
local pool_config=""
# Try cPanel paths first (most common)
# cPanel typically names pools after the domain
if [ -n "$domain" ]; then
pool_config=$(find /opt/cpanel/ea-php*/root/etc/php-fpm.d/ -name "$domain.conf" 2>/dev/null | head -1)
[ -n "$pool_config" ] && { echo "$pool_config"; return 0; }
fi
# Fallback: search common locations
# Try username
pool_config=$(find /opt/cpanel/ea-php*/root/etc/php-fpm.d/ -name "$username.conf" 2>/dev/null | head -1)
[ -n "$pool_config" ] && { echo "$pool_config"; return 0; }
# Try matching any domain under this user
if [ -n "$domain" ]; then
pool_config=$(find /opt/cpanel/ea-php*/root/etc/php-fpm.d/ -name "*$domain*" 2>/dev/null | head -1)
[ -n "$pool_config" ] && { echo "$pool_config"; return 0; }
fi
# Try Debian/Ubuntu paths
local common_paths=(
"/etc/php-fpm.d/${username}.conf"
"/etc/php/7.4/fpm/pool.d/${username}.conf"