August 30, 2020 — kyle.huynh205
Fix issue “Your requirements could not be resolved to an installable set of packages”, when install Drupal with composer
When install Drupal with composer by command:
composer create-project drupal/recommended-project ./drupal
Then, these output is encountered:
Installing drupal/recommended-project (9.0.3) Failed to download drupal/recommended-project from dist: The zip extension and unzip command are both missing, skipping. Your command-line PHP is using multiple ini files. Run `php --ini` to show them. Now trying to download from source - Installing drupal/recommended-project (9.0.3): Cloning 17ed885c64 from cache Created project in drupal9 Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for drupal/core 9.0.3 -> satisfiable by drupal/core[9.0.3]. - drupal/core 9.0.3 requires ext-gd * -> the requested PHP extension gd is missing from your system. Problem 2 - drupal/core 9.0.3 requires ext-gd * -> the requested PHP extension gd is missing from your system. - drupal/core-recommended 9.0.3 requires drupal/core 9.0.3 -> satisfiable by drupal/core[9.0.3]. - Installation request for drupal/core-recommended 9.0.3 -> satisfiable by drupal/core-recommended[9.0.3]. 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-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.
Solution:
Step 1:sudo apt-get install -y php7.2-gd
Step 2:sudo apt-get install php7.2-intl
Step 3:sudo apt-get install php7.2-xsl
Step 4:sudo apt-get install php7.2-mbstring
Rerun the below command, the problem will be resolved:
composer create-project drupal/recommended-project ./drupal