[php] To enable extensions, verify that they are enabled in those .ini files - Vagrant/Ubuntu/Magento 2.0.2

When installing Magento 2.0.2 via composer getting this error:

Problem 1
 - Installation request for magento/product-enterprise-edition 2.0.2 -> satisfiable by magento/product-enterprise-edition[2.0.2].
 - magento/product-enterprise-edition 2.0.2 requires ext-gd * -> the requested PHP extension gd is missing from your system.

To enable extensions, verify that they are enabled in those .ini files:

- /etc/php5/cli/php.ini
- /etc/php5/cli/conf.d/05-opcache.ini
- /etc/php5/cli/conf.d/10-pdo.ini
- /etc/php5/cli/conf.d/20-curl.ini
- /etc/php5/cli/conf.d/20-imap.ini
- /etc/php5/cli/conf.d/20-json.ini
- /etc/php5/cli/conf.d/20-mcrypt.ini
- /etc/php5/cli/conf.d/20-pdo_pgsql.ini
- /etc/php5/cli/conf.d/20-pgsql.ini
- /etc/php5/cli/conf.d/20-pspell.ini
- /etc/php5/cli/conf.d/20-readline.ini

You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

I have installed php5-cli, php5-curl.

This question is related to php ubuntu composer-php magento2

The answer is


Gonna post this answer here after seeing some of the answers (including the accepted one) which claim to "do the trick". First, we need to identify the issue before fixing it.

the requested PHP extension gd is missing from your system.

As the above line clearly states, we need to install the extension php-gd.

So, we can go with sudo apt install php<version>-gd and it should fix this error unless the system needs more extensions which happens to be the exact case here in the system in question. It needs a couple more extensions php-intl and php-xsl. So let it be mbstring or mcrypt, you should install whatever the extensions your system is missing. How can you find what is missing? Just read the error message, it is there.


ubuntu users try this

apt-get install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-gd php7.2-mysql php7.2-curl php7.2-intl php7.2-xsl php7.2-mbstring php7.2-zip php7.2-bcmath php7.2-soap php-xdebug php-imagick

this is work for php 7.2 but you can change this 7.2 to 5.2 and run this command it is work.


When I went to create a laravel project, I got this problem.

After googling, I got this solution.

I followed these steps:

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


Have tried for many times, the above answers don't solve my quesiton, but this command helped me:

sudo apt-get install php-mbstring

this command would do the trick

sudo apt-get install php5-curl

On Ubuntu 16.04 php7 is now the default, so if you follow the top answers and are still having this issue, check your php version.

php --version

If your default php version is php7, but you followed an answer using php5 packages, you can use the following command to set the default version of php to php5.6:

sudo update-alternatives --set php $(which php5.6)

Updated....For ubuntu users

sudo apt-get install libapache2-mod-php php-common php-gd php-mysql php-curl php-intl php-xsl php-mbstring php-zip php-bcmath php-soap php-xdebug php-imagick

This solved my issues

sudo apt-get install php7.1-xml

or

sudo apt-get install php7.2-xml

It's worked fine in server

composer install --no-dev

This was the fix for me when trying to install Laravel on a fresh WSL installation:

sudo apt-get install php7.2-gd

sudo apt-get install php7.2-intl

sudo apt-get install php7.2-xsl

sudo apt-get install php7.2-zip


First installed

sudo apt-get install php5-gd

then

sudo apt-get install php5-intl

and last one was

sudo apt-get install php5-xsl

After that, it is installing as it should.


For me

sudo apt-get install php5-mcrypt 

solved the issue


The exact name of the extension depends on the repository from which you got PHP but look here. For example on CentOS:

yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring php56w-bcmath


  1. Open the xampp/php/php.ini file in any editor
  2. Search ";extension=php_intl.dll"
  3. Remove the starting semicolon ( ; )

    Like: ;extension=php_intl.dll to extension=php_intl.dll

This helped me.


I used below to fix issue

yum install -y php-intl php-xsl php-opcache php-xml php-mcrypt php-gd php-devel php-mysql php-mbstring php-bcmath


@Verse answer works fine. But there is a small thing I would like to add. instead of installing php5-mbstring, php5-gd, php5-intl, php5-xsl. This answer is based on @Regolith answer: Package has no installation candidate .

Install according to your php-version.

First check which php version you have by sudo php -v. I have php7 so the result is:

PHP 7.0.28-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
   with Zend OPcache v7.0.28-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

since i have php7, I will do the following to list the php packages:
sudo apt-cache search php7-*

this returned

libapache2-mod-php7.0 - server-side, HTML-embedded scripting language (Apache 2 module)
php-all-dev - package depending on all supported PHP development packages
php7.0 - server-side, HTML-embedded scripting language (metapackage)
php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary)
php7.0-cli - command-line interpreter for the PHP scripting language
php7.0-common - documentation, examples and common module for PHP
php7.0-curl - CURL module for PHP
php7.0-dev - Files for PHP7.0 module development
php7.0-gd - GD module for PHP
php7.0-gmp - GMP module for PHP
php7.0-json - JSON module for PHP
php7.0-ldap - LDAP module for PHP
php7.0-mysql - MySQL module for PHP
php7.0-odbc - ODBC module for PHP
php7.0-opcache - Zend OpCache module for PHP
php7.0-pgsql - PostgreSQL module for PHP
php7.0-pspell - pspell module for PHP
php7.0-readline - readline module for PHP
php7.0-recode - recode module for PHP
php7.0-snmp - SNMP module for PHP
php7.0-sqlite3 - SQLite3 module for PHP
php7.0-tidy - tidy module for PHP
php7.0-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP
php7.0-xmlrpc - XMLRPC-EPI module for PHP
libphp7.0-embed - HTML-embedded scripting language (Embedded SAPI library)
php7.0-bcmath - Bcmath module for PHP
php7.0-bz2 - bzip2 module for PHP
php7.0-enchant - Enchant module for PHP
php7.0-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
php7.0-imap - IMAP module for PHP
php7.0-interbase - Interbase module for PHP
php7.0-intl - Internationalisation module for PHP
php7.0-mbstring - MBSTRING module for PHP
php7.0-mcrypt - libmcrypt module for PHP
php7.0-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary)
php7.0-soap - SOAP module for PHP
php7.0-sybase - Sybase module for PHP
php7.0-xsl - XSL module for PHP (dummy)
php7.0-zip - Zip module for PHP
php7.0-dba - DBA module for PHP

now to install packages run the following command with your desired package

sudo apt-get install -y php7.0-gd, php7.0-intl, php7.0-xsl, php7.0-mbstring

Note: php7.0-mbstring, php7.0-gd php7.0-intl php7.0-xsl are the package that are listed above.

UPDATE: Don't forget to restart apache/<your_server>

sudo service apache2 reload

It helped my case to install the right curl version

sudo apt-get install php5-curl

Examples related to php

I am receiving warning in Facebook Application using PHP SDK Pass PDO prepared statement to variables Parse error: syntax error, unexpected [ Preg_match backtrack error Removing "http://" from a string How do I hide the PHP explode delimiter from submitted form results? Problems with installation of Google App Engine SDK for php in OS X Laravel 4 with Sentry 2 add user to a group on Registration php & mysql query not echoing in html with tags? How do I show a message in the foreach loop?

Examples related to ubuntu

grep's at sign caught as whitespace "E: Unable to locate package python-pip" on Ubuntu 18.04 How to Install pip for python 3.7 on Ubuntu 18? "Repository does not have a release file" error ping: google.com: Temporary failure in name resolution How to install JDK 11 under Ubuntu? How to upgrade Python version to 3.7? Issue in installing php7.2-mcrypt Install Qt on Ubuntu Failed to start mongod.service: Unit mongod.service not found

Examples related to composer-php

Composer require runs out of memory. PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted How to change PHP version used by composer PHP7 : install ext-dom issue PHP error: "The zip extension and unzip command are both missing, skipping." Composer: file_put_contents(./composer.json): failed to open stream: Permission denied require(vendor/autoload.php): failed to open stream How to install a specific version of package using Composer? Composer update memory limit Cannot create cache directory .. or directory is not writable. Proceeding without cache in Laravel To enable extensions, verify that they are enabled in those .ini files - Vagrant/Ubuntu/Magento 2.0.2

Examples related to magento2

Uncaught SyntaxError: Unexpected token u in JSON at position 0 To enable extensions, verify that they are enabled in those .ini files - Vagrant/Ubuntu/Magento 2.0.2 how can I enable PHP Extension intl?