Skip to content
Advertisement

PHP [function.file-get-contents]: Failed to open stream

This is really annoying me, the php script was working and returning the weather from open weather map but literally all of a sudden the php script takes forever to execute and the following error is produced:

Warning: file_get_contents(http://api.openweathermap.org/data/2.5/weather?lat=&lon=&units=metric&cnt=7&lang=en&key=f38a36af9e4965dd5192ba4282abe070) [function.file-get-contents]: failed to open stream: Connection timed out in /xxx/xxx/public_html/fullweather.php on line 15

Any help would be appreciated. The php script can be viewed below. Only the beginning is important (first 18 lines) but I have included the full thing.

JavaScript

Advertisement

Answer

I think the API was just down, cause the link is working for me right now. Try one more time.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement