dropbox-php-sdk를 다운로드하였습니다. 다음으로 좋아, 내가 PHP에서 스크립트를 작성 :리눅스의 php에서 내 Dropbox 계정에 액세스 할 수 없습니다.
<?php
require_once "dropbox-sdk-php-1.1.6/lib/Dropbox/autoload.php";
use \Dropbox as dbx;
$dropbox_config = array(
'key' => 'fasgsasgas',
'secret' => 'gasawggasg'
);
$appInfo = dbx\AppInfo::loadFromJson($dropbox_config);
$webAuth = new dbx\WebAuthNoRedirect($appInfo, "PHP-Example/1.0");
$authorizeUrl = $webAuth->start();
echo "1. Go to: " . $authorizeUrl . "<br>";
echo "2. Click \"Allow\" (you might have to log in first).<br>";
echo "3. Copy the authorization code and insert it into $authCode.<br>";
$authCode = trim('eadasfafasfasfasfffffasfasfsafsafsafsafsafafa');
list($accessToken, $dropboxUserId) = $webAuth->finish($authCode);
echo "Access Token: " . $accessToken . "<br>";
$dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0");
$accountInfo = $dbxClient->getAccountInfo();
print_r($accountInfo);
?>
을, 나는이 스크립트를 실행하면 I 출력이 : 나는 오류를 가지고
[email protected]:/var/www/test.tl# php test2.php
PHP Fatal error: Uncaught exception 'Exception' with message 'The Dropbox SDK requires the cURL PHP extension, but it looks like you don't have it (couldn't find function "curl_init"). Library: "/var/www/test.tl/dropbox-sdk-php-1.1.6/lib/Dropbox/RequestUtil.php".' in /var/www/test.tl/dropbox-sdk-php-1.1.6/lib/Dropbox/RequestUtil.php:5
Stack trace:
#0 /var/www/test.tl/dropbox-sdk-php-1.1.6/lib/Dropbox/autoload.php(27): require_once()
#1 [internal function]: Dropbox\autoload('Dropbox\Request...')
#2 /var/www/test.tl/dropbox-sdk-php-1.1.6/lib/Dropbox/WebAuthBase.php(14): spl_autoload_call('Dropbox\Request...')
#3 /var/www/test.tl/dropbox-sdk-php-1.1.6/lib/Dropbox/WebAuthNoRedirect.php(56): Dropbox\WebAuthBase->_getAuthorizeUrl(NULL, NULL)
#4 /var/www/test.tl/test2.php(14): Dropbox\WebAuthNoRedirect->start()
#5 {main}
thrown in /var/www/test.tl/dropbox-sdk-php-1.1.6/lib/Dropbox/RequestUtil.php on line 5
를? 계정 정보를 얻어야합니다. 그러나 내가 이해할 수없는 오류가있는 곳.