How do I install the ext-curl extension?

04/02/2020 15:30:02

I've installed PHP 7 using this repo, but when I try to run composer install, it's giving this error:

  • [package] requires ext-curl * -> the requested PHP extension curl is missing from your system.

With PHP 5, you can easily install it by running the yum or apt-get install php5-curl command, but I can't find how to install the PHP 7 equivalent.

How do I install ext-curl for PHP 7?

Verified Answer (419 Votes)

01/27/2016 15:48:05

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

Answer #2 (96 Votes)

07/12/2016 08:08:56

please try

sudo apt-get install php7.0-curl

Answer #3 (22 Votes)

12/18/2016 21:45:12

If "sudo apt-get install php-curl" command doesnt work and display error We should run this code before install curl.

  • step1 - sudo add-apt-repository ppa:ondrej/php
  • step2 - sudo apt-get update
  • step3 - sudo apt-get install php-curl
  • step4 - sudo service apache2 restart
Hack Hex uses Stack Exchance API by the Stack Exchange Inc. to scrape questions/answers under Creative Commons license.