PHP Configuration
OPcache Settings
Section titled “OPcache Settings”[opcache]opcache.enable=1opcache.memory_consumption=256opcache.interned_strings_buffer=64opcache.max_accelerated_files=30000opcache.validate_timestamps=0opcache.save_comments=1opcache.jit_buffer_size=256Mopcache.jit=1255validate_timestamps=0 disables file modification checks. Config/route/view caches must be rebuilt on deploy.
Memory Settings
Section titled “Memory Settings”memory_limit=512Mpost_max_size=100Mupload_max_filesize=100Mmax_execution_time=60max_input_time=60PHP-FPM Pool
Section titled “PHP-FPM Pool”[www]user = www-datagroup = www-datalisten = 127.0.0.1:9000
pm = dynamicpm.max_children = 50pm.start_servers = 5pm.min_spare_servers = 5pm.max_spare_servers = 35pm.max_requests = 500Process Manager Modes
Section titled “Process Manager Modes”| Mode | Behavior |
|---|---|
| static | Fixed number of children |
| dynamic | Scale between min/max |
| ondemand | Spawn on request |
dynamic balances memory usage and response time.
Recommended Tuning
Section titled “Recommended Tuning”For production, adjust based on available memory:
max_children = (Total RAM - OS overhead) / Average PHP process sizeTypical PHP process: 30-50MB. On a 4GB server:
max_children = (4000 - 500) / 40 = ~87Start conservative and monitor memory usage.