Question

I am trying to set up a local Magento 2.4.2 instance just to experiment and develop some work, but I keep hitting a problem with PHP extensions when I run composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition

Creating a "magento/project-community-edition" project at "./project-community-edition"
Installing magento/project-community-edition (2.4.2)
  - Installing magento/project-community-edition (2.4.2): Extracting archive
Created project in /home/rafael/Desktop/project-community-edition
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires magento/product-community-edition 2.4.2 -> satisfiable by magento/product-community-edition[2.4.2].
    - magento/product-community-edition 2.4.2 requires ext-curl * -> it is missing from your system. Install or enable PHP's curl extension.
  Problem 2
    - magento/magento2-functional-testing-framework[3.0.0, ..., 3.3.0] require ext-curl * -> it is missing from your system. Install or enable PHP's curl extension.
    - Root composer.json requires magento/magento2-functional-testing-framework ^3.0 -> satisfiable by magento/magento2-functional-testing-framework[3.0.0, ..., 3.3.0].

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.4/cli/php.ini
    - /etc/php/7.4/cli/conf.d/10-opcache.ini
    - /etc/php/7.4/cli/conf.d/10-pdo.ini
    - /etc/php/7.4/cli/conf.d/15-xml.ini
    - /etc/php/7.4/cli/conf.d/20-calendar.ini
    - /etc/php/7.4/cli/conf.d/20-ctype.ini
    - /etc/php/7.4/cli/conf.d/20-dom.ini
    - /etc/php/7.4/cli/conf.d/20-exif.ini
    - /etc/php/7.4/cli/conf.d/20-ffi.ini
    - /etc/php/7.4/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.4/cli/conf.d/20-ftp.ini
    - /etc/php/7.4/cli/conf.d/20-gettext.ini
    - /etc/php/7.4/cli/conf.d/20-iconv.ini
    - /etc/php/7.4/cli/conf.d/20-json.ini
    - /etc/php/7.4/cli/conf.d/20-mbstring.ini
    - /etc/php/7.4/cli/conf.d/20-phar.ini
    - /etc/php/7.4/cli/conf.d/20-posix.ini
    - /etc/php/7.4/cli/conf.d/20-readline.ini
    - /etc/php/7.4/cli/conf.d/20-shmop.ini
    - /etc/php/7.4/cli/conf.d/20-simplexml.ini
    - /etc/php/7.4/cli/conf.d/20-sockets.ini
    - /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.4/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.4/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.4/cli/conf.d/20-tokenizer.ini
    - /etc/php/7.4/cli/conf.d/20-xmlreader.ini
    - /etc/php/7.4/cli/conf.d/20-xmlwriter.ini
    - /etc/php/7.4/cli/conf.d/20-xsl.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

I already tried to install the extensions with the following command:

sudo apt-get install php7.4-opcache php7.4-pdo php7.4-calendar php7.4-ctype php7.4-dom php7.4-exif php7.4-ffi php7.4-fileinfo php7.4-ftp php7.4-gettext php7.4-iconv php7.4-json php7.4-mbstring php7.4-phar php7.4-posix php7.4-readline php7.4-shmop php7.4-simplexml php7.4-sockets php7.4-sysvmsg php7.4-sysvsem php7.4-sysvshm php7.4-tokenizer php7.4-xmlreader php7.4-xmlwriter php7.4-xsl

PHP version:

PHP 7.4.3 (cli) (built: Oct  6 2020 15:47:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

Mysql version:

mysql  Ver 8.0.23-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))

Elasticsearch version:

{
  "name" : "magecomp4",
  "cluster_name" : "magento-local-app-dummy",
  "cluster_uuid" : "keE77f1bQyudHuyvNVFWYQ",
  "version" : {
    "number" : "7.11.1",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "ff17057114c2199c9c1bbecc727003a907c0db7a",
    "build_date" : "2021-02-15T13:44:09.394032Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Can anyone please help me?

Was it helpful?

Solution

The error refers to PHP's curl extension missing and don't see it in your php modules install command. You can run php -m to double-check and confirm it's really missing.

If it's missing, you should install it:

sudo apt-get install php7.4-curl

However, I would suggest you read the documentation about required PHP settings and make sure that you have everything in there.


Sidenote: It just occurred to me (maybe I am wrong) that when you ran the command

sudo apt-get install php7.4-opcache php7.4-pdo php7.4-calendar php7.4-ctype php7.4-dom php7.4-exif php7.4-ffi php7.4-fileinfo php7.4-ftp php7.4-gettext php7.4-iconv php7.4-json php7.4-mbstring php7.4-phar php7.4-posix php7.4-readline php7.4-shmop php7.4-simplexml php7.4-sockets php7.4-sysvmsg php7.4-sysvsem php7.4-sysvshm php7.4-tokenizer php7.4-xmlreader php7.4-xmlwriter php7.4-xsl

it is possible that you thought that those extensions are missing since they were referred in the error message by the text To enable extensions, verify that they are enabled in your .ini files:'. That message only tells you which additional .ini files were parsed as a hint where to look and not which extensions were missing.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top