Instagram-PHP-API icon indicating copy to clipboard operation
Instagram-PHP-API copied to clipboard

Undefined index: X-Ratelimit-Remaining

Open ahmad opened this issue 9 years ago • 17 comments

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

ahmad avatar Jun 19 '15 20:06 ahmad

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

chantskevin avatar Jun 30 '15 08:06 chantskevin

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

Thanks

fer-ri avatar Jul 12 '15 18:07 fer-ri

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

image

fer-ri avatar Jul 12 '15 18:07 fer-ri

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

johannesnagl avatar Aug 27 '15 14:08 johannesnagl

+1, same error

bogdaniy avatar Dec 10 '15 23:12 bogdaniy

+1

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

champsupertramp avatar Feb 02 '16 14:02 champsupertramp

+1

ugurozturk avatar Apr 29 '16 15:04 ugurozturk

+1

jvitasek avatar May 20 '16 06:05 jvitasek

+1

hannunehg avatar May 21 '16 07:05 hannunehg

+1

salvocanna avatar May 24 '16 09:05 salvocanna

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!

hannunehg avatar May 25 '16 17:05 hannunehg

+1

ghost avatar Jul 12 '16 20:07 ghost

+1 any solution?

This issue make it useless

muditmehrotra avatar Aug 29 '16 13:08 muditmehrotra

+1

BhautikAjmera007 avatar Sep 05 '16 10:09 BhautikAjmera007

+1

Marquis-H avatar Sep 27 '16 05:09 Marquis-H

+1

valkirilov avatar Oct 07 '16 12:10 valkirilov

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'];

mistraal avatar Nov 28 '16 17:11 mistraal