2015-06-15 15 views
1

我正在使用社交包與我的laravel 5項目。我在hostgator中託管我的網站。我檢查了三次,我在hostgator中的PHP版本是5.5.22。社交媒體庫引發錯誤curl_reset()未定義laravel 5

但我仍然得到這個錯誤。

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

我已經試過的Facebook和谷歌,加上登錄使用的交際花,但在這兩種情況下,當重定向到我的控制器/功能它拋出這個錯誤。

請幫幫我。有什麼可以可能出現的錯誤

我驗證控制器的功能是

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); 
    } 

回答

9

我是很新的#1。我也得到了stucked在這一點,所以我做了以下內容: -

轉到 /vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php

線沒有。 69並替換

curl_reset($ resource);

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

我通過公用文件夾改變.htaccess文件解決了這個問題。只是添加在頂部的AddHandler應用程序/ x-httpd-php55 .php – Shailendra2014

+0

處理這個問題最簡單的方法是更新到PHP5.5。否則,Harneet解決方案是正確的。 – Link14