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

Related Articles

How to Restore Your cPanel Account: A Complete Guide for New System Administrators

This guide explains how new system administrators can restore a cPanel account using WHM, transfer accounts and configurations between servers, and enable diagnostic logging for transfer and restore operations. It covers essential concepts such as WHM vs. cPanel, root access, backup handling, SFTP uploads, transfer methods, and advanced debugging tools.

Continue

آموزش کامل انتقال تمام اکانت‌های cPanel از یک سرور به سرور دیگر

این مقاله نحوه انتقال همه اکانت‌های cPanel، تنظیمات سرویس‌ها، گواهی‌های SSL و IP اصلی سرور را از یک سرور قدیمی (Source) به یک سرور جدید (Target) توضیح می‌دهد. شامل نصب سرور جدید، انتقال تنظیمات، انتقال اکانت‌ها، تغییر IP، تنظیم DNS و نصب مجدد SSL است.

Continue

How to Migrate a WordPress® Installation to a cPanel & WHM Server

This guide explains how to migrate a WordPress installation from a macOS-hosted environment to a cPanel & WHM server. It covers exporting the database, uploading WordPress files, creating and importing a MySQL database, updating URLs, configuring wp-config.php, fixing broken links, and finalizing the migration.

Continue

How to Manually Transfer an Account Between Servers in cPanel & WHM

This article explains how to manually transfer a cPanel account between servers when the account is too large for WHM’s automated transfer tools. It covers creating temporary directories, compressing public_html and log files, securely transferring data with SCP, and restoring the files on the destination server.

Continue

How to Manually Migrate Horde Calendars and Contacts to Roundcube in cPanel & WHM

This article explains how to manually migrate Horde calendars and contacts to Roundcube in cPanel & WHM version 108 through 118. It covers exporting Horde data, placing it in the correct directories, and importing it into Roundcube using built‑in plugins or manual import tools.

Continue

How to Manually Migrate Accounts to cPanel & WHM from Unsupported Control Panels

This article explains how experienced system administrators can manually migrate accounts from unsupported third‑party control panels to cPanel & WHM. It covers pre‑migration steps, installation requirements, file and directory transfers, database restoration, SSL migration, and post‑migration tasks.

Continue