Trying to use file_get_contents with a specific domain always returns the code of suspendeddomain.org instead of the desired page. Can you help me understand why?
I tried to to a bit of debugging and the response I get is an HTTP code 302 with the Location parameter set to http://suspendeddomain.org/index.php?host=[[[domain I’m trying to connect to]]]
I can try, but it would help a lot if you actually included which domain is experiencing this problem.
@Admin said:
I can try, but it would help a lot if you actually included which domain is experiencing this problem.
Yes, I’m trying to send requests to https://api.telegram.org
So api.telegram.org is redirecting to suspendeddomain.org? I don’t think the Telegram Messenger API is hosted here. Are you sure you’re using the correct URLs (and it’s not a typo causing the URL to be parsed as a relative path or something, misdirecting the request)?
I’m sure, I made a php page containing only this code:
<?php echo file_get_contents("https://api.telegram.org/")?>
You can try to open the page here http://erap.space/prova.php
That’s not the exact URL I’m trying because it includes a token which I can’t publicly show, but I should get a JSON response shown in the page. The behaviour is the same anyway, it gets suspendeddomain.org instead of the correct page.
I tested other sites such as google or wikipedia but only this domain gives me problems.
I replaced the content of that file with a similar script which uses cURL, because cURL gives FAR better error output than file_get_contents
. The error shown now is SSL certificate problem: self signed certificate
.
However, Telegram is using certificates from Go Daddy, not self signed certificates, so I’m going to check what that’s about.
Thank you very much for your help, but I was trying cURL when I told you about my debugging. Sadly couldn’t make it work even with the options to ignore SSL errors and ended up with that 302 redirect again.
No news on this problem?
I just checked and it turns out the Telegram API is blocked due to abuse (too many spam bots were created using it). You need to upgrade your account if you want to use the Telegram API.
I’m very sad to hear that. Thanks anyway