After I installed and setup this module (ICAO code: LDZA), I tried to enable the weather block, but it failed:
* warning: file_get_contents(ftp://weather.noaa.gov/data/observations/metar/stations/EDDH.TXT) [function.file-get-contents]: failed to open stream: Connection timed out in /myweb/modules/weather/weather.module on line 548.
* Download location for METAR data is not accessible.
Comments
Comment #1
toddy commentedHi,
on some rare occasions, the FTP site weather.noaa.gov is not responding. Do you still see this error? I can right now fetch the data just fine.
Comment #2
jazzitup commentedStill nothing... for LDZA, or LDZG now it returns:
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /myweb/modules/weather/icao_codes.inc on line 36.
Comment #3
Anonymous (not verified) commentedI have the same problem in line 840 of the weather module. Version 4.7.x-2.0.
Message:
Warning: file_get_contents(ftp://weather.noaa.gov/data/observations/metar/stations/EHGG.TXT) [function.file-get-contents]: failed to open stream: Connection timed out in /home/mnadvies/public_html/drupal/modules/weather/weather.module on line 840
When I follow the link ftp://weather.noaa.gov/data/observations/metar/stations/EHGG.TXT in my browser, the text of the file EHGG.TXT (2006/11/16 01:25
EHGG 160125Z AUTO 18012KT 150V220 9999NDV NCD 11/09 Q1002) is shown.
Martin
Comment #4
scriptnews commentedHi
Great module ... but
seems that I have the same problem.
On y server, I know that certain file fetch functions are disabled.
The solution to fetch files from other servers - like here - wouild be to do it either wget or cURL.
Would it be to hard to change or include different opions.
It might even be interesting to have the option to work with local files, ... ?
Just 2 cents.
Roland
Comment #5
frog commentedI also am on a server (Dreamhost) that disables certain file access functions. I searched on the error, and many other modules have this problem, too. Some have used CURL for a workaround solution. But I am not entirely sure how to implement it. Below is my error message:
* warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/.furgie/emlast/sumterguide.goofyorgan.com/modules/weather/weather.module on line 569.
* warning: file_get_contents(ftp://weather.noaa.gov/data/observations/metar/stations/KSSC.TXT) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/.furgie/emlast/sumterguide.goofyorgan.com/modules/weather/weather.module on line 569.
* Download location for METAR data is not accessible.
Comment #6
toddy commentedHi,
thanks for the suggestion, I'll look into implementing CURL for getting the data. However, if the PHP installation you're working with is really strict about outgoing connections, I'm afraid that no solution will possibly make the module work. Nevertheless, alternative download mechanisms are surely worth being implemented. Stay tuned.
Regards,
Tobias
Comment #7
toddy commentedComment #8
toddy commentedI've modified the module to only use the current download mechanism if it's really available. As an alternative approach, the module tries to use CURL if that's available. If both functions are not provided by your PHP installation, it fails with the message that the download location is not available.
Please download and test weather-4.7.x-2.1. Unfortunately, I cannot test the CURL functions myself. I'd appreciate feedback if the CURL implementation works for you.
Regards,
Tobias
Comment #9
Anonymous (not verified) commentedA fast test:
The same error in Version 2.0:
Warning: file_get_contents(ftp://weather.noaa.gov/data/observations/metar/stations/EHGG.TXT) [function.file-get-contents]: failed to open stream: Connection timed out in /home/mnadvies/public_html/drupal/modules/weather/weather.module on line 857
Comment #10
toddy commentedVersion 2.0 does not support CURL. Please use version 2.2, which supports CURL and wget.
Comment #11
jazzitup commentedI've tried v2.1 (the link you provided here), but the module failed to create a table "weather_config", so I've created it manually (I blame '{' and '}' around the table name within the file weather.install).
After I selected my hometown on administer > weather, I went to administer > blocks to enable the block. I've found two disabled blocks:
Custom user weather
System-wide weather
My 2 cents
I wouldn't recommend those names, because of usability (ability to quickly locate the blocks of the weather module, ordered alphabetically within the list of other modules), so I suggest these names:
Weather: custom user
Weather: system-wide
After I tried to enable "Custom user weather" block, the block doesn't appear on my site and when I tried to enable block "System-wide weather" block, my browser tried to fetch the data with no success (more than 2min. of delay).
The warning message:
Comment #12
Anonymous (not verified) commentedAfter reinstalling version 2.2 and reinstalling de 2 database tabels the following error is displayed after installing a block of the weather module:
Warning: file_get_contents(ftp://weather.noaa.gov/data/observations/metar/stations/EDDH.TXT) [function.file-get-contents]: failed to open stream: Connection timed out in /home/mnadvies/public_html/drupal/modules/weather/weather.module on line 850
Martin
Comment #13
toddy commentedReading the error message, it looks like your PHP installation is able to use file_get_contents() with an outside URL. However, the fetching fails for some different reason. Can you actually use any other module with tries to fetch data from outside sources? It looks to me like a problem with your setup. Maybe you're behind a firewall or something which blocks these requests?
Comment #14
Anonymous (not verified) commentedLet's first say: I am absolute not an php expert!!
Yesterday I tested the script for fetching the METAR data. In the weather module I changed the script from line 847 til the command text "//check on errors".
I have BlueHost as hosting provider, and my phpinfo() says that curl is installed.
I know that Blue host has a firewall installed. A test with cgi-bin/firewal gives:
I also have Google maps and Google Ads installed and working. So there is communication to the outside www.
Test:
Result:Error message: Download location for METAR data is not accessible.
IMO: $metar_raw === false.
I changed: $curl = curl_init(); to $curl = curl_init($url): same bad result.
My test site is www.evenementen.steb.nl. The module is installed at this moment.
Comment #15
toddy commentedHm, maybe the FTP access is somehow blocked by your provider, I don't know. There's still a small chance to get this module working. Could you please replace the entire function _weather_retrieve_data() with the following code snippet? It tries to get the METAR data via HTTP POST, not FTP. If this does not work out, I'm afraid I have no more ideas how to resolve your problem.
Comment #16
Anonymous (not verified) commentedYES: you are perfect!! Thanks
Comment #17
toddy commentedGood to hear :-)
I'll release a new version of the module shortly, which will also support different images for day and night.
Regards,
Tobias
Comment #18
Anonymous (not verified) commentedComment #19
frog commentedThe CURL fixes a lot of my problems. Thanks so much! Now, if I could only get weather outside of Germany.
Comment #20
shaileshtr commentedI am too seeing the error. When open the link http://www.freefblike.com I get this error from a week. I don't know what happened with the codes, because it was unaltered from lat perfect run. Please if anybody could solve the problem. Regards!