How to fix PHP version readiness check issues in Magento 2

- Fire development, Magento 2

Magento 2 export CLI

If you encounter issues with the PHP version readiness check, read this article. Below, we shed light on what conditions are problematic. Besides, we describe how to avoid them, fixing the issues. You can find more useful tips here: Magento 2 Cookbook.

Unsupported PHP version 

The PHP version readiness check may fail since you’re using a PHP version that Magento doesn’t support. Check the supported PHP versions in System Requirements.

PHP version is not displayed

If the PHP readiness check in Magento 2 doesn’t display the PHP version (“Your PHP version is.”), you have to set up cron properly. You can learn how to do that here: Set up cron jobs.

Incorrect PHP version

A mismatch of PHP versions between the PHP CLI and the web server plug-in causes the check to report an incorrect PHP version. Usually, it happens when you install multiple PHP versions. However, it prevents the readiness check not always.

To fix the issue, you need to use the same PHP version for both the CLI and the web server. The former runs cron, the latter is responsible for the Magento Admin, Component Manager, and System Upgrade. Try the following resolution:

  • First of all, it is necessary to restart your web server.
  • Next, check the $PATH environment variable for several paths to PHP.
  • With the help of the which php command, locate the first PHP executable in your path.
  • Remove it if it is not correct. Alternatively, you can create a symlink to the correct PHP version.
  • Get more information on a phpinfo.php page.
  • Make sure a PHP version you run is supported (see System Requirements).
  • Now, you can set the same PHP settings for both the PHP command line and the PHP web server plug-in, fixing the issue.

You can discover more information regarding the issue here: PHP version readiness check issues.