Commit Graph

2 Commits

Author SHA1 Message Date
cschantz 4f1e54d3d4 CRITICAL: Fix PHP-FPM pool detection - search by domain name not username
Problem:
- find_fpm_pool_config() only searched for $username.conf
- cPanel EA-PHP names pool configs as $domain.conf
- Example: pickledperil.com.conf NOT pickledperil.conf
- Result: 'No PHP-FPM pools found' error

Fix:
- Modified find_fpm_pool_config() to try domain-based naming first
- Falls back to username-based naming for compatibility
- Search order: domain → username
- Applies to all control panels (cPanel, Plesk, InterWorx)

Impact:
- PHP-FPM pools now detected correctly
- Memory capacity analysis now works
- All pool-based features functional

Test:
- find_fpm_pool_config('pickledperil', 'pickledperil.com')
- Returns: /opt/cpanel/ea-php81/root/etc/php-fpm.d/pickledperil.com.conf
2025-12-03 01:15:04 -05:00
cschantz 9ebf06a62e Fix SCRIPT_DIR variable collision in PHP libraries
CRITICAL BUG FIX:

Problem: php-detector.sh and php-analyzer.sh were setting SCRIPT_DIR
which collided with parent script's SCRIPT_DIR variable causing
/lib/lib/ double path bug when sourcing libraries.

Solution:
- Changed SCRIPT_DIR to _LIB_DIR in both php-detector.sh and php-analyzer.sh
- Changed exit 1 to return 1 in sourced libraries (exit kills parent script)

Files modified:
- lib/php-detector.sh: Use _LIB_DIR instead of SCRIPT_DIR
- lib/php-analyzer.sh: Use _LIB_DIR instead of SCRIPT_DIR, return instead of exit

This prevents variable collision when libraries are sourced by modules.
2025-12-03 00:52:44 -05:00