-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error with PHP 5.3 #175
Comments
i haven't tested the code but on inspection this looks like it might be because $tweets isn't an array but instead is NULL because the json_decode failed. can you validate that $code == '200' before attempting to decode the response? |
Hi. Thank's for answering me. |
that error usually means curl cannot open a connection to the remote server. in the past others have reported this happens when OpenSSL isn't correctly configured for your compiled PHP. what does $tmhOAuth->response['error'] contain? |
Hey, I'm having this same issue.
|
no, that error means curl cannot connect to the host specified (which defaults to api.twitter.com). what does |
Yes, I tried and indeed it was a problem from hostgator, it gave me Time Out. The same thing I tried from bluehost and had no problem. |
Hi.
When I change version of PHP from 5.2 to 5.3 the code below show an error - Warning: Invalid argument supplied for foreach()
On PHP 5.2 it's working good.
$tmhOAuth = new tmhOAuth(array(
'consumer_key' => '_',
'consumer_secret' => '__',
'user_token' => '__',
'user_secret' => '_****',
'curl_ssl_verifypeer' => FALSE
));
$code = $tmhOAuth->request('GET', $tmhOAuth->url('1.1/statuses/user_timeline'), array(
'screen_name' => $twitter_username,
'count' => $tweets_count
));
$response = $tmhOAuth->response['response'];
$tweets = json_decode($response);
foreach($tweets as $tweet){
$twit_text = $tweet->text;
}
The text was updated successfully, but these errors were encountered: