Yesha Dave
Yesha Dave

Reputation: 181

Error like this: Google PHP API Client requires the CURL PHP extension

When i am trying to use google API in my PHP project it gives error like this:

Fatal error: Uncaught exception 'Exception' with message 'Google PHP API Client requires the CURL PHP extension' in C:\xampp\htdocs\googleplus\src\Google_Client.php:21 Stack trace: #0 C:\xampp\htdocs\googleplus

I have curl installed in my laptop.

Upvotes: 0

Views: 2685

Answers (2)

Pavan Kumar Tadikonda
Pavan Kumar Tadikonda

Reputation: 11

For php7.2 version in Ubuntu:

sudo apt-get install php7.2-curl

sudo systemctl restart apache2

Upvotes: 1

Aman Kumar
Aman Kumar

Reputation: 4547

If you are using window then follow these steps to enable curl in php

Step 1. Open below files

C:\Program Files\xampp\apache\bin\php.ini
C:\Program Files\xampp\php\php.ini
C:\Program Files\xampp\php\php4\php.ini

Step 2. Uncomment the following line in your php.ini file by removing the semicolon (;).

;extension=php_curl.dll

After that it will look something like something below-

extension=php_curl.dll

Step 3. Restart your apache server

If you are using Linux operating system

Open terminal using ctrl + alt + t

Run command :- sudo apt-get install php5-curl // Note :- according to php version

Make sure curl is enabled in the php.ini file path /etc/php5/apache2/php.ini,

Restart apache server :- sudo service apache2 restart

Upvotes: 3

Related Questions