Author Topic: And now: thermometer.php issue  (Read 11337 times)

0 Members and 1 Guest are viewing this topic.

Offline eagle78

  • Member
  • *
  • Posts: 17
    • BaoBaB
And now: thermometer.php issue
« on: September 24, 2013, 08:09:54 AM »
Hi from France (again)

After the "testtags" story, here's another one, I don't explain..  #-o

Before the last mystery (above), something was working fine: the shown of the thermometer gauge on my "wxindex.php" page....
I've already checked "thermometer.php" script a few times, but it seems to be correct, as far as I can see with my little (french) eyes..

In the "ajax-dashboard" script I've found this line : <img src="thermometer.php"    height="150" width="54" alt="Température"> which looks fine, but no thermometer on the page..

Some help would be appreciated, if someone has a great idea about this issue..

Thanks in advance...

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: And now: thermometer.php issue
« Reply #1 on: September 24, 2013, 12:56:14 PM »
It would be helpful if you added your website to your profile so we could easily check your site .. I looked at your prior thread to find the URL

Looking at http://www.plebraud-baobab.org/thermometer.php?sce=view shows you have several blank lines before the starting <?php line.
For image scripts like thermometer.php, it is important that no blank lines or other characters appear before <?php in line 1 and no characters or blank lines appear after the closing ?> on the last line of the script.

The blanks cause PHP to emit a text/html header and spoil the PNG image.

You can unzip a thermometer.php from the Base-World distribution or edit your existing copy to remove the extra lines before the <?php line at the top.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline eagle78

  • Member
  • *
  • Posts: 17
    • BaoBaB
Re: And now: thermometer.php issue
« Reply #2 on: September 25, 2013, 02:36:28 AM »
It would be helpful if you added your website to your profile so we could easily check your site .. I looked at your prior thread to find the URL

Looking at http://www.plebraud-baobab.org/thermometer.php?sce=view shows you have several blank lines before the starting <?php line.
For image scripts like thermometer.php, it is important that no blank lines or other characters appear before <?php in line 1 and no characters or blank lines appear after the closing ?> on the last line of the script.

The blanks cause PHP to emit a text/html header and spoil the PNG image.

You can unzip a thermometer.php from the Base-World distribution or edit your existing copy to remove the extra lines before the <?php line at the top.

Best regards,
Ken

Sorry for the inconvenience, I've just added some threads in my profile and my signature... :oops:

I've just done what you suggested me, no blank line anymore, but same issue, the thermometer is not shown on the page..
When I try to read the image alone (http://www.plebraud-baobab.org/thermometer.php) I  have an error message..  ](*,)

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: And now: thermometer.php issue
« Reply #3 on: September 25, 2013, 09:19:57 PM »
its' very close .. your thermometer.php script is emitting a PNG image, however there is one space (x20) character before the '‰PNG' marker in the image file, and that is 'spoiling' the browser display of the image.

I suggest you unzip a copy of the thermometer.php from the Base-World.zip distribution, and use your FTP client to upload it using ASCII mode (not BINARY) without any modifications (as no mods are needed for proper operation).

Thanks for updating your profile with your website URL :)

Best regards ,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline eagle78

  • Member
  • *
  • Posts: 17
    • BaoBaB
Re: And now: thermometer.php issue
« Reply #4 on: September 26, 2013, 10:15:45 AM »
Here I am again...  :-(

Unfortunately, I don't understand why this "php" has an issue... I've downloaded a new one, coming from "Base World", without any change in it, uploaded on my website, and...
nothing... No thermometer image is shown..

Something strange happens when my "wxindex" page is loaded, it seens like something else is shown before (different weather icons, for instance, and the place where the thermometer stands is shown, but not the image) and after few seconds, the page is fixed....

I wonder if there's not a problem with the "Ajax-dashboard6.php" which is loaded on my website...
Still have issue even if I load "thermometer.php" page alone..

 ](*,) ](*,) ](*,) this wall is not a joke..
« Last Edit: September 26, 2013, 11:07:08 AM by eagle78 »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: And now: thermometer.php issue
« Reply #5 on: September 26, 2013, 02:48:23 PM »
The script looks fine -- nothing before the <?php and nothing after the ending ?> line.

I think the issue is with your hoster ( oxito.com ?)

When a fetch to a real PNG image is done, the response is as expected
Quote
Fetching http://www.plebraud-baobab.org/ajax-images/wr-calm.png ...
GET /ajax-images/wr-calm.png HTTP/1.1
Host: www.plebraud-baobab.org
Connection: close
User-Agent: Sam Spade 1.14


HTTP/1.1 200 OK
Date: Thu, 26 Sep 2013 18:37:06 GMT
Server: Apache
Last-Modified: Fri, 20 Sep 2013 08:19:46 GMT
ETag: "1d140cc-d39-4e6cc55520c80"
Accept-Ranges: bytes
Content-Length: 3385
Connection: close
Content-Type: image/png

‰PNG followed by image bytes.

When the thermometer.php is fetched, the response is quite different
Quote
Fetching http://www.plebraud-baobab.org/thermometer.php ...
GET /thermometer.php HTTP/1.1
Host: www.plebraud-baobab.org
Connection: close
User-Agent: Sam Spade 1.14

HTTP/1.1 200 OK
Date: Thu, 26 Sep 2013 18:29:23 GMT
Server: Apache
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: PHPSESSID=68fb10822184e9b049d339fe7b026827; path=/
Connection: close
Transfer-Encoding: chunked
Content-Type: image/png

41e
 ‰PNG
and it is the space before the ‰PNG that is causing the problem.  Also, they seem to switch to chunked transfer encoding, which they do not do for ordinary PHP pages.  It is likely some setting in their default PHP configuration that is causing the issue.. you should raise it with the technical support for your hoster.  There are over 700+ hosted websites successfully using this script (thermometer.php) .. since your script is the same as theirs, it should run like the other 700+ .. that is why I suspect the hoster is the cause of the issue.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline eagle78

  • Member
  • *
  • Posts: 17
    • BaoBaB
Re: And now: thermometer.php issue
« Reply #6 on: September 27, 2013, 01:46:29 AM »
The script looks fine -- nothing before the <?php and nothing after the ending ?> line.

I think the issue is with your hoster ( oxito.com ?)

When a fetch to a real PNG image is done, the response is as expected
Quote
Fetching http://www.plebraud-baobab.org/ajax-images/wr-calm.png ...
GET /ajax-images/wr-calm.png HTTP/1.1
Host: www.plebraud-baobab.org
Connection: close
User-Agent: Sam Spade 1.14


HTTP/1.1 200 OK
Date: Thu, 26 Sep 2013 18:37:06 GMT
Server: Apache
Last-Modified: Fri, 20 Sep 2013 08:19:46 GMT
ETag: "1d140cc-d39-4e6cc55520c80"
Accept-Ranges: bytes
Content-Length: 3385
Connection: close
Content-Type: image/png

‰PNG followed by image bytes.

When the thermometer.php is fetched, the response is quite different
Quote
Fetching http://www.plebraud-baobab.org/thermometer.php ...
GET /thermometer.php HTTP/1.1
Host: www.plebraud-baobab.org
Connection: close
User-Agent: Sam Spade 1.14

HTTP/1.1 200 OK
Date: Thu, 26 Sep 2013 18:29:23 GMT
Server: Apache
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: PHPSESSID=68fb10822184e9b049d339fe7b026827; path=/
Connection: close
Transfer-Encoding: chunked
Content-Type: image/png

41e
 ‰PNG
and it is the space before the ‰PNG that is causing the problem.  Also, they seem to switch to chunked transfer encoding, which they do not do for ordinary PHP pages.  It is likely some setting in their default PHP configuration that is causing the issue.. you should raise it with the technical support for your hoster.  There are over 700+ hosted websites successfully using this script (thermometer.php) .. since your script is the same as theirs, it should run like the other 700+ .. that is why I suspect the hoster is the cause of the issue.

Best regards,
Ken

Thank's for this complete answer, I understand where could be the problem.. A few weeks ago, everything was fine, nothing seems beeing changed in my hoster, perharps they've made some settings. It's time to ask them what's going on...

I have (at last) some holidays for 2 weeks, I'll be back to close this topic with good news... (I hope so).  8-) Stay in touch..

Offline eagle78

  • Member
  • *
  • Posts: 17
    • BaoBaB
Re: And now: thermometer.php issue
« Reply #7 on: September 27, 2013, 07:21:12 AM »
Just one thing I remember now  #-o

On my main page (wxindex) you can find "cloud-base.php" script, which seems to work as the "thermometer" one, making a "png" image.. It works fine

I've tried to contact Oxito who says: "we are not in charge with that kind of problem, it is yours..." End of contact..  :evil:

Tried also to look how avoiding "chunkng" by downgrading HTTP/1.1 to 1.0... it's a mess...


 

anything