【问题标题】:Graph API error图形 API 错误
【发布时间】:2018-07-11 00:10:52
【问题描述】:

我想使用 Graph Api v3.0 在我的项目中包含 facebook 登录。 这是感兴趣的文件的路径。

index.php
config.php
Facebook (folder)
   --> autoload.php
   --> Facebook.php
   --> other files..

这是config.php里面的代码

require_once 'Facebook/autoload.php';
$FB = new \Facebook\Facebook({          (Line 10)
     'app_id' => 'myappid',
     'app_secret' => 'myappsecret',
     'default_graph_version' => 'v3.0'
});

当我转到执行 config.php (index.php) 的 url 时,它给了我这个错误:

Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\config.php on line 10

怎么了?

【问题讨论】:

  • 您说错误在第 10 行,但您只向我们展示了六行。 10号线是哪一个?请您向我们展示前 10 行左右的所有行吗?

标签: php api graph


【解决方案1】:
#Did you try to remove this('()') on line 10 and line 14 ? As I remember JSON does not like brackets.
require_once 'Facebook/autoload.php';
$FB = new \Facebook\Facebook{          /*(Line 10) or use '[' instead\*
     'app_id' => 'myappid',
     'app_secret' => 'myappsecret',
     'default_graph_version' => 'v3.0'
};

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多