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

Viewed 227742

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.

20 Answers

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.

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

sudo apt-get install php-mbstring

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

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.

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

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

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)

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

for similar case:

  • /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-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-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

solved with :

apt-get install php-dom
apt-get install php-mbstring

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.

It helped my case to install the right curl version

sudo apt-get install php5-curl
  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.

Installing PHP extensions:

sudo apt-get install -y php-gd

sudo apt-get install -y php-intl

sudo apt-get install -y php-xsl

sudo apt-get install -y php-mbstring

I followed these steps:

steps1: sudo apt-get install php5-gd

steps2: sudo apt-get install php5-intl

steps3: sudo apt-get install php5-xsl

After that, it's installing as it should.

Related