Cannot install Magento 2.3 "your PHP version (7.3.3) does not satisfy that requirement"

So I’ve trying to fresh install magento and I have a problem with installing php 7.2. When i copy paste your command:

sudo apt-get install php libapache2-mod-php php-mysql php7.2-soap php7.2-bcmath php7.2-xml php7.2-mbstring php7.2-gd php-common php-cli php-curl php-intl php-zip zip unzip -y

It also actually install php 7.3 as well, and its all good untill I try to install magento with composer. I get this error:

 Problem 1
    - Installation request for magento/product-community-edition 2.3.0 -> satisf                                                                                                                                                             iable by magento/product-community-edition[2.3.0].
    - magento/product-community-edition 2.3.0 requires php ~7.1.3||~7.2.0 -> you                                                                                                                                                             r PHP version (7.3.3) does not satisfy that requirement.
  Problem 2
    - Installation request for magento/magento2-functional-testing-framework 2.3                                                                                                                                                             .9 -> satisfiable by magento/magento2-functional-testing-framework[2.3.9].
    - magento/magento2-functional-testing-framework 2.3.9 requires php 7.0.2|7.0                                                                                                                                                             .4|~7.0.6|~7.1.0|~7.2.0 -> your PHP version (7.3.3) does not satisfy that requir                                                                                                                                                             ement.
  Problem 3
    - Installation request for squizlabs/php_codesniffer 3.3.1 -> satisfiable by                                                                                                                                                              squizlabs/php_codesniffer[3.3.1].
    - squizlabs/php_codesniffer 3.3.1 requires ext-simplexml * -> the requested                                                                                                                                                              PHP extension simplexml is missing from your system.
  Problem 4
    - friendsofphp/php-cs-fixer v2.13.3 requires php ^5.6 || >=7.0 <7.3 -> your                                                                                                                                                              PHP version (7.3.3) does not satisfy that requirement.
    - friendsofphp/php-cs-fixer v2.13.2 requires php ^5.6 || >=7.0 <7.3 -> your                                                                                                                                                              PHP version (7.3.3) does not satisfy that requirement.
    - friendsofphp/php-cs-fixer v2.13.1 requires php ^5.6 || >=7.0 <7.3 -> your                                                                                                                                                              PHP version (7.3.3) does not satisfy that requirement.
    - friendsofphp/php-cs-fixer v2.13.0 requires php ^5.6 || >=7.0 <7.3 -> your                                                                                                                                                              PHP version (7.3.3) does not satisfy that requirement.
    - Installation request for friendsofphp/php-cs-fixer ~2.13.0 -> satisfiable                                                                                                                                                              by friendsofphp/php-cs-fixer[v2.13.0, v2.13.1, v2.13.2, v2.13.3].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.3/cli/php.ini
    - /etc/php/7.3/cli/conf.d/10-mysqlnd.ini
    - /etc/php/7.3/cli/conf.d/10-opcache.ini
    - /etc/php/7.3/cli/conf.d/10-pdo.ini
    - /etc/php/7.3/cli/conf.d/20-calendar.ini
    - /etc/php/7.3/cli/conf.d/20-ctype.ini
    - /etc/php/7.3/cli/conf.d/20-curl.ini
    - /etc/php/7.3/cli/conf.d/20-exif.ini
    - /etc/php/7.3/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.3/cli/conf.d/20-ftp.ini
    - /etc/php/7.3/cli/conf.d/20-gettext.ini
    - /etc/php/7.3/cli/conf.d/20-iconv.ini
    - /etc/php/7.3/cli/conf.d/20-intl.ini
    - /etc/php/7.3/cli/conf.d/20-json.ini
    - /etc/php/7.3/cli/conf.d/20-mbstring.ini
    - /etc/php/7.3/cli/conf.d/20-mysqli.ini
    - /etc/php/7.3/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/7.3/cli/conf.d/20-phar.ini
    - /etc/php/7.3/cli/conf.d/20-posix.ini
    - /etc/php/7.3/cli/conf.d/20-readline.ini
    - /etc/php/7.3/cli/conf.d/20-shmop.ini
    - /etc/php/7.3/cli/conf.d/20-sockets.ini
    - /etc/php/7.3/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.3/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.3/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.3/cli/conf.d/20-tokenizer.ini
    - /etc/php/7.3/cli/conf.d/20-zip.ini
  You can also run `php --ini` inside terminal to see which files are used by PH                                                                                                                                                             P in CLI mode.

Which I understand to be php related. I don’t know how to install php 7.2 only or uninstall 7.3 for that matter.
Also sorry for prolonging this topic so badly, not really sure wheter I should create multiple topics or keep on posting here.

Try to start again and replace php with php7.2. It might be cause the Digitalocean repositories have been updated to include 7.3 now. So, we just need to specify 7.2 now when we run the install command.

Try this first

sudo apt-get install php7.2 libapache2-mod-php php-mysql php7.2-soap php7.2-bcmath php7.2-xml php7.2-mbstring php7.2-gd php-common php-cli php-curl php-intl php-zip zip unzip -y

If that doesn’t work, try this just in case. I’ve just added “7.2” after everything in case “php” on its own defaults to 7.3.

Try this second

sudo apt-get install php7.2 libapache2-mod-php php7.2-mysql php7.2-soap php7.2-bcmath php7.2-xml php7.2-mbstring php7.2-gd php7.2-common php7.2-cli php7.2-curl php7.2-intl php7.2-zip zip unzip -y

I’m just about to go out for the day. But I can check in more detail tomorrow. It’ll be something really simple like that to fix the problem. Good luck. Let me know how you get on and I’ll check back in tomorrow.

Thanks for quick answer and topic management :wink: So I tried both combinations and it still installed some 7.3 extensions causing same error. However I foun the solution, in your second line I addedd “7.2” to the end of libapache2-mod-php so the full command was like this:

sudo apt-get install php7.2 libapache2-mod-php7.2 php7.2-mysql php7.2-soap php7.2-bcmath php7.2-xml php7.2-mbstring php7.2-gd php7.2-common php7.2-cli php7.2-curl php7.2-intl php7.2-zip zip unzip -y

And this one worked for me, so I’m good now :slight_smile: also just to mention this is the command to install phpmyadmin and I noticed that it also install some php 7.3 extensions:

sudo apt-get install phpmyadmin php-mbstring php-gettext -y

Those did not interrupt installing Magento so maybe it’s nothing. I just thought to bring it up :slight_smile: Thanks again :slight_smile:

1 Like

Thank you for the update. I’ve updated the article with your changes just in case someone else runs into the same issue this weekend. I’ll go over everything and double-check the phpmyadmin bit when I get a chance over the next couple of days.

Okie dokie, I’ve just done a speed-run install from scratch to verify that the fix works. It works perfectly. I’ve also updated the documentation to include PHP 7.2 modules when installing phpmyadmin.

Thanks again for your help whilst I was away, @michal :+1: