dongsi5381 2014-06-14 12:27
浏览 45
已采纳

使用Facebook PHP SDK 4找不到“Facebook \ GraphObject”类

I want to connect my page with facebook and downloaded therefore the Facebook PHP SDK 4. Since the Facebook documentation and the GitHub page are not really well made, I have a question regarding my error message from the title.

I don't want to use Composer for PHP (which should be possible according to the Facebook documentation).

I followed the example on the Github page and included the Facebook PHP files into my PHP file with the following lines of code:

use Facebook\FacebookSession;
use Facebook\FacebookRequest;
use Facebook\GraphUser;
use Facebook\FacebookRequestException;
require_once( 'Facebook/FacebookSession.php' );
require_once( 'Facebook/FacebookRequest.php' );
require_once( 'Facebook/GraphUser.php' );
require_once( 'Facebook/FacebookRequestException.php' );

In the documentation there is nowhere mentioned that I have to include the require_once statement, I found that on stackoverflow.

Problem is now that even with the above (correct) implementation, I get an error which says 'Fatal error: Class 'Facebook\GraphObject' not found in ../fblogin2/Facebook/GraphUser.php on line 33'

I think in this class there is also no require_once statement, but I can't go through the whole SDK code and add the statements for Facebook. Shouldn't it work out-of-the-box? Are there some good tutorials for the SDK 4 or anything else, because I'm really stuck with the official facebook documentation and the short github example.

  • 写回答

1条回答 默认 最新

  • doujiunai2169 2014-06-14 14:02
    关注

    Now I found a good tutorial and solution for the Facebook SDK (v4) here.

    It's 'funny' that a billion dollar company is not able to provide a decent documentation.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 三相直流充电模块对数字电源芯片在物理上它必须具备哪些功能和性能?
  • ¥30 数字电源对DSP芯片的具体要求
  • ¥20 antv g6 折线边如何变为钝角
  • ¥30 如何在Matlab或Python中 设置饼图的高度
  • ¥15 nginx中的CORS策略应该如何配置
  • ¥30 信号与系统实验:采样定理分析
  • ¥100 我想找人帮我写Python 的股票分析代码,有意请加mathtao
  • ¥20 Vite 打包的 Vue3 组件库,图标无法显示
  • ¥15 php 同步电商平台多个店铺增量订单和订单状态
  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别