Composer Install Error - Requires Ext_Curl When It's Actually Enabled

Composer install error - requires ext_curl when it's actually enabled

This is caused because you don't have a library php5-curl installed in your system,

On Ubuntu its just simple run the line code below, in your case on Xamp take a look in Xamp documentation

sudo apt-get install php5-curl

For anyone who uses php7.0

sudo apt-get install php7.0-curl

For those who uses php7.1

sudo apt-get install php7.1-curl

For those who use php7.2

sudo apt-get install php7.2-curl

For those who use php7.3

sudo apt-get install php7.3-curl

For those who use php7.4

sudo apt-get install php7.4-curl

For those who use php8.0

sudo apt-get install php8.0-curl

Or simply run below command to install by your version:

sudo apt-get install php-curl

Composer install missing curl-ext

Some notes:

  • Running php -i is good. It shows you the php.ini used, so that you know which file to edit.
  • Running curl -v is not needed, because that's the standalone curl for usage on the CLI and unrelated to the PHP Extension curl.
  • You checked for php5-curl, that's the needed package. Ok.

What's missing? You need to make sure the extension is also loaded by PHP!

Edit your /etc/php/5.6/cli/php.ini, search for extension, look for php_curl and enable it: extension=php_curl.so.

Then run php -m on the CLI to see the list of loaded modules and ensure that curl is loaded.

Finally, re-run your composer install.

Php curl installed yet composer says its not

I have curl installed (responds in cmd) and and enabled the extension in the php.ini files i have found. What am I missing?

Hmm, it seems your are guessing around where the correct php.ini is in order to enable the PHP extension curl, right?

These steps might help you:

  • Please run php --ini on the CLI to find the php.ini to edit (Loaded Configuration File).
  • Then edit that php.ini and enable the PHP Extension curl.
  • Test, that curl is available: php --ri curl (the command prints the extension configuration).
  • Then run composer on the CLI again.

How do I install the ext-curl extension with PHP 7?

Well I was able to install it by :

sudo apt-get install php-curl

on my system. This will install a dependency package, which depends on the default php version.

After that restart apache

sudo service apache2 restart


Related Topics



Leave a reply



Submit