我得到一个带有错误代码的FacebookApiException:35和一条错误消息: 错误:0606C06E:数字信封例程:EVP_VerifyFinal:错误的公钥类型
使用这个:
require_once("facebook-php-sdk-v3.1.1/src/facebook.php");
$facebook = new Facebook(array('appId' => 'MYAPPID', 'secret' => 'MYSECRET', 'fileUpload' => TRUE));
$fb_user = $facebook->getUser();
if($fb_user) {
try {
$fb_userprofile = $facebook->api('/me');
}
catch(FacebookApiException $e) {
echo htmlspecialchars(print_r($e, true));
$fb_user = NULL;
}
}
我找不到任何提示来解决这个问题!大家都知道,这些错误信息是什么意思?
感谢您的帮助!
好的,我试过这个:
<?php var_dump(stream_get_wrappers());
$imagecontent = file_get_contents('https://graph.facebook.com/');
echo $imagecontent;
?>
我得到了这个答案
array(11) {
[0]=>string(5) "https"
[1]=>string(4) "ftps"
[2]=>string(13) "compress.zlib"
[3]=>string(3) "php"
[4]=>string(4) "file"
[5]=>string(4) "glob"
[6]=>string(4) "data"
[7]=>string(4) "http"
[8]=>string(3) "ftp"
[9]=>string(4) "phar"
[10]=>string(3) "zip"
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de" id="facebook" class="no_js" xmlns:fb="http://ogp.me/ns/fb#" xmlns:og="http://ogp.me/ns#">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
function envFlush(a){function b(c){for(var d in a)c[d]=a[d];}if(window.requireLazy){requireLazy(['Env'],b);}else{Env=window.Env||{};b(Env);}}envFlush({"user":"0","locale":"de_DE","method":"GET","svn_rev":520918,"vip":"66.220.147.55","static_base":"http:\/\/static.ak.fbcdn.net\/","www_base":"http:\/\/www.facebook.com\/","rep_lag":2,"fb_dtsg":"AQAPbmkw","ajaxpipe_token":"AXiAd3xdxuc5Cj6T","lhsh":"wAQEZ_4Ny","tracking_domain":"http:\/\/pixel.facebook.com","retry_ajax_on_network_error":"1","html5_audio":"1","fbid_emoticons":"1"});
</script>
<script>
envFlush({"eagleEyeConfig":{"seed":"1sBq"}});
CavalryLogger=false;
window._script_path = "DeveloperReferenceSectionController";
window._incorporate_fragment = true;
</script>
<noscript>
<meta http-equiv="refresh" content="0; URL=/docs/reference/api/?_fb_noscript=1" />
</noscript>
和卷曲
* About to connect() to graph.facebook.com port 443 (#0)
* Trying 69.171.234.66... connected
* Connected to graph.facebook.com (69.171.234.66) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using RC4-MD5
* Server certificate:
* subject: /C=US/ST=California/L=Palo Alto/O=Facebook, Inc./CN=*.facebook.com
* start date: 2010-01-13 00:00:00 GMT
* expire date: 2013-04-11 23:59:59 GMT
* common name: *.facebook.com (matched)
* issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance CA-3
* SSL certificate verify ok.
> GET / HTTP/1.1
> User-Agent: curl/7.18.2 (x86_64-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8o zlib/1.2.3.3 libidn/1.8 libssh2/0.18
> Host: graph.facebook.com
> Accept: */*
>
< HTTP/1.1 302 Found
< Cache-Control: private, no-cache, no-store, must-revalidate
< Expires: Sat, 01 Jan 2000 00:00:00 GMT
< Location: http://developers.facebook.com/docs/api
< Pragma: no-cache
< X-FB-Rev: 520918
< Content-Type: text/html; charset=utf-8
< X-FB-Debug: PY9pNA2x6uF3H9q3WQr8mZTOsFD3TjWtXJ3RnDu307c=
< X-Cnection: close
< Date: Fri, 09 Mar 2012 14:45:52 GMT
< Content-Length: 0
<
* Connection #0 to host graph.facebook.com left intact
* Closing connection #0
所以,它似乎有效。每个人都可以提供帮助。
由于
答案 0 :(得分:0)
这不是Facebook错误,据我所知,这是一个OpenSSL错误 - 检查系统的开放SSL配置并确保您可以正确地向graph.facebook.com发出HTTPS请求 - 尝试手动CURLing一些URL或直接提出请求从您的PHP代码中查看它是否正常工作 - Facebook SDK正在将错误从堆栈中的某些内容包装起来我认为