Configuration Files
Directory Structure
Section titled “Directory Structure”PHM installs each PHP version in a separate directory:
/opt/php/8.5/├── bin/ # Executables│ ├── php│ ├── phpize│ ├── php-config│ └── pecl├── sbin/│ └── php-fpm # PHP-FPM├── etc/│ ├── cli/│ │ └── php.ini # CLI configuration│ ├── fpm/│ │ └── php.ini # FPM configuration│ ├── php-fpm.conf # Main FPM configuration│ ├── php-fpm.d/│ │ └── www.conf # Pool configuration│ └── conf.d/ # Extension configuration│ ├── 10-opcache.ini│ └── 20-redis.ini└── lib/php/extensions/ └── no-debug-non-zts-*/ # Extension files (.so) ├── redis.so └── ...CLI vs FPM Differences
Section titled “CLI vs FPM Differences”PHM uses separate php.ini files for CLI and FPM:
| Setting | CLI | FPM |
|---|---|---|
memory_limit | -1 (unlimited) | 128M |
max_execution_time | 0 (unlimited) | 30 |
display_errors | On | Off |
Changing memory_limit
Section titled “Changing memory_limit”For CLI
Section titled “For CLI”# Edit the CLI php.ini filenano /opt/php/8.5/etc/cli/php.ini
# Or append to the file:echo "memory_limit = 512M" >> /opt/php/8.5/etc/cli/php.iniFor FPM
Section titled “For FPM”# Edit the FPM php.ini filenano /opt/php/8.5/etc/fpm/php.ini
# Or append to the file:echo "memory_limit = 256M" >> /opt/php/8.5/etc/fpm/php.ini
# Restart PHP-FPMphm fpm restart 8.5Managing Extensions
Section titled “Managing Extensions”PHM makes it easy to enable and disable extensions:
| Command | Description |
|---|---|
phm ext list | List extensions |
phm ext enable redis | Enable extension |
phm ext disable xdebug | Disable extension |
phm ext enable opcache --sapi fpm | Enable for FPM only |
Extension Configuration Files
Section titled “Extension Configuration Files”Extensions are configured via .ini files in the conf.d directory:
/opt/php/8.5/etc/conf.d/├── 10-opcache.ini # Loaded first (priority 10)├── 20-redis.ini # Loaded second (priority 20)├── 20-igbinary.ini└── 20-mongodb.iniExample .ini Files
Section titled “Example .ini Files”extension=redis.so
# 10-opcache.ini (uses zend_extension)zend_extension=opcache.soopcache.enable=1opcache.memory_consumption=128opcache.interned_strings_buffer=8opcache.max_accelerated_files=10000