用于 Facebook 登录的 HYbridauth 不起作用

HYbridauth for facebook login doesn't work

我正在尝试配置 hybridauth 库,以便我可以使用 google + 和 facebook 登录。但它让我一直出现致命错误:

 Fatal error: require(): Failed opening required 'Facebook\Facebook.php' (include_path='.:/var/www/magilla/lib:/var/www/magilla/models') in /var/www/magilla/lib/RPC/Util.php on line 168

I followed each and every step of their documentation. I have used the composer to install the library. The library version is 2.9 and the facebook graph sdk, the most recent version of github

阅读编辑*2 以获得正确的解决方案

我遇到了同样的问题,我想你安装 hybridauth 的方式和我一样,就是在你的项目根文件夹中 运行ning composer require hybridauth/hybridauth

I solved this by running composer install within the hybridauth directory where its composer.json exist, that will install facebook sdk within the hybridauth directory where the autoload.php is being load by the script (I personally feel like it is more like a hack than a proper solution... but I have a feeling that the hybridauth developer expect you to clone then run the composer install instead of composer requiring it...I maybe wrong as I just start using composer as well)

*EDIT check out the issue on their github,有一个错误,供应商路径在他们的代码中被一个替换,它还提到它在以后的提交中被修复。我也是作曲家的新手,所以我不知道如何具体提交更新到...如果你知道怎么做,也请告诉我

*EDIT*2 好吧,我更新到 2.9.3-dev,它似乎解决了这个问题而没有生成任何新问题,我也将它用于 google 和 twitter,这些也很好。要更新,请将您的 composer.json 编辑为此

"require": {
        "hybridauth/hybridauth": "^2.9-dev"
    }

然后 运行 composer update 在你的命令提示符下,只要你的脚本需要作曲家 autoload.php