Unstoppable Domains

Eh? What's wrong with this

Spaceship Spaceship
Watch

tm

Established Member
Impact
25
Code:
Warning: file_get_contents([url]http://www.bebo.com/grp/Grp.jsp?GrpTypeCd=BD&GrpId=1993135527[/url]) [function.file-get-contents]: failed to open stream: Connection timed out in /home/social/public_html/bebo.php on line 37

The code is obviously
file_get_contents("http://www.bebo.com/grp/Grp.jsp?GrpTypeCd=BD&GrpId=1993135527");

Why does it timeout? Doesn't take that long to load. Works fine on my localhost, but not on my server. What sort of restrictions do you think bebo are having?

I set the user agent and everything, still times out. Tried curl, times out.

Colin
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
It looks like your server is having trouble resolving domain names.

Is your site on a shared/reseller account, or is it on your own vps/dedicated server?

If it's on your own vps/dedicated, can you post the contents of resolv.conf?
 
0
•••
It's on a shared hosting account.

Tons of other sites work (in fact, every one I've tried).

Can somebody please test this code on their server to see if it works?
 
0
•••
Ah, ok.

I just ran it with curl on my dedicated server and got this:


The URL has moved <a href="http://www.bebo.com/grp/GrpNoCanDo.jsp">here</a>


Running curl on the redirected url retrieved a full webpage.

Both queries returned in seconds, but the first one hung after printing the redirect line. The page probably has a refresh redirect header which curl and file_get_contents don't follow, hence the "hanging".

So...just use the second url and it should work fine.
 
Last edited:
0
•••
Worked fine for me, but just displayed a bebo error message.

Sorry. You do not appear to have permission to view this.
 
0
•••
cef said:
Ah, ok.

I just ran it with curl on my dedicated server and got this:


The URL has moved <a href="http://www.bebo.com/grp/GrpNoCanDo.jsp">here</a>


Running curl on the redirected url retrieved a full webpage.

Both queries returned in seconds, but the first one hung after printing the redirect line. The page probably has a refresh redirect header which curl and file_get_contents don't follow, hence the "hanging".

So...just use the second url and it should work fine.

But why does it refresh? It doesn't do it in my browser. And that URL you gave doesn't have the same content as the original URL.
 
0
•••
Argh, I'm brain-dead today. Just reran it from the command line, but this time I put quotes around your original url, because of the '&' character:

curl "http://www.bebo.com/grp/Grp.jsp?GrpTypeCd=BD&GrpId=1993135527"

And it worked fine (the same page came back as I got in the browser).

Maybe try urlencoding the string in file_get_contents?
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back