How to Manage Your php.ini Directives with PHP‑FPM and Set PHP Version Recommendations

This guide explains how to manage php.ini directives when PHP‑FPM is enabled and how to configure PHP version recommendations in cPanel’s MultiPHP Manager. It covers verifying PHP‑FPM, creating a phpinfo file, reviewing and modifying directives globally or per domain, and editing the JSON configuration for recommended PHP versions.

PHP-FPM configurationphp.ini directivesPHP version recommendations

~3 min read • Updated Feb 21, 2026

1. Introduction


This tutorial explains how to manage your php.ini directives when PHP‑FPM is enabled. PHP‑FPM is enabled by default in cPanel & WHM.


Note: You can edit php.ini directives at both the domain and system level using WHM’s MultiPHP Manager interface.


2. Manage php.ini Directives


2.1 Confirm PHP‑FPM Is Enabled


  1. Log in to WHM as the root user.
  2. Navigate to:
    WHM » Home » Software » MultiPHP Manager
  3. In the domains table, ensure the PHP‑FPM toggle is set to On for the domain.

PHP‑FPM is enabled by default.


2.2 Create a phpinfo File


You can use a phpinfo file to view the domain’s current PHP settings.


  1. SSH into the server as root.
  2. Navigate to the domain’s document root.
  3. Create a file named phpinfo.php with the following content:



Set the correct ownership and permissions:


chmod 0644 /home/username/public_html/phpinfo.php
chown username.username /home/username/public_html/phpinfo.php

Access the file in your browser:
https://example.com/phpinfo.php
If PHP‑FPM is active, the ServerAPI value will show FPM/FastCGI.


2.3 Review php.ini Directives


You can review directives in:

  • cPanel’s MultiPHP INI Editor (per‑domain)
  • WHM’s MultiPHP INI Editor (global)

Default PHP‑FPM directives include:

php_admin_flag[allow_url_fopen] = on
php_admin_flag[log_errors] = on
php_admin_value[disable_functions] = exec,passthru,shell_exec,system
php_admin_value[doc_root] = "/home/username/public_html"
php_admin_value[error_log] = /home/username/logs/domain_com.php.error.log
php_admin_value[short_open_tag] = on
php_value[error_reporting] = E_ALL & ~E_NOTICE

3. Modify php.ini Directives


3.1 Modify Directives Globally


To modify global php.ini directives for each PHP version, use WHM’s MultiPHP INI Editor.


To modify PHP‑FPM pool settings:

  1. Connect via SSH.
  2. Create the directory:
    /var/cpanel/ApachePHPFPM
  3. Create the file:
    /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml
  4. Add your desired directives, for example:

---
php_admin_value_memory_limit: { name: 'php_admin_value[memory_limit]', value: 120M }

Rebuild PHP‑FPM configuration:


/usr/local/cpanel/scripts/php_fpm_config --rebuild

Restart services:


/usr/local/cpanel/scripts/restartsrv_apache_php_fpm
/usr/local/cpanel/scripts/restartsrv_httpd

3.2 Modify Directives for a Single Domain


  1. Connect via SSH.
  2. Create the file:
    /var/cpanel/userdata/username/domain.com.php-fpm.yaml
  3. Add the directives you want to modify.

Disable passthru and system:

---
_is_present: 1
php_admin_value_disable_functions: { name: 'php_admin_value[disable_functions]', value: passthru,system }

Enable all functions:

---
_is_present: 1
php_admin_value_disable_functions: { name: 'php_admin_value[disable_functions]', value: none }

Rebuild PHP‑FPM configuration:


/usr/local/cpanel/scripts/php_fpm_config --rebuild

Restart services:


/usr/local/cpanel/scripts/restartsrv_apache_php_fpm
/usr/local/cpanel/scripts/restartsrv_httpd



4. Set PHP Version Recommendations


PHP version recommendations appear in MultiPHP Manager and are stored in a JSON file.


4.1 Configuration File Location


The recommendations file is located at:


/etc/cpanel/ea4/recommendations/custom_php_recommendation.json


Example content:


{"versions":[ "php54", "php72", "php74" ]}

The versions key contains an array of recommended PHP versions.




Conclusion


This guide covers how to manage php.ini directives with PHP‑FPM and configure PHP version recommendations in cPanel. These tools help administrators fine‑tune PHP performance, security, and version visibility across domains.


Written & researched by Dr. Shahin Siami