Author Topic: space-weather.php  (Read 8994 times)

0 Members and 1 Guest are viewing this topic.

Offline Forever

  • Senior Contributor
  • ****
  • Posts: 241
Re: space-weather.php
« Reply #75 on: May 18, 2024, 01:52:42 PM »
If I click the link on my server, I do get the image.

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 868
  • #conligwx
    • conligwx.org
Re: space-weather.php
« Reply #76 on: May 18, 2024, 02:12:17 PM »
so there must be some permission issue with your server downloading to the cache directory of your webserver.  log files should be on the server.  are you running apache or Windows IIS?
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline Forever

  • Senior Contributor
  • ****
  • Posts: 241
Re: space-weather.php
« Reply #77 on: May 18, 2024, 02:16:39 PM »
It's running Windows IIS and I did not see anything odd in the logs.

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 868
  • #conligwx
    • conligwx.org
Re: space-weather.php
« Reply #78 on: May 18, 2024, 02:23:46 PM »
It's running Windows IIS and I did not see anything odd in the logs.


in apache there are error logs and web logs.  not sure about IIS however, but if the image cannot be downloaded or a permission issue is there, then it would be logged.

check the windows event logs too just incase something is an error.
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline Forever

  • Senior Contributor
  • ****
  • Posts: 241
Re: space-weather.php
« Reply #79 on: May 18, 2024, 02:37:08 PM »
Not seeing any errors or warnings in the past hour in event viewer. And in my IIS logs all I see if who assessed the clientraw.txt.

Offline Forever

  • Senior Contributor
  • ****
  • Posts: 241
Re: space-weather.php
« Reply #80 on: May 18, 2024, 03:00:00 PM »
I took one of the files and separated it for testing.

I get the following error on this link. It does create the image-space-aurora-tomorrow.png file but at 0K.
https://www.weathercat.net/test/image-space-aurora-tomorrow.php

PHP Notice:  getimagesize(): Error reading from ./image-space-aurora-tomorrow.png! in C:\inetpub\weathercat\test\image-space-aurora-tomorrow.php on line 722

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 868
  • #conligwx
    • conligwx.org
Re: space-weather.php
« Reply #81 on: May 18, 2024, 03:39:58 PM »
Personally It seems your web server either has issues with the PHP scripts or the IIS has the wrong permissions to write the downloaded image to file.

 Hence the 0 byte file is created but not written too.  Sorry can't be of much use as I know very little on IIS

Maybe chatgpt can advise you.

Sent from my Pixel 8 Pro using Tapatalk
« Last Edit: May 18, 2024, 03:44:48 PM by ConligWX »
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline Forever

  • Senior Contributor
  • ****
  • Posts: 241
Re: space-weather.php
« Reply #82 on: May 18, 2024, 05:20:05 PM »
Did a little searching for a fix and remembered I did not setup the cacert.pem file in my PHP install when I setup my new server last year.

All is working now. :)

Offline jaltman

  • Member
  • *
  • Posts: 4
Re: space-weather.php
« Reply #83 on: September 04, 2024, 09:07:49 AM »
Works great! Thanks. I notice the SWPC Enthusiasts page has been moved.  It will auto move, but change the link on line 114 to https://www.spaceweather.gov/communities/space-weather-enthusiasts-dashboard to go directly to the new site.

Thanks to all for a great script.

Jim

Offline Vasco

  • Forecaster
  • *****
  • Posts: 488
    • PWS
Re: space-weather.php
« Reply #84 on: September 04, 2024, 02:57:30 PM »
I'm having trouble. . . https://swanston.maui.co.uk/ajax/wxspace.php

Error 003 appears to suggest "Download error: cannot write to file, check server permission settings" but I have a spaceweather-current.txt in ./cache

What am I missing?
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline hcorrin

  • Senior Contributor
  • ****
  • Posts: 163
    • Ballaugh Weather
Re: space-weather.php
« Reply #85 on: September 04, 2024, 03:56:29 PM »
the image space xxxxxx.php files in your https://swanston.maui.co.uk/ajax/ creates .png or .jpg in 2 files standard and cached in the same folder xxxxxx denotes file names
ie image-space-aurora-tomorrow.php gives
    image-space-aurora-tomorrow.png
    image-space-aurora-tomorrow-cached.png
   image-space-eit-171.php gives
    image-space-eit-171.jpg
    image-space-eit-171-cached.jpg
so looks like your ajax folder does not have enough permissions to allow the image files to be created the spaceweather-current.txt should also be in the main ajax folder

Offline Vasco

  • Forecaster
  • *****
  • Posts: 488
    • PWS
Re: space-weather.php
« Reply #86 on: September 04, 2024, 04:50:40 PM »
the image space xxxxxx.php files in your https://swanston.maui.co.uk/ajax/ creates .png or .jpg in 2 files standard and cached in the same folder. . . so looks like your ajax folder does not have enough permissions to allow the image files to be created

Thanks. I am not prepared to do that, so goodbye space-weather  :sad:

Shame. . . I spent a lot of time adding my CURLOPT_PROXY to 14 files.

Quote
the spaceweather-current.txt should also be in the main ajax folder

There is a ./cache folder. Maybe I should be running it standalone.

EDIT: the reason I have a spaceweather-current.txt in ./cache is because I changed line 74 to read
Code: [Select]
$cacheName      = './cache/spaceweather-current.txt';
in desperation. . .  :???:

It only contains the 3-day forecast.
« Last Edit: September 05, 2024, 04:41:01 AM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline Vasco

  • Forecaster
  • *****
  • Posts: 488
    • PWS
Re: space-weather.php
« Reply #87 on: September 04, 2024, 06:43:48 PM »
There is a ./cache folder.

I see that I can define

Code: [Select]
$localDirectory = './';
in the image files. . . presumably 13 times.
« Last Edit: September 05, 2024, 04:42:34 AM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline hcorrin

  • Senior Contributor
  • ****
  • Posts: 163
    • Ballaugh Weather
Re: space-weather.php
« Reply #88 on: September 05, 2024, 04:51:46 AM »
I think you will need to add the cache folder to lines 152 and 172 as well as 187

Offline Vasco

  • Forecaster
  • *****
  • Posts: 488
    • PWS
Re: space-weather.php
« Reply #89 on: September 05, 2024, 05:02:30 AM »
I see what you mean. . . Thanks!
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline hcorrin

  • Senior Contributor
  • ****
  • Posts: 163
    • Ballaugh Weather
Re: space-weather.php
« Reply #90 on: September 05, 2024, 05:43:28 AM »
I just tried one file as a test but it did not like lines 152 and 172 changing gave error 000 forbidden character for those lines

Offline Vasco

  • Forecaster
  • *****
  • Posts: 488
    • PWS
Re: space-weather.php
« Reply #91 on: September 05, 2024, 05:56:09 AM »
Thanks. Yes, it says "note: only letters, numbers, dash, underscore, and dots allowed"

As a test I tried just changing line 187 in image-space-aurora-tomorrow.php, and got image-space-aurora-tomorrow.png (only) written to ./cache/. Unfortunately it is empty, and the space-weather page shows Error 007: file not gif, jpg, or png  :???:

Not sure I understand this:
Code: [Select]
#####
# cache only option (to preserve animated GIFs when you do not need to resize, crop, or text overlay)
#####
$cache_only = 0; # just download and cache the file (ONLY!!), NO resize, NO crop, and NO text overlay
# Default set to 0 for no cache-only.
# note: setting this option $cache_only = 1;
# WILL BYPASS all other settings for resize, crop, and text overlay!!
« Last Edit: September 05, 2024, 07:40:21 AM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline Vasco

  • Forecaster
  • *****
  • Posts: 488
    • PWS
Re: space-weather.php
« Reply #92 on: September 05, 2024, 02:12:40 PM »
All image files edited, so now all images show Error 007 from the empty image files in ./cache/. . .  :sad:

Flyout menu Miscellaneous > Space Weather now shows the enthusiasts' dashboard, but anyone who is interested can still see my problem at https://swanston.maui.co.uk/ajax/wxspace.php

Wonder if I have the same cacert.pem problem as @Forever. . . I'll have to ask my host.

EDIT: apparently not.
« Last Edit: September 05, 2024, 03:03:55 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline Vasco

  • Forecaster
  • *****
  • Posts: 488
    • PWS
Re: space-weather.php
« Reply #93 on: September 05, 2024, 07:00:29 PM »
Wonder if I have the same cacert.pem problem as @Forever. . . I'll have to ask my host.

EDIT: apparently not.

But he did point out that there were two cURL calls in each image file, and I'd only added the proxy to one of them  :oops:

So nearly there. . . except the 3-day Solar-Geophysical Forecast seems to have a verbose heading rather than the customary 2 lines. . . all I did was change
Code: [Select]
$cacheName      = './spaceweather-current.txt';  // used to cache the file
to
Code: [Select]
$cacheName      = './cache/spaceweather-current.txt';  // used to cache the file

. . . I think.
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline hcorrin

  • Senior Contributor
  • ****
  • Posts: 163
    • Ballaugh Weather
Re: space-weather.php
« Reply #94 on: September 06, 2024, 04:05:32 AM »
Looks like you have got it sorted

Offline Vasco

  • Forecaster
  • *****
  • Posts: 488
    • PWS
Re: space-weather.php
« Reply #95 on: September 06, 2024, 06:12:49 AM »
Looks like you have got it sorted

All except the header to the 3-day forecast  :???:

Does your spaceweather-current.txt have a header?
« Last Edit: September 06, 2024, 06:45:17 AM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline hcorrin

  • Senior Contributor
  • ****
  • Posts: 163
    • Ballaugh Weather
Re: space-weather.php
« Reply #96 on: September 06, 2024, 07:00:41 AM »
Not sure about header but the text at the top is printed on page as is yours

Offline Vasco

  • Forecaster
  • *****
  • Posts: 488
    • PWS
Re: space-weather.php
« Reply #97 on: September 06, 2024, 07:26:14 AM »
Not sure about header but the text at the top is printed on page as is yours

Sorry, I was experimenting! I get all the cURL header info as well as the "Product: 3-day Forecast" lines. If I comment out the CURLOPT_HEADER line 459 it seems to work OK.
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline jaltman

  • Member
  • *
  • Posts: 4
Re: space-weather.php
« Reply #98 on: September 06, 2024, 09:02:27 AM »
Looks like it might be the 3-day forecast that has an issue.

Jim

Offline Vasco

  • Forecaster
  • *****
  • Posts: 488
    • PWS
Re: space-weather.php
« Reply #99 on: September 06, 2024, 09:11:54 AM »
Yes, but you don't have the cURL header and neither does @hcorrin.

Maybe my cURL proxy redirect gives me a second header. . . it has been a problem before. But, as I say, I can always comment out the CURLOPT_HEADER line.
« Last Edit: September 06, 2024, 09:14:54 AM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

 

anything