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

前端 未结 15 950
遇见更好的自我
遇见更好的自我 2020-12-04 07:50

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

$ composer install
Loading composer repositories with package information
Installin         


        
相关标签:
15条回答
  • 2020-12-04 08:47

    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.

    0 讨论(0)
  • 2020-12-04 08:52

    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"
    }
    
    0 讨论(0)
  • 2020-12-04 08:53

    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.

    0 讨论(0)
提交回复
热议问题