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

I'm trying to install Facebook PHP SDK with Composer. This is what I get

$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

    Problem 1
        - Installation request for facebook/php-sdk dev-master -> satisfiable by facebook/php-sdk[dev-master].
        - facebook/php-sdk dev-master requires ext-curl * -> the requested PHP extension curl is missing from your system.

Problem is, I have curl extension enabled (uncommented in php.ini). When I run phpinfo(), it says it's enabled. Only clue I have is that when I run $ php -m, 'curl' line is missing but I don't know what to do about it.

I have wamp 2.4 on Win8 and I'm running composer in cmd.exe.

This question is related to php windows curl facebook-php-sdk composer-php

The answer is


Enable in php 7 try below command

sudo apt-get install php7.0-curl

on php7 run for example:

> sudo apt-get install php-curl
> sudo apt-get install php-mbstring

for every missing extension. Then:

> sudo apt-get update

and finally (in the project's root folder):

> composer install

According to https://github.com/composer/composer/issues/2119 you could extend your local composer.json to state that it provides the extension (which it doesn't really do - that's why you shouldn't publicly publish your package, only use it internally).


As Danack said in comments, there are 2 php.ini files. I uncommented the line with curl extension in the one in Apache folder, which is php.ini used by the web server.

Composer, on the other hand, uses php for console which is a whole different story. Php.ini file for that program is not the one in Apache folder but it's in the PHP folder and I had to uncomment the line in it too. Then I ran the installation again and it was OK.


I ran into a similar issue when trying to get composer to install some dependencies. It turns out the .dll my version of Wamp came with had a conflict, I am guessing, with 64 bit Windows.

This url has fixed curl dlls: http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/

Scroll down to the section that says: Fixed Curl Extensions.

I downloaded "php_curl-5.4.3-VC9-x64.zip". I just overwrote the dll inside the wamp/bin/php/php5.4.3/ext directory with the dll that was in the zip file and composer worked again.

I am running 64 bit Windows 8.

Hope this helps.


Not sure why an answer with Linux commands would get so many up votes for a Windows related question, but anyway...

If phpinfo() shows Curl as enabled, yet php -m does NOT, it means that you probably have a php-cli.ini too. run php -i and see which ini file loaded. If it's different, diff it and reflect and differences in the CLI ini file. Then you should be good to go.

Btw download and use Git Bash instead of cmd.exe!


I ran into the same issue trying to install Dropbox SDK.

CURL was indeed enabled on my system but this meant by the php.ini in the wamp\bin\apache folder.

I simply had to manually edit the php.ini situated in wamp\bin\php, uncomment the extension=php_curl.dll line, restart Wamp and it worked perfectly.

Why there are those 2 php.ini and only one is used is still a mystery for me...

Hope it's helpul to someone!


I have Archlinux with php 7.2, which has Curl integrated, so no amount of configuration voodoo would make Composer see ext-curl, that PHP could see and work with happily. Work around is to use Composer with --ignore-platform-reqs.

eg composer update --ignore-platform-reqs

Reference = https://github.com/composer/composer/issues/1426


if use wamp go to:

wamp\bin\php\php.5.x.x\php.ini find: ;extension=php_curl.dll remove (;)


This worked for me: http://ubuntuforums.org/showthread.php?t=1519176

After installing composer using the command curl -sS https://getcomposer.org/installer | php just run a sudo apt-get update then reinstall curl with sudo apt-get install php5-curl. Then composer's installation process should work so you can finally run php composer.phar install to get the dependencies listed in your composer.json file.


try install php5-curl by using below snippet.

sudo apt-get install php5-curl

if it won't work try below code i m sure it will work fine.

sudo apt-get install php-curl

for me it worked... all the best :)


I had this problem after upgrading to PHP5.6. My answer is very similar to Adriano's, except I had to run:

sudo apt-get install php5.6-curl

Notice the "5.6". Installing php5-curl didn't work for me.


In my case I moved from PHP5 to PHP7 and I ve got this error, Simply go to your /bin/php/php7/php.ini , then uncomment extension=php_curl.dll and restart your server, re-run your composer install.


For anyone who encounters this issue on Windows i couldn't find my answer on google at all. I just tried running composer require ext-curl and this worked. Alternatively add the following in your composer.json file:

"require": {
"ext-curl": "^7.3"
}

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 windows

"Permission Denied" trying to run Python on Windows 10 A fatal error occurred while creating a TLS client credential. The internal error state is 10013 How to install OpenJDK 11 on Windows? I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."? git clone: Authentication failed for <URL> How to avoid the "Windows Defender SmartScreen prevented an unrecognized app from starting warning" XCOPY: Overwrite all without prompt in BATCH Laravel 5 show ErrorException file_put_contents failed to open stream: No such file or directory how to open Jupyter notebook in chrome on windows Tensorflow import error: No module named 'tensorflow'

Examples related to curl

What is the incentive for curl to release the library for free? curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number Converting a POSTMAN request to Curl git clone error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054 How to post raw body data with curl? Curl : connection refused How to use the curl command in PowerShell? Curl to return http status code along with the response How to install php-curl in Ubuntu 16.04 curl: (35) SSL connect error

Examples related to facebook-php-sdk

Composer install error - requires ext_curl when it's actually enabled Getting list of Facebook friends with latest API

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