"Seeking guidance" self-study and Sina Weibo open platform docking, running Sina provided by the SDK error

Source: Internet
Author: User
Tags oauth scream
Environment: Win7 (x64), Wamp Integration (php5.4.3+mysql5.5.24+apache2.4.2+phpmyadmin3.5.1)
Sina PHP SDK version: The oldest one (weibo-oauth-class-with-image-avatar-06-29-update)
Objective: To learn to do simple microblogging, the purpose of Sina Weibo open platform link on
Problem: Put some " "Wb_akey" "Wb_skey" has been applied, "Wb_callback_url" path has been changed
-----------------------------------Error Content------------------------------------------
( ! ) Scream:error suppression ignored for
( ! ) Fatal error:call to undefined function curl_init () inch 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 part of the code------------------------------------
Session_Start ();
if (Isset ($_session[' Last_key ')) header ("Location:weibolist.php");
Include_once (' config.php ');
Include_once (' weibooauth.php ');
$o = new Weibooauth (Wb_akey, Wb_skey);
$keys = $o->getrequesttoken (); Error line
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 part of the code--------------------------------------
function Getrequesttoken ($oauth _callback = NULL) {
$parameters = Array ();
if (!empty ($oauth _callback)) {
$parameters [' oauth_callback '] = $oauth _callback;
}
$request = $this->oauthrequest ($this->requesttokenurl (), ' GET ', $parameters); Error line
$token = oauthutil::p arse_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;
$request = Oauthrequest::from_consumer_and_token ($this->consumer, $this->token, $method, $url, $parameters);
$request->sign_request ($this->sha1_method, $this->consumer, $this->token);
Switch ($method) {
Case ' GET ':
echo $request->to_url ();
return $this->http ($request->to_url (), ' GET '); Error line
Default
return $this->http ($request->get_normalized_http_url (), $method, $request->to_postdata ($multi), $multi);
}
}


Reply to discussion (solution)

Fatal error:call to undefined function curl_init () ...
You did not load the php_curl extension

Fatal error:call to undefined function curl_init () ...
You did not load the php_curl extension


Include

In php.ini
Extension=php_curl.dll

Default commented-Out
; Extension=php_curl.dll

Note that this extension requires Libeay32.dll and Ssleay32.dll support libraries

In php.ini
Extension=php_curl.dll

Default commented-Out
; Extension=php_curl.dll

Note that this extension requires Libeay32.dll and Ssleay32.dll support libraries


Extension=php_curl.dll put away;
How to view Libeay32.dll and Ssleay32.dll?

In the PHP installation directory
You can use it, if the loading error only need to do the relevant processing

In the PHP installation directory
You can use it, if the loading error only need to do the relevant processing


Libeay32.dll and Ssleay32.dll
In the PHP directory, there are

That's it, right?
Reboot Apache and test your code.

That's it, right?
Reboot Apache and test your code.


Restart, you said DLL file system32,php folder, there are, or
( ! ) Scream:error suppression ignored for
( ! ) Fatal error:call to undefined function curl_init () inch C:\wamp\www\PHP100\PHP100-sina\weibooauth.php on line 1687
Call Stack
# Time Memory Function location
1 0.0005 251568 {main} (): \index.php:0
2 0.0062 611880 Weibooauth->getrequesttoken (). \index.php:8
3 0.0062 612336 weibooauth->oauthrequest (). \weibooauth.php:1575
4 0.0069 616528 weibooauth->http (). \weibooauth.php:1674
Is it because I'm using the oldest version of the PHP SDK?
I am next to the latest version of the PHP SDK, but the prompt access error!
Your visit to the site on Sina Weibo certification failed, please contact the author or try again later.
(Error:redirect_uri_mismatch)
Does it have to wait for certification? In order to test locally, I also set the callback page address in the OAuth2.0 authorization settings.

That's it, right?
Reboot Apache and test your code.


Thank you Moderator!
My own question, config. PHP callback address I called http://http://.....
The brain's flooded.
-------------------------------------------------------------------
Authorization page in, everything's fine.
But
( ! ) Scream:error suppression ignored for
( ! ) notice:undefined Index:keys in C:\wamp\www\PHP100\PHP100-sina\callback.php on line 9
Call Stack
# Time Memory Function location
1 0.0003 250944 {main} (): \callback.php:0

( ! ) Scream:error suppression ignored for
( ! ) notice:undefined Index:keys in C:\wamp\www\PHP100\PHP100-sina\callback.php on line 9
Call Stack
# Time Memory Function location
1 0.0003 250944 {main} (): \callback.php:0

( ! ) Scream:error suppression ignored for
( ! ) notice:undefined Index:oauth_verifier in C:\wamp\www\PHP100\PHP100-sina\callback.php on line 11
Call Stack
# Time Memory Function location
1 0.0003 250944 {main} (): \callback.php:0

( ! ) Scream:error suppression ignored for
( ! ) Fatal error:call to undefined function curl_init () inch C:\wamp\www\PHP100\PHP100-sina\weibooauth.php on line 1687
Call Stack
# Time Memory Function location
1 0.0003 250944 {main} (): \callback.php:0
2 0.0040 611360 Weibooauth->getaccesstoken (). \callback.php:11
3 0.0040 611816 weibooauth->oauthrequest (). \weibooauth.php:1611
4 0.0047 616016 weibooauth->http (). \weibooauth.php:1674
Is this swelling again????

Reference 7 Floor Xuzuning's reply: That's all right?
Reboot Apache and test your code.
Thank you Moderator!
My own question, config. PHP callback address I called http://http://.....
The brain's flooded.
-------------------------------------------------------------------
Authorization page go in, everything is OK ...


config.php
Session_Start ();

Include_once (' config.php ');
Include_once (' saetv2.ex.class.php ');
$o = new SaeTOAuthV2 (Wb_akey, Wb_skey);
if (isset ($_request[' code ')) {
$keys = Array ();
$keys [' code '] = $_request[' code ');
$keys [' redirect_uri '] = Wb_callback_url;
try {
$token = $o->getaccesstoken (' Code ', $keys);
} catch (Oauthexception $e) {
}
}
--------------------------------
Should I put Wb_akey, Wb_skey, Wb_callback_url;

There is not Fatal error:call to undefined function curl_init () in .... It?
Your curl doesn't load successfully at all!

Copy Libeay32.dll and Ssleay32.dll to System32
Since your operating system is 64-bit, you may need to set these two files to run in 32-bit compatible mode.

There is not Fatal error:call to undefined function curl_init () in .... It?
Your curl doesn't load successfully at all!

Copy Libeay32.dll and Ssleay32.dll to System32
Since your operating system is 64-bit, you may need to set these two files to run in 32-bit compatible mode.


Fatal error:call to undefined function curl_init () problem finally solved
Now the error is
( ! ) notice:undefined Index:keys in C:\wamp\www\PHP100\PHP100-sina\callback.php on line 9
Call Stack
# Time Memory Function location
1 0.0004 250992 {main} (): \callback.php:0

( ! ) notice:undefined Index:keys in C:\wamp\www\PHP100\PHP100-sina\callback.php on line 9
Call Stack
# Time Memory Function location
1 0.0004 250992 {main} (): \callback.php:0

( ! ) notice:undefined Index:oauth_verifier in C:\wamp\www\PHP100\PHP100-sina\callback.php on line 11
Call Stack
# Time Memory Function location
1 0.0004 250992 {main} (): \callback.php:0

( ! ) notice:undefined Index:oauth_token in C:\wamp\www\PHP100\PHP100-sina\weibooauth.php on line 1613
Call Stack
# Time Memory Function location
1 0.0004 250992 {main} (): \callback.php:0
2 0.0050 607424 Weibooauth->getaccesstoken (). \callback.php:11

( ! ) notice:undefined Index:oauth_token_secret in C:\wamp\www\PHP100\PHP100-sina\weibooauth.php on line 1613
Call Stack
# Time Memory Function location
1 0.0004 250992 {main} (): \callback.php:0
2 0.0050 607424 Weibooauth->getaccesstoken (). \callback.php:11
???????, ???????? ??? Bldg????
Blue is a link, the following code will appear
----------------------------------------------------------------------------------

( ! ) notice:undefined Index:oauth_token in C:\wamp\www\PHP100\PHP100-sina\weibolist.php on line 8
Call Stack
# Time Memory Function location
1 0.0009 257280 {main} (): \weibolist.php:0

( ! ) notice:undefined Index:oauth_token_secret in C:\wamp\www\PHP100\PHP100-sina\weibolist.php on line 8
Call Stack
# Time Memory Function location
1 0.0009 257280 {main} (): \weibolist.php:0

( ! ) notice:undefined Index:name in C:\wamp\www\PHP100\PHP100-sina\weibolist.php on line 14
Call Stack
# Time Memory Function location
1 0.0009 257280 {main} (): \weibolist.php:0
???? ~ ?????? Ô?

Input box, estimated to be Sina demo
?????????

Input box, estimated to be Sina demo
?????????

Input box, estimated to be Sina demo

( ! ) Warning:illegal string offset ' text ' in C:\wamp\www\PHP100\PHP100-sina\weibolist.php on line 52
Call Stack
# Time Memory Function location
1 0.0009 257280 {main} (): \weibolist.php:0
/

( ! ) Warning:illegal string offset ' text ' in C:\wamp\www\PHP100\PHP100-sina\weibolist.php on line 52
Call Stack
# Time Memory Function location
1 0.0009 257280 {main} (): \weibolist.php:0
4

( ! ) Warning:illegal string offset ' text ' in C:\wamp\www\PHP100\PHP100-sina\weibolist.php on line 52
Call Stack
# Time Memory Function location
1 0.0009 257280 {main} (): \weibolist.php:0
4

The same question ........ .....

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.