Skip to content

Bulk PHP version updates across 100+ Plesk sites — compatibility audit and rollout

Updating PHP across a Plesk fleet is not a button. It's an audit of every site's plugin set, a staged rollout, and a rollback plan when one site breaks at midnight.

PHP 8.1 reaches end of security support, and you have a Plesk fleet with 120 sites still pinned to it. The Plesk panel offers a “PHP version” dropdown per subscription, and the temptation is to just iterate through and flip them all to 8.3. That works for maybe 100 of them. The other 20 break in ways that range from “homepage white screen” to “checkout form silently fails to submit” to “WP cron is now throwing fatals that the customer’s monitoring doesn’t catch for six hours”. The right rollout is a compatibility audit, a staged rollout in waves, and a rollback path for every wave.

What’s happening

Plesk supports multiple parallel PHP versions through its plesk-php* package family — plesk-php74, plesk-php80, plesk-php81, plesk-php82, plesk-php83, etc. Each is installed under /opt/plesk/php/<version>/, with its own php-fpm, php-cli, php.ini, and per-domain pool configs. Each subscription picks one of the installed versions; switching versions in the panel rewrites the per-domain FPM pool config and reloads FPM.

The mechanics of switching are trivial. The risk is application code. Common breakages across versions:

  • 7.4 → 8.0: each() removed, curly-brace string offsets removed, default track_errors=0, mbstring.func_overload removed, several PEAR packages no longer compatible.
  • 8.0 → 8.1: strftime() deprecated, internal method signature compatibility warnings escalated to fatals, nullable parameter implicit declaration deprecated.
  • 8.1 → 8.2: dynamic properties deprecated, utf8_encode/decode deprecated, ${var} string interpolation deprecated, MT_RAND_PHP removed.
  • 8.2 → 8.3: assert() semantic changes, Random\Randomizer API additions (not breakage), some readonly property edge cases.

WordPress plugins that haven’t been updated in 18+ months are the highest-risk surface. Custom Laravel/Symfony apps in the fleet usually have explicit version constraints in composer.json that fail at install time, which is easier to detect than a runtime fatal.

How to verify

Per-domain PHP version inventory:

# Plesk DB query that gives you every domain's current PHP handler
plesk db -Ne "SELECT d.name, h.value AS handler \
  FROM domains d \
  JOIN domain_php_settings s ON s.dom_id=d.id \
  JOIN php_handlers h ON h.id=s.handler_id \
  WHERE d.parentDomainId=0"

# Or simpler — one line per subscription
for D in $(plesk bin subscription --list); do
  PHP=$(plesk bin domain --info $D 2>/dev/null | awk -F': ' '/PHP version/ {print $2}' | tr -d ' ')
  echo "$D $PHP"
done | tee /root/php-inventory.txt

Available versions installed on the host:

plesk bin php_handler --list
# Or just look at the package list
rpm -qa | grep plesk-php   # AlmaLinux
dpkg -l | grep plesk-php   # Ubuntu

Per-domain plugin/code inventory for WordPress sites:

# Plesk includes WP-CLI; loop it over WP installs
for D in $(plesk db -Ne "SELECT name FROM domains WHERE parentDomainId=0"); do
  WP_PATH=/var/www/vhosts/$D/httpdocs
  [[ -f "$WP_PATH/wp-config.php" ]] || continue
  echo "=== $D ==="
  sudo -u $(stat -c '%U' "$WP_PATH") wp plugin list --field=name,version,update --path="$WP_PATH" 2>/dev/null | head -20
done > /root/wp-plugin-inventory.txt

The fix

Four phases: audit, target version selection, staged rollout, post-roll validation.

Phase 0 — Compatibility audit per domain

For PHP fatals, the cleanest signal is to run a static analyzer against the codebase at the target version. PHPCompatibility is the standard tool:

# Install once
composer global require --dev phpcompatibility/php-compatibility
ln -sf ~/.composer/vendor/bin/phpcs /usr/local/bin/phpcs
phpcs --config-set installed_paths ~/.composer/vendor/phpcompatibility/php-compatibility

# Per-domain scan against PHP 8.3
for D in $(plesk db -Ne "SELECT name FROM domains WHERE parentDomainId=0"); do
  WEBROOT=/var/www/vhosts/$D/httpdocs
  [[ -d "$WEBROOT" ]] || continue
  echo "=== $D ==="
  phpcs --standard=PHPCompatibility --runtime-set testVersion 8.3 \
    --extensions=php --report=summary "$WEBROOT" 2>/dev/null | tail -5
done > /root/php83-compat-report.txt

PHPCompatibility is conservative — it’ll flag deprecations as well as outright errors. Filter to just ERROR rows:

grep 'A TOTAL OF.*ERROR' /root/php83-compat-report.txt

Domains with zero errors are safe candidates for the first wave. Domains with errors need either a plugin update, a code fix, or a delayed migration.

For WordPress specifically, use WP-CLI to check plugin compatibility:

for D in $(plesk db -Ne "SELECT name FROM domains WHERE parentDomainId=0"); do
  WP_PATH=/var/www/vhosts/$D/httpdocs
  [[ -f "$WP_PATH/wp-config.php" ]] || continue
  USER=$(stat -c '%U' "$WP_PATH")

  # Check plugin compatibility via the WP plugin API
  sudo -u $USER wp plugin list --format=json --path="$WP_PATH" 2>/dev/null | \
    jq -r '.[] | "\(.name) \(.version)"' | while read PLUGIN VER; do
    REQ=$(curl -s "https://api.wordpress.org/plugins/info/1.0/${PLUGIN}.json" 2>/dev/null | \
      jq -r '.requires_php // "unknown"')
    echo "$D $PLUGIN $VER requires_php=$REQ"
  done
done > /root/wp-plugin-php-requirements.txt

Any plugin where requires_php is older than your target and the plugin hasn’t been updated in 2+ years is a red flag — the metadata says it works, but nobody’s actually tested it on the new PHP.

Phase 1 — Target version selection

Three choices, in order of conservatism:

  1. Move everything one minor version up. From 8.1 to 8.2. Lowest blast radius. Buys you another year before EOL.
  2. Move everything two minor versions up. From 8.1 to 8.3. Larger compatibility surface but you’re on the current security branch.
  3. Move the safe domains forward, leave the rest on the current version with a paid-extended-support source. A few hosts (Cloudflare, Plesk itself in some cases) offer security backports for EOL PHP. Use as a bridge, not a destination.

For most fleets, option 1 is the right call. The rollout below targets that path.

Phase 2 — Staged rollout

Wave 1 — internal/test sites only. If you have any subscriptions on the Plesk box that are internal (status pages, test installs), flip them first:

# Mark a specific domain
plesk bin domain --update internal-test.example.com -php_handler plesk-php82-fpm

# Watch for errors over 30 minutes
tail -f /var/log/plesk-php82-fpm/error.log /var/www/vhosts/internal-test.example.com/logs/error_log

Wave 2 — small static-content sites. Brochure sites, single-page WordPress installs with no plugins, simple Laravel apps. Pick 10-20:

# Read from compatibility report
grep 'A TOTAL OF 0 ERROR' /root/php83-compat-report.txt | awk -F'===' '{print $2}' | head -20 > /root/wave2-list.txt

# Flip them
while read D; do
  echo "==> $D to PHP 8.2"
  plesk bin domain --update "$D" -php_handler plesk-php82-fpm
done < /root/wave2-list.txt

# Reload PHP-FPM
systemctl reload plesk-php82-fpm

After Wave 2, watch error logs for 24 hours:

# Aggregate fatal errors across all per-domain logs
find /var/www/vhosts/*/logs -name 'error_log' -newer /tmp/wave2-start -exec grep -l 'PHP Fatal' {} \; 2>/dev/null

If any site in Wave 2 throws fatals, that’s a learning — investigate, fix or roll back that single site, then proceed.

Wave 3 — busy WordPress sites. WooCommerce, sites with custom plugins, sites with high cron volume. Pick 20-30:

while read D; do
  echo "==> $D to PHP 8.2"
  plesk bin domain --update "$D" -php_handler plesk-php82-fpm
done < /root/wave3-list.txt
systemctl reload plesk-php82-fpm

Watch for 48 hours.

Wave 4 — everything else. Catch-all, after Wave 3 is clean.

Phase 3 — Per-wave rollback

If a site breaks, roll back just that one:

plesk bin domain --update broken-site.example.com -php_handler plesk-php81-fpm
systemctl reload plesk-php81-fpm

Notify the customer with the specific deprecation that broke their code. Schedule a follow-up to fix the code at the application layer.

Phase 4 — Validation

After all waves complete, audit:

# Confirm no domains are still on the old version
plesk db -Ne "SELECT d.name, h.value FROM domains d \
  JOIN domain_php_settings s ON s.dom_id=d.id \
  JOIN php_handlers h ON h.id=s.handler_id \
  WHERE h.value LIKE '%php81%' AND d.parentDomainId=0"

# Confirm FPM pools all loaded
systemctl status plesk-php82-fpm

# Confirm no fatal-loop sites
for D in $(plesk bin subscription --list); do
  COUNT=$(grep -c 'PHP Fatal' /var/www/vhosts/$D/logs/error_log 2>/dev/null)
  [[ "$COUNT" -gt 5 ]] && echo "$D: $COUNT fatals"
done

Cleanup

Once all sites are off the old version, remove the package to free disk and reduce attack surface:

plesk bin php_handler --remove plesk-php81-fpm
plesk bin php_handler --remove plesk-php81-cli
dnf -y remove plesk-php81-*   # or apt-get remove plesk-php81-* on Ubuntu

But don’t remove it until you’ve held a stable state for 30+ days — the moment you remove it, rolling back becomes a re-installation, not a config flip.


Stack Harbor runs fleet-wide PHP version rollouts under environment management — including the compatibility audit, the wave plan, and the rollback drill. Pair with monitoring and support so fatals after each wave page the on-call team. Contact us if your fleet is staring down a PHP EOL with no plan.