PHP CLI vs PHP-FPM version mismatches

phpphp-fpmhostingtroubleshooting

php -v tells you something true—just not always the version that serves your site. On servers with multiple PHP versions, CLI and PHP-FPM can differ, which leads to confusion when debugging.

Symptoms

Fix pattern

FAQ

How do I know which PHP version the site uses?
Check the Apache vhost: it will point to a specific PHP-FPM socket or pool. That pool’s config (e.g. in /etc/php/8.2/fpm/pool.d/) is the version serving that site. See PHP version drift on multi-site servers for documenting and cleaning this up.