I do not know about your localhost , but this is what I deduced from your script.
Your website (or the page you are accessing) constantly redirects to a new URL every time PHP tries to access the URL. When the maximum redirect limit is reached, i.e. PHP, PHP stops following and gives you an error.
This is because a PHP request is a simple http request that does not process session / cookie values. Thus, your site always considers it as a new request and saves the redirect.
To check, please note that when you open the URL ( https://dev.kidengage.com/library ) in an incognito window, it redirects you to https://dev.kidengage.com/hyderabad to set the location for the user. And, after the cookies are set, no more redirection occurs for this URL.
Here redirects occur.
So, you need to fix this first or write a custom CURL script to retrieve data that can handle the session, as well as redirects.
Hope this helps.
source share