1
は私のコードです:Facebookの-PHP-SDK:API( '/私')働いていない、ここで非常に奇妙な
$session = $facebook->getSession();
var_dump($session);/*it says session is perfectly established*/
try {
$uid = $facebook->getUser();
echo '<br>';
var_dump($uid);/*User id is found*/
$fb_user = $me = $facebook->api('/me');/*PHP execution doesn't go forward, here it breaks*/
echo '<br>';
var_dump($fb_user);/*PHP execution doesn't come up to here*/
EDITED: を私はキャッチセクションに$例外をしますprint_rし、持っています次の長いメッセージ:
FacebookApiException Object
(
[result:protected] => Array
(
[error_code] => 6
[error] => Array
(
[message] => name lookup timed out
[type] => CurlException
)
)
[message:protected] => name lookup timed out
[string:private] =>
[code:protected] => 6
[file:protected] => /home/abusadat/public_html/.../facebook.php
[line:protected] => 614
[trace:private] => Array
(
[0] => Array
(
[file] => /home/abusadat/public_html/.../facebook.php
[line] => 575
[function] => makeRequest
[class] => Facebook
[type] => ->
[args] => Array
(
[0] => https://graph.facebook.com/me
[1] => Array
(
[method] => GET
[access_token] => ******...******
)
)
)
[1] => Array
(
[file] => /home/abusadat/public_html/.../facebook.php
[line] => 539
[function] => _oauthRequest
[class] => Facebook
[type] => ->
[args] => Array
(
[0] => https://graph.facebook.com/me
[1] => Array
(
[method] => GET
)
)
)
[2] => Array
(
[file] => /home/abusadat/public_html/.../facebook.php
[line] => 492
[function] => _graph
[class] => Facebook
[type] => ->
[args] => Array
(
[0] => /me
)
)
[3] => Array
(
[file] => /home/abusadat/public_html/.../fb-connect.php
[line] => 31
[function] => api
[class] => Facebook
[type] => ->
[args] => Array
(
[0] => Array
(
[0] => Facebook Object
(
[appId:protected] => ******...******
[session:protected] => Array
(
[access_token] => ******...******
[base_domain] => abusadat.com
[expires] => 1312567200
[secret] => ******...******
[session_key] => ******...******
[sig] => ******...******
[uid] => ******...******
)
[signedRequest:protected] =>
[sessionLoaded:protected] => 1
[cookieSupport:protected] => 1
[baseDomain:protected] =>
[fileUploadSupport:protected] =>
)
[1] => _graph
)
[1] => Array
(
[0] => /me
)
)
)
[4] => Array
(
[file] => /home/abusadat/public_html/.../index.php
[line] => 29
[args] => Array
(
[0] => /home/abusadat/public_html/.../fb-connect.php
)
[function] => include_once
)
)
)
私はSDKバージョン2.1.2を使用しています。 SDK 3以上の使用にはいくつかの制限があります。
私はあなたが言った方法を試みました。しかし、違いはありません。 – Sadat
完全なコードを表示できますか? try claueがありますが、catch節は表示されません。例外がスローされている場合、あなたは何をしていますか? – sagi
あなたは正しいです。 print_rに$例外があり、エラーメッセージが表示されます。そのエラーメッセージの編集されたセクションを見てください – Sadat