Verify PHP is installed

Most flavors of Linux have PHP installed by default. This topic assumes that you have already installed PHP. To verify if PHP is installed already, in the command line, type:

php -v

If PHP is installed, a message similar to the following displays:

PHP 7.4.0 (cli) (built: Aug 14 2019 16:42:46) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.1.6, Copyright (c) 1999-2018, by Zend Technologies

Magento 2.4 is compatible with PHP 7.3, but we test with, and recommend using, PHP 7.4.

If PHP is not installed, or a version upgrade is needed, install it following instructions for your particular Linux flavor. On CentOS, additional steps may be required.

Verify installed extensions

Magento requires a set of extensions to be installed.

Magento Open Source and Adobe Commerce:

  • ext-bcmath
  • ext-ctype
  • ext-curl
  • ext-dom
  • ext-fileinfo
  • ext-gd
  • ext-hash
  • ext-iconv
  • ext-intl
  • ext-json
  • ext-libxml
  • ext-mbstring
  • ext-openssl
  • ext-pcre
  • ext-pdo_mysql
  • ext-simplexml
  • ext-soap
  • ext-sockets
  • ext-sodium
  • ext-tokenizer
  • ext-xmlwriter
  • ext-xsl
  • ext-zip
  • lib-libxml
  • lib-openssl

Additionally Adobe Commerce requires:

  • ext-bcmath
  • ext-ctype
  • ext-curl
  • ext-dom
  • ext-fileinfo
  • ext-gd
  • ext-hash
  • ext-iconv
  • ext-intl
  • ext-json
  • ext-libxml
  • ext-mbstring
  • ext-openssl
  • ext-pcre
  • ext-pdo_mysql
  • ext-simplexml
  • ext-soap
  • ext-sockets
  • ext-sodium
  • ext-spl
  • ext-tokenizer
  • ext-xmlwriter
  • ext-xsl
  • ext-zip
  • lib-libxml
  • lib-openssl

https://devdocs.magento.com/guides/v2.4/install-gde/prereq/php-settings.html