Skip to content

rConfig - PHP Settings

3 mins V7 Pro V6 Core

rConfig relies on PHP to execute its core functionality. Understanding and properly configuring key PHP settings can significantly impact system performance and stability, particularly when dealing with large network environments or resource-intensive operations.

Key PHP Settings

Two critical PHP configuration settings directly affect rConfig’s performance and ability to handle large workloads:

SettingDescriptionRecommendation
max_execution_timeMaximum time in seconds a script is allowed to run before it is terminated300-600 seconds for environments with many devices
memory_limitMaximum amount of memory a script may consumeAllocating a much larger portion of your available RAM to PHP (see guidelines below)

Memory Limit

The memory_limit setting defines how much memory a PHP script can consume. For rConfig, this is especially important when:

  • Processing large configuration files
  • Executing tasks across hundreds of devices simultaneously
  • Running complex compliance checks
  • Generating reports with extensive data

For dedicated rConfig servers, we recommend allocating a much larger portion of your available RAM to PHP:

Server RAMRecommended memory_limit (dedicated server)
4GB3072M (3GB)
8GB6144M (6GB)
16GB12288M (12GB)
32GB+28672M (28GB)

For servers with multiple applications, adjust these values based on resource allocation across all services. Remember that setting memory_limit too high on a shared system could negatively impact other applications.

Execution Time

The max_execution_time setting controls how long a PHP script can run before PHP automatically terminates it.

Environment SizeRecommended max_execution_time
Small (< 100 devices)300 seconds (5 minutes)
Medium (100-500 devices)600 seconds (10 minutes)
Large (500+ devices)900-1200 seconds (15-20 minutes)

How to Modify PHP Settings

PHP settings can be modified in this ways:

  1. php.ini file (recommended)

    • Locate your active php.ini file (typically in /etc/php/x.x/apache2/ or /etc/php/x.x/fpm/)
    • Modify the settings and restart your web server
  2. Through .htaccess (for Apache)

    php_value memory_limit 4096M
    php_value max_execution_time 600

Step-by-Step Guide to Change PHP Settings

  1. Find the active PHP version:
Terminal window
php -v
  1. Locate your php.ini file:
Terminal window
php -i | grep "Loaded Configuration File"

This will show something like: /etc/php.ini

  1. Create a backup of your php.ini file:
Terminal window
sudo cp /etc/php.ini /etc/php.ini.backup
  1. Edit the php.ini file:
Terminal window
sudo vi /etc/php.ini
  1. Find and modify the settings:
  • Press / to search
  • Type memory_limit and press Enter
  • Change the value using i to enter insert mode
  • Change from something like memory_limit = 128M to memory_limit = 4096M
  • Search for “max_execution_time” with /max_execution_time
  • Change the value from something like max_execution_time = 30 to max_execution_time = 600
  • Press ESC to exit insert mode
  • Type :wq and press Enter to save and quit
  1. Restart your web server:
  • For Apache:
Terminal window
sudo systemctl restart httpd
  • For Nginx with PHP-FPM:
Terminal window
sudo systemctl restart php-fpm
sudo systemctl restart nginx

Verifying Your Changes

After making changes, verify they’ve been applied correctly:

  1. Create a PHP info file:
Terminal window
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/phpinfo.php
  1. Access the file in your browser:
  • Navigate to http://your-rconfig-server/phpinfo.php
  • Search for “memory_limit” and “max_execution_time” to verify your new settings
  1. Remove the phpinfo file for security:
Terminal window
sudo rm /var/www/html/phpinfo.php

Need Help?

If you’re experiencing performance issues even after adjusting these settings, please open a support ticket with details about your environment and the specific operations causing problems.