내 웹 사이트에 Facebook API를 사용하려고합니다. 는하지만이Facebook SDK cURL 및 SSL 오류
Fatal error: Uncaught CurlException: 1: Protocol https not supported or disabled in libcurl thrown in /home/batav1/public_html/permaisuri/include/fbsdk/src/base_facebook.php on line 887
과 같은 몇 가지 오류가 나는 컬 구성 BU 타이핑은 phpinfo()를 확인하고 여기에 내가 무엇을해야합니까 결과
cURL support enabled
cURL Information libcurl/7.21.0 zlib/1.2.3 libidn/0.6.5
입니다거야? php_openssl
확장이 존재해야하며 활성화 - - allow_url_include
ON으로 설정해야합니다 당신의 PHP 설정 나던 wraper
이 ALOW하려면 https
래퍼 HTTPS를 지원하는 것처럼 보인다
<?php
require 'include/fbsdk/src/facebook.php';
$facebook = new Facebook(array(
'appId' => '33025497038xxxx',
'secret' => '87be6ab5175a9be7c7d48be74dd5xxxx',
));
$user = $facebook->getUser();
if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
if ($user) {
$logoutUrl = $facebook->getLogoutUrl();
} else {
$loginUrl = $facebook->getLoginUrl();
}
$naitik = $facebook->api('/naitik');
?>
<!doctype html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>php-sdk</title>
<style>
body {
font-family: 'Lucida Grande', Verdana, Arial, sans-serif;
}
h1 a {
text-decoration: none;
color: #3b5998;
}
h1 a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<h1>php-sdk</h1>
<?php if ($user): ?>
<a href="<?php echo $logoutUrl; ?>">Logout</a>
<?php else: ?>
<div>
Login using OAuth 2.0 handled by the PHP SDK:
<a href="<?php echo $loginUrl; ?>">Login with Facebook</a>
</div>
<?php endif ?>
<h3>PHP Session</h3>
<pre><?php print_r($_SESSION); ?></pre>
<?php if ($user): ?>
<h3>You</h3>
<img src="https://graph.facebook.com/<?php echo $user; ?>/picture">
<h3>Your User Object (/me)</h3>
<pre><?php print_r($user_profile); ?></pre>
<?php else: ?>
<strong><em>You are not Connected.</em></strong>
<?php endif ?>
<h3>Public profile of Naitik</h3>
<img src="https://graph.facebook.com/naitik/picture">
<?php echo $naitik['name']; ?>
</body>
</html>
그는 curl을 사용하고 있으므로 allow_url_include는 필요하지 않습니다. – Maerlyn
oke, 고마워, 내가 먼저 해보겠습니다. – nvl
오류 및/home/.. 경로에 따라 Windows dll을 사용하고 있습니다. 리눅스/유닉스 변종에 있다고 추측하고 있습니다 ... – stUrb