Socialite Library throwing error curl_reset() undefined in laravel 5

2.4k views Asked by At

I am using socialite package with my laravel 5 project. I am hosting my site in hostgator. I have checked thrice that my php version in hostgator is 5.5.22 .

But still i am getting this error.

    FatalErrorException in CurlFactory.php line 69:
    Call to undefined function GuzzleHttp\Handler\curl_reset()
           in CurlFactory.php line 69

I have tried Facebook as well as Google plus login using socialite but in both cases when redirects to my controller/function it throws this error.

Please help me. What can be possible errors

My Auth controller functions are

public function getFacebookLogin(){
        return Socialite::driver('facebook')->redirect();
    }
    public function getHandleFbLogin(){
        //echo "hey";
         $user = Socialite::driver('facebook')->user();
         print_r($user);
    }

    public function getGoogleLogin(){
        return Socialite::driver('google')->redirect();
    }
    public function getHandleGpLogin(){
    echo "hey";
         $user = Socialite::driver('google')->user();
         print_r($user);
    }
1

There are 1 answers

2
AudioBubble On

I am very new to Stackoverflow. I also got stucked in this, so I did the following :-

Go to /vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php

line no. 69 and replace

curl_reset($resource);

 with
        curl_setopt($resource, CURLOPT_HTTPGET, 1);
        curl_setopt($resource, CURLOPT_POST, false);