Home » Php » ubuntu – Using Laravel, Guzzle complains that the PHP cURL extension isn't installed

ubuntu – Using Laravel, Guzzle complains that the PHP cURL extension isn't installed

Posted by: admin July 12, 2020 Leave a comment

Questions:

When attempting to create a new Laravel project (with Laravel.phar, on Ubuntu 12.04):

laravel new myproject

I get the following error:

Crafting application...

[Guzzle\Common\Exception\RuntimeException]               
The PHP cURL extension must be installed to use Guzzle.  

new name

PHP’s cURL (and all related packages I could find by googling this issue) is installed and enabled.

The first few lines of phpinfo()’s cURL section is:

cURL support    enabled
cURL Information    7.22.0
Age 3

I can’t quite figure out what’s going wrong here. Thanks in advance!

How to&Answers:

The PHP cURL extension package needs to install. Run this command to install the package:

sudo apt-get install php5.6-curl

Then run:

laravel new myproject

Answer:

PHP usually has two different configuration files. One is for running embedded inside the webserver. The other one is when called on the command line.

Make sure you look into the right phpinfo. Run php -i on the command line to see the installed extensions of that version, and also see where the configuration file is located to change the installed extensions.