Composer install error - requires ext_curl when it's actually enabled
This is caused because you don't have a library php5-curl installed in your system,
On Ubuntu its just simple run the line code below, in your case on Xamp take a look in Xamp documentation
sudo apt-get install php5-curl
For anyone who uses php7.0
sudo apt-get install php7.0-curl
For those who uses php7.1
sudo apt-get install php7.1-curl
For those who use php7.2
sudo apt-get install php7.2-curl
For those who use php7.3
sudo apt-get install php7.3-curl
For those who use php7.4
sudo apt-get install php7.4-curl
For those who use php8.0
sudo apt-get install php8.0-curl
Or simply run below command to install by your version:
sudo apt-get install php-curl
Composer install missing curl-ext
Some notes:
- Running
php -i
is good. It shows you thephp.ini
used, so that you know which file to edit. - Running
curl -v
is not needed, because that's the standalone curl for usage on the CLI and unrelated to the PHP Extension curl. - You checked for
php5-curl
, that's the needed package. Ok.
What's missing? You need to make sure the extension is also loaded by PHP!
Edit your /etc/php/5.6/cli/php.ini
, search for extension
, look for php_curl
and enable it: extension=php_curl.so
.
Then run php -m
on the CLI to see the list of loaded modules and ensure that curl is loaded.
Finally, re-run your composer install
.
Php curl installed yet composer says its not
I have curl installed (responds in cmd) and and enabled the extension in the php.ini files i have found. What am I missing?
Hmm, it seems your are guessing around where the correct php.ini
is in order to enable the PHP extension curl
, right?
These steps might help you:
- Please run
php --ini
on the CLI to find thephp.ini
to edit (Loaded Configuration File
). - Then edit that
php.ini
and enable the PHP Extensioncurl
. - Test, that
curl
is available:php --ri curl
(the command prints the extension configuration). - Then run
composer
on the CLI again.
How do I install the ext-curl extension with PHP 7?
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
Related Topics
File Attachment with PHPmailer
Is There Any Sort of "Pre Login" Event or Similar
PHP Function Imagettftext() and Unicode
Http Response Code After Redirect
Error: File Is Encrypted or Is Not a Database
Laravel Model Callbacks After Save, Before Save, etc
PHP Include Causes White Space at the Top of the Page
Mysqli + Xdebug Breakpoint After Closing Statement Result in Many Warnings
Php: Locale Aware Number Format
Does the Order of Class Definition Matter in PHP
Array to Object and Object to Array in PHP - Interesting Behaviour
Adding a Namespace When Using Simplexmlelement
How to Get Page Number on Dompdf PDF When Using "View"
Having Two Different Sessions in Same Domain
JSON_Encode() Non Utf-8 Strings
Flip Associative Array and Store New Values in Subarrays to Prevent Losing Duplicated Values