Skip to content

Migrating a cPanel server from DSO to PHP-FPM without weekend downtime

A staged plan for moving a cPanel server off the DSO PHP handler onto PHP-FPM — including the MPM swap, per-account validation, and the rollback path if a vhost regresses.

A DSO-to-FPM migration is the single most common cPanel modernization. It is not a one-click change because DSO pins Apache to the prefork MPM, and FPM works much better with event. The migration is really two changes — the handler and the MPM — that should be sequenced, not bundled. Done in two short maintenance windows a day apart, it is uneventful. Done in one go without staging, it tends to wake the on-call.

What’s happening

Under DSO, PHP runs inside Apache’s process tree. Each Apache child has a PHP interpreter linked into it. Every request runs as the Apache user (nobody). This breaks per-account file ownership semantics and forces the prefork MPM because PHP’s runtime is not thread-safe in most distributions. Under PHP-FPM, each account has its own FPM pool running as the account user, Apache is just a proxy, and the MPM can be event — which scales much better with keep-alive connections.

How to verify

Before starting, baseline what is on the server:

whmapi1 php_get_system_default_handler
apachectl -V | grep MPM
whmapi1 php_get_vhost_versions | head -30
rpm -qa | grep ea-php | sort
ls /etc/cpanel/ea4/profiles/custom/

Save the current EA4 profile through WHM > EasyApache 4 > Customize > Review > Save as Profile. This is your rollback.

The fix

Day one — handler swap:

  1. Schedule a maintenance window during the slowest traffic hour. Notify customers.
  2. WHM > MultiPHP Manager > Apache MPM and PHP Handler > set to FastCGI (intermediate step, not FPM yet). Submit. Apache restarts.
  3. Validate every site. Hit a representative URL on each account. Watch /usr/local/apache/logs/error_log and per-account error_log. The most common breakage: .htaccess php_value directives that worked under DSO and now do nothing — pull the value into a .user.ini.
  4. Hold for 24 hours. Resolve any per-account regressions.

Day two — MPM swap and FPM:

  1. WHM > EasyApache 4 > Customize > Apache MPM > Event > Provision. Apache restarts.
  2. WHM > MultiPHP Manager > Apache MPM and PHP Handler > set to PHP-FPM. Submit.
  3. cPanel generates per-account FPM pool configs under /opt/cpanel/ea-php<ver>/root/etc/php-fpm.d/. Confirm pools start: systemctl status ea-php82-php-fpm.
  4. Validate every site again. Watch FPM logs at /opt/cpanel/ea-php<ver>/root/usr/var/log/php-fpm.log.
  5. Save the new EA4 profile.

Rollback path:

  1. WHM > MultiPHP Manager > set the handler back to FastCGI, then DSO, then re-provision the saved EA4 profile from day zero. The whole rollback takes 5 minutes.
  2. Do not try a partial rollback — the handler and MPM go together.

For environments where this migration sits alongside other modernization work, Stack Harbor sequences it as part of cPanel server administration.