diff --git a/lib/php-analyzer.sh b/lib/php-analyzer.sh index 89a85a0..ee98909 100644 --- a/lib/php-analyzer.sh +++ b/lib/php-analyzer.sh @@ -678,7 +678,7 @@ analyze_domain_php() { if [ -n "$pool_config" ] && [ -f "$pool_config" ]; then current_max_children=$(grep "^pm.max_children" "$pool_config" | awk -F'=' '{print $2}' | tr -d ' ') - if [ "$recommended" -ne "$current_max_children" ]; then + if [ -n "$current_max_children" ] && [ "$recommended" -ne "$current_max_children" ]; then echo " 1. Adjust pm.max_children from $current_max_children to $recommended" echo " Reason: $reason" fi diff --git a/modules/performance/php-optimizer.sh b/modules/performance/php-optimizer.sh index 0a53936..d5f62dd 100755 --- a/modules/performance/php-optimizer.sh +++ b/modules/performance/php-optimizer.sh @@ -504,7 +504,7 @@ optimize_domain() { if [ -n "$pool_config" ] && [ -f "$pool_config" ]; then # Apply max_children change if recommended - if [ -n "$recommended_max_children" ] && [ "$recommended_max_children" -ne "$current_max_children" ]; then + if [ -n "$recommended_max_children" ] && [ -n "$current_max_children" ] && [ "$recommended_max_children" -ne "$current_max_children" ]; then if modify_fpm_pool_setting "$pool_config" "pm.max_children" "$recommended_max_children" >/dev/null 2>&1; then cecho " ${GREEN}✓${NC} Set pm.max_children = $recommended_max_children" changes_made=$((changes_made + 1))