---
title: "PHP-FPM Settings for Better Optimization"
description: "After enabling PHP-FPM (PHP-FastCGI Process Manager) on your VPS, you'll need to know how to restart the PHP-FPM service and modify its settings. Below we cover how to adjust PHP-FPM settings..."
url: https://www.inmotionhosting.com/support/server/php-fpm/php-fpm-settings-for-better-optimization/
date: 2018-09-19
modified: 2023-08-15
author: "InMotion Hosting Contributor"
categories: ["PHP-FPM"]
type: post
lang: en
---

# PHP-FPM Settings for Better Optimization

After [enabling PHP-FPM](/support/server/php-fpm/how-to-enable-php-fpm-using-whm/) (PHP-FastCGI Process Manager) on your [VPS](https://www.inmotionhosting.com/vps-hosting), you’ll need to know how to [restart the PHP-FPM service](/support/server/php-fpm/how-to-restart-php-fpm/) and modify its settings. Below we cover how to **adjust PHP-FPM settings** according to traffic load per cPanel account.

1. [Login WHM as Root](/support/edu/whm/log-into-whm/#whm-root-access).
2. From the menu, search and select **MulitiPHPManager**.
3. [![Enable PHP-FPM](https://www.inmotionhosting.com/support/images/stories/whm/multiphp-manager/php-fpm/whm-php-fpm-5-multiphpmanager-enable.png)](https://www.inmotionhosting.com/support/images/stories/whm/multiphp-manager/php-fpm/whm-php-fpm-5-multiphpmanager-enable.png) Select **Turn on** to **enable PHP-FPM for all cPanel accounts**. Alternatively, you can select the checkbox beside specific domains at the bottom, choose *On* from the dropdown menu beside **PHP-FPM**, and select **Apply**. You can also [change the PHP version](/support/website/how-to-change-the-php-version-your-account-uses/) here instead of in cPanel.
4. Select **Pool Options** beside the specified domain.
5. [![Edit PHP-FPM settings](https://www.inmotionhosting.com/support/images/stories/whm/multiphp-manager/php-fpm/whm-php-fpm-4-multiphpmanager.png)](https://www.inmotionhosting.com/support/images/stories/whm/multiphp-manager/php-fpm/whm-php-fpm-4-multiphpmanager.png) **Modify PHP-FPM settings for the domain**. Below are commonly successful changes according to amount of traffic your VPS receives. Traffic Load Average Heavy Max Children 25-35 40-60 Process Idle Timeout 100 100-150 Max Requests 200-350 400-600

## Edit Default PHP-FPM Settings

If you have many cPanel accounts, you may prefer to **change the default settings** for newly created cPanel accounts.

1. As [root](/support/amp/obtain-root-access/), [SSH into your server](/support/server/ssh/how-to-login-ssh/) or launch [WHM terminal](/support/edu/cpanel/how-to-launch-the-cpanel-terminal/).
2. **Create a *system_pool_defaults.yaml* file** in the `/var/cpanel/ApachePHPFPM` directory. To do this using nano, type the following: `nano /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml`Add the following to the new file:`php_value_error_reporting: 'E_ALL' pm_max_children: 500 pm_max_requests: 2000 pm_min_spare_servers: 1 pm_max_spare_servers: 25 pm_process_idle_timeout: 150 php_value_disable_functions: 0`** pm_[max_children](https://www.inmotionhosting.com/support/server/php-fpm/fix-max-children-error/):** Max number of child processes **pm_max_requests:** Number of requests a child process executes before respawning. **pm_min_spare_servers:** Minimum idle server processes **pm_max_spare_servers:** Maximum idle server processes **pm_process_idle_timeout:** Time until an idle process is killed in s(econds), m(inutes), m(inutes), h(ours), or d(ays). **php_value_disable_functions:** Functions to disable. This doesn’t overwrite php.ini settings.
3. Save and exit the file. Using nano, press Control and x for the save prompt before exiting. Press y, then Enter ⤶ to save the file.
4. **Rebuild PHP-FPM** using the following command: `/scripts/php_fpm_config --rebuild`
5. **Restart PHP-FPM** using the following command: `/scripts/restartsrv_apache_php_fpm` **Note:**You can also [restart **PHP-FPM** from WHM](/support/server/php-fpm/how-to-restart-php-fpm/).

These adjustments should help you make the most out of your VPS optimization and [PHP hosting](https://www.inmotionhosting.com/php-hosting). You can learn more configuration options for PHP-FPM with [official cPanel documentation](https://documentation.cpanel.net/display/68Docs/Configuration+Values+of+PHP-FPM). You can read more about the benefits of PHP-FPM in [our in-depth article](/support/server/php-fpm/php-fpm-the-future-of-php-handling/).
