How do I install the ext-curl extension?
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
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) ✓
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)
sudo apt-get install php7.0-curl
Answer #3 (22 Votes)
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