Check PHP extensions before an upgrade
This task is for administrators preparing a PHP upgrade, a move to a new server or an Exponential upgrade. At the end you know which PHP extensions the target machine lacks and have the command to install them (Deploying, section 2).
Contents
Before you start
- Shell access on the target machine (staging first).
Steps
PHP version and extensions:
php -v | head -1 ./console exp:velocity ext check --allow-root-userThe second lists every PHP extension the installation wants, marks what is missing and prints the install command for the system (for example
sudo dnf install -y php-<name>). Missing optional extensions do not stop the site.The web server's PHP can differ from the command line's: open Setup > System information through the web server; the health checks PHP extensions (failure when a required one is missing) and Recommended extensions (curl, fileinfo, intl, xsl, OPcache, APCu, gd or imagick) cover it.
Code that a newer PHP will refuse:
sort var/log/deprecated.log | uniq -c | sort -rn | headGive the list to your developers; your own extensions are the usual source.
Install what is missing, then restart PHP-FPM or Velocity so the extensions load.
Check it worked
./console exp:velocity ext check --allow-root-usershows nothing missing for the features you use.- Setup > System information has no red PHP checks.
php -m | grep fileinfo(fileinfo matters for upload checks).
Related pages
- PHP and database upgrades
- PHP versions and extensions (hosting)
- PHP upgrade (hosting runbook)
- Requirements
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.