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

Stephan Vierkant picture Stephan Vierkant · Nov 18, 2015 · Viewed 348.5k times · Source

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?

Answer

Sabeeh Chaudhry picture Sabeeh Chaudhry · Jan 27, 2016

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