cosenary / Instagram-PHP-API

An easy-to-use PHP Class for accessing Instagram's API.
http://cosenary.github.com/Instagram-PHP-API
BSD 3-Clause "New" or "Revised" License
1.46k stars 780 forks source link

Undefined index: X-Ratelimit-Remaining #155

Open ahmad opened 9 years ago

ahmad commented 9 years ago

Have anyone came across this issue before? I'm getting an undefined index notice and the request is not going through.

I saw this post in StackOverflow but I'm not sure how to fix the issue in relation to this library.

Notice: Undefined index: X-Ratelimit-Remaining in /Users/name/Projects/Instagram-PHP-API/src/Instagram.php on line 633

Here is the code I'm running. I just modified the success.php file a little bit

// store user access token
$instagram->setAccessToken($data);
// now you have access to all authenticated user methods
$result = $instagram->getTagMedia("#Travel");

Any help would be greatly appreciated!

Thank you, Ahmad

chantskevin commented 9 years ago

Seems like this is the underlying problem of this issue. Fatal error: Uncaught exception 'MetzWeb\Instagram\InstagramException' with message 'Error: _makeCall() - cURL error: Unknown SSL protocol error in connection to api.instagram.com:443 ' in vendor/cosenary/instagram/src/Instagram.php:637

fer-ri commented 9 years ago

Same with me, using latest version .. any fix for this?

Thanks

fer-ri commented 9 years ago

Right now my solution just comment line around 637 of Instagram.php

image

johannesnagl commented 9 years ago

+1! received this error as well! an isset change would totally make sense.

bogdaniy commented 8 years ago

+1, same error

champsupertramp commented 8 years ago

+1

Notice: Undefined index: X-Ratelimit-Remaining in /home/..../api/Instagram.php on line 500

ugurozturk commented 8 years ago

+1

jvitasek commented 8 years ago

+1

hannunehg commented 8 years ago

+1

salvocanna commented 8 years ago

+1

hannunehg commented 8 years ago

Guys I fixed mine: Solution was to include the App Id and Key in all three files.

A mishap a day will keep the bugs away!

ghost commented 8 years ago

+1

muditmehrotra commented 8 years ago

+1 any solution?

This issue make it useless

BhautikAjmera007 commented 8 years ago

+1

Marquis-H commented 8 years ago

+1

valkirilov commented 8 years ago

+1

mistraal commented 7 years ago

This may or may not be the same for you but dumping the $headers variable showed that the X-RateLimit-Remaining index existed but in lowercase. Maybe a check on both should be made to get past this error.

Line 633 of Instagram.php From: $this->_xRateLimitRemaining = $headers['X-Ratelimit-Remaining']; To $this->_xRateLimitRemaining = isset($headers['X-Ratelimit-Remaining']) ? $headers['X-Ratelimit-Remaining'] : $headers['x-ratelimit-remaining'];