【求指点】自学与新浪微博开放平台对接,运行新浪提供的sdk报错
环境:win7(x64)、wamp集成(php5.4.3+mysql5.5.24+apache2.4.2+phpmyadmin3.5.1)
新浪php sdk版本:最老的那个(weibo-oauth-class-with-image-avatar-06-29-update)
目的:学做简易的微博,目的与新浪微博开放平台链接上
问题:将一些=不规范的地方改正后,有报错提示。
wb_akey wb_skey已申请,wb_callback_url路径也改过了
-----------------------------------报错内容------------------------------------------
( ! ) scream: error suppression ignored for
( ! ) fatal error: call to undefined function curl_init() in c:\wamp\www\php100\php100-sina\weibooauth.php on line 1687
call stack
# time memory function location
1 0.0008 250576 {main}( ) ..\index.php:0
2 0.0060 610864 weibooauth->getrequesttoken( ) ..\index.php:8
3 0.0060 611320 weibooauth->oauthrequest( ) ..\weibooauth.php:1575
4 0.0070 615504 weibooauth->http( ) ..\weibooauth.php:1674
-------------------------------index.php部分代码------------------------------------
getrequesttoken();报错行
if( strpos( http://localhost/php100/php100-sina/ , 'index.php' ) === false )
$callback = 'http://localhost/php100/php100-sina/callback.php';
else
$callback = str_replace( 'index.php' , 'callback.php' , $_server['script_uri'] );
------------------------------weibooauth.php部分代码--------------------------------------
function getrequesttoken($oauth_callback = null) {
$parameters = array();
if (!empty($oauth_callback)) {
$parameters['oauth_callback'] = $oauth_callback;
}
$request = $this->oauthrequest($this->requesttokenurl(), 'get', $parameters); 报错行
$token = oauthutil::parse_parameters($request);
$this->token = new oauthconsumer($token['oauth_token'], $token['oauth_token_secret']);
return $token;
}
===============================================================================================
function oauthrequest($url, $method, $parameters , $multi = false) {
if (strrpos($url, 'http://') !== 0 && strrpos($url, 'http://') !== 0) {
$url = {$this->host}{$url}.{$this->format};
}
// echo $url ;