'Warning: file_get_contents failed to open stream: Connection timed out in includes/simple_html_dom.php on line 75
All of a sudden my cronjob has stopped working properly where it grabs content through file_get_contents and started giving the following warning and fatal error. Does anyone know why it is doing this?:
Warning: file_get_contents(http://seriesgate.me/search/indv_episodes/The+Social+Network): failed to open stream: Connection timed out in includes/simple_html_dom.php on line 75
Fatal error: Call to a member function find() on a non-object in includes/seriesgate.class.php on line 25
Solution 1:[1]
Its working.
echo file_get_contents("http://seriesgate.me/search/indv_episodes/The+Social+Network");
It may be execution problem.
Try this
ini_set('max_execution_time', 300); //300 seconds = 5 minutes
echo file_get_contents("http://seriesgate.me/search/indv_episodes/The+Social+Network");
Solution 2:[2]
The Connection timed out error is a network problem for sure.
First, that's maybe your network connection problem take too long to get response from server. Please check your local/server/hosting internet connection; domain name, IP, port,... typo.
Secondly, that's maybe destination problem. For example, seriesgate.me is down for everyone, not only you. I know this question is 3 years old and the site is down. But this is best practice that you should check your destination when it's say something like Connection timed out.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | br3t |
| Solution 2 | Argus Duong |
