Configure PHP Settings in rConfig V8 Core
After reading this page, you can locate the active php.ini file on your rConfig V8 Core server, raise the memory_limit and max_execution_time values to suit your device count, and confirm the new values took effect. This prevents the timeout and out-of-memory failures that hit large configuration downloads, reports, and bulk operations.
When to use this
Section titled “When to use this”PHP ships with conservative defaults (often 128M memory and a 30 second execution limit) that suit small web apps but not a network configuration manager processing large config files across many devices. Tune these settings when you see “Allowed memory size exhausted” errors, tasks that fail part way through, or sluggish reports as your inventory grows.
Prerequisites
Section titled “Prerequisites”- Shell access to the rConfig server with
sudoprivileges - The PHP version your install uses (run
php -vto confirm, usually 8.3) - A maintenance window, since editing
php.inirequires a PHP and web server restart - Familiarity with the V8 Core installation guide layout
Which PHP settings matter most?
Section titled “Which PHP settings matter most?”memory_limit
Section titled “memory_limit”memory_limit is the maximum memory a single PHP process can use before PHP terminates it. rConfig needs headroom here when processing large config files, generating reports with extensive history, or running bulk operations across many devices. Too little shows up as “Allowed memory size exhausted” errors during downloads, report generation, or bulk actions.
max_execution_time
Section titled “max_execution_time”max_execution_time is how long a PHP script may run before PHP kills it. The default protects the server from runaway processes but can cut off legitimate long operations such as downloading configs from hundreds of devices or generating large audit reports. The queue system handles most long-running work in the background, so prefer it over ever-larger execution times for very large jobs.
Recommended values
Section titled “Recommended values”These values assume a server dedicated to rConfig, where PHP is the primary memory consumer. They allocate roughly 75-85% of RAM to PHP, leaving the rest for the OS, database, and web server. Reduce them if other memory-intensive applications share the host.
| Server RAM | Recommended memory_limit | Deployment size |
|---|---|---|
| 4GB | 3072M (3GB) | Small: under 500 devices |
| 8GB | 6144M (6GB) | Medium: 500-1,000 devices |
| 16GB | 12288M (12GB) | Large: 1,000-5,000 devices |
| 32GB+ | 28672M (28GB) | Enterprise: 10,000+ devices |
| Environment size | Recommended max_execution_time | Rationale |
|---|---|---|
| Small (under 100 devices) | 300 seconds (5 minutes) | Most operations finish within this window |
| Medium (100-500 devices) | 600 seconds (10 minutes) | Bulk operations need extended processing |
| Large (500-1,500 devices) | 900 seconds (15 minutes) | Tasks span many devices |
| Enterprise (1,500+ devices) | 1200 seconds (20 minutes) | Large-scale operations need the most time |
Find the active php.ini file
Section titled “Find the active php.ini file”PHP can use different php.ini files for the web server (PHP-FPM or Apache) and for command-line and queue operations. Settings must match across both for rConfig to behave consistently. Print the active file with:
php -i | grep "Loaded Configuration File"Common locations:
- Ubuntu/Debian:
/etc/php/8.3/fpm/php.ini,/etc/php/8.3/apache2/php.ini,/etc/php/8.3/cli/php.ini - CentOS/RHEL/Rocky/AlmaLinux:
/etc/php.inifor FPM, Apache, and CLI
Edit and apply the settings
Section titled “Edit and apply the settings”-
Confirm your PHP version and the active config file path.
Terminal window php -vphp -i | grep "Loaded Configuration File" -
Back up the configuration file. If you run Apache rather than PHP-FPM, back up its
php.initoo.Terminal window sudo cp /etc/php/8.3/fpm/php.ini /etc/php/8.3/fpm/php.ini.backup.$(date +%Y%m%d)sudo cp /etc/php/8.3/apache2/php.ini /etc/php/8.3/apache2/php.ini.backup.$(date +%Y%m%d) -
Open the configuration file in an editor.
Terminal window sudo nano /etc/php/8.3/fpm/php.ini -
Locate
memory_limit. PressCtrl+W, typememory_limit, press Enter. Change the value to suit your server RAM, for example:memory_limit = 6144M -
Locate
max_execution_time. PressCtrl+W, typemax_execution_time, press Enter. Change the value to suit your deployment size, for example:max_execution_time = 600 -
Save and exit. Press
Ctrl+O, thenEnterto confirm, thenCtrl+X. -
Restart PHP and your web server.
Terminal window # PHP-FPM with Nginxsudo systemctl restart php8.3-fpmsudo systemctl restart nginx# Apachesudo systemctl restart apache2 -
Verify the new values.
Terminal window php -i | grep memory_limitphp -i | grep max_execution_time
-
Confirm your PHP version and the active config file path.
Terminal window php -vphp -i | grep "Loaded Configuration File" -
Back up the configuration file.
Terminal window sudo cp /etc/php.ini /etc/php.ini.backup.$(date +%Y%m%d) -
Open the configuration file in an editor.
Terminal window sudo vi /etc/php.ini -
Locate
memory_limit. Press/, typememory_limit, press Enter, then pressito edit. Change the value to suit your server RAM, for example:memory_limit = 6144M -
Locate
max_execution_time. PressEsc, then/, typemax_execution_time, press Enter, then pressito edit. Change the value to suit your deployment size, for example:max_execution_time = 600 -
Save and exit. Press
Esc, type:wq, press Enter. -
Restart PHP and your web server.
Terminal window # PHP-FPM with Nginxsudo systemctl restart php-fpmsudo systemctl restart nginx# Apachesudo systemctl restart httpdsudo systemctl restart php-fpm -
Verify the new values.
Terminal window php -i | grep memory_limitphp -i | grep max_execution_time
Confirm the change took effect
Section titled “Confirm the change took effect”The command-line check above verifies the values used by CLI scripts and queue workers. To confirm the web interface also picked up the change, run a resource-intensive task such as generating a large report, then check the Application Log for any memory or timeout errors. If the operation completes cleanly, the configuration is adequate.
If you also cleared application caches as part of an update, refresh the rConfig cache so it does not serve stale config:
php /var/www/html/rconfig/artisan rconfig:clear-allThis command clears the Laravel cache and config. See the CLI commands reference for full details. It is not required just for a php.ini change, but it is useful after broader configuration work.
Common gotchas
Section titled “Common gotchas”What’s next
Section titled “What’s next”- Horizon Queue Manager to offload large operations to background workers instead of raising execution limits.
- System Logs to view PHP errors and exceptions when troubleshooting.
- Update PHP on your rConfig server when moving to a newer PHP version.