I was using file_get_contents() to fetch information from an external URL. It was working perfectly on the server before. But now, somehow it fails to work on the server. (No changes in the codes.) It keeps giving me the error: failed to open stream: Connection timed out
.
I have tested it on localhost
and it works perfectly. I have checked allow_url_fopen
option, it is still On
.
So, what could be the reason(s)?