Author Topic: Problem with new quake-json.php  (Read 2610 times)

0 Members and 1 Guest are viewing this topic.

Offline azkiwi

  • Senior Contributor
  • ****
  • Posts: 160
    • Maricopa, Sonoran Desert, Arizona
Problem with new quake-json.php
« on: July 07, 2015, 05:57:16 PM »
Moving things to the test system for check out and play before I go 'live'.   Ftp'd quake-json.php up to test system and received the following error message

..........................

Notice: Use of undefined constant JSON_BIGINT_AS_STRING - assumed 'JSON_BIGINT_AS_STRING' in /home/content/26/9257026/html/test/quake-json.php on line 374

Warning: json_decode() expects at most 3 parameters, 4 given in /home/content/26/9257026/html/test/quake-json.php on line 374

No earthquakes of magnitude 2.0 or greater within 500 mi reported in last 7 days.

Map and data courtesy of United States Geological Survey.

......................................
Copied the old one back, it works fine.    Now, I've sorta customized my quake routines into 3 php's -- one to call for southwest, one for North America, one for the world, centered on the pacific.  My changes were in the wxquake.php (primarily location and distance stuff. )  Can't find my notes, but I did create copies of quake-json.php for each of the 3, but they all work under my old version.  I'm no longer a techie, and honestly, have no idea even where to begin.

Thanks

(the other Ken)

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Problem with new quake-json.php
« Reply #1 on: July 07, 2015, 06:11:43 PM »
You'll need PHP 5.4+ to run the new quake-json.php script -- the spec to have JSON handle BIGINT as string was added in PHP 5.4.  Some PHP 5.3 installations insisted on rendering BIGINT values in scientific notation..which broke the date display calculations.

I'd suggest updating your site to PHP 5.4+
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 dasman

  • Forecaster
  • *****
  • Posts: 491
    • Wx Peotone
Re: Problem with new quake-json.php
« Reply #2 on: July 07, 2015, 06:23:31 PM »
Ken is the following because of 5.3 as well

Warning: json_decode() expects at most 2 parameters, 4 given in /home/content/22/3672722/html/quake-json.php on line 374
 
No earthquakes of magnitude 2.0 or greater within 2000 mi reported in last 7 days.


If it is is Go Daddy 5.4?
Dave Sommerfed
Peotone Illinois USA
CW7762, KILPEOT1
NWS COOP, CoCoRaHS, Spotter Network

Offline azkiwi

  • Senior Contributor
  • ****
  • Posts: 160
    • Maricopa, Sonoran Desert, Arizona
Re: Problem with new quake-json.php
« Reply #3 on: July 07, 2015, 06:23:46 PM »
ah, thanks Ken... I'll take a gander through godaddy's offering and see what I can do..


ken

Offline azkiwi

  • Senior Contributor
  • ****
  • Posts: 160
    • Maricopa, Sonoran Desert, Arizona
Re: Problem with new quake-json.php
« Reply #4 on: July 07, 2015, 06:24:56 PM »
and thanks Dave...

you posted while replying to Ken

Offline mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
Re: Problem with new quake-json.php
« Reply #5 on: July 07, 2015, 10:44:25 PM »
I think mine is completely broken for along time it keeps saying no earthquakes within 1700 miles 1.0 mag or higher.. even if I do change the settings.. meh
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Problem with new quake-json.php
« Reply #6 on: July 08, 2015, 12:05:40 AM »
I think mine is completely broken for along time it keeps saying no earthquakes within 1700 miles 1.0 mag or higher.. even if I do change the settings.. meh

You're running a really old version of quake-json.php V1.03 - 04-Jan-2013

The USGS URL changed and so it can't retrieve the data.  Try using the new script and it will likely work (if you have PHP 5.4+ running on your site).

do a check-fetch-times.php?show=versions on your site to see which updates you need.
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 mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
Re: Problem with new quake-json.php
« Reply #7 on: July 08, 2015, 07:26:08 PM »
Thanks I keep forgetting bout checking the versions every now and then.. oops
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline dasman

  • Forecaster
  • *****
  • Posts: 491
    • Wx Peotone
Re: Problem with new quake-json.php
« Reply #8 on: July 08, 2015, 07:49:26 PM »
So I had the same error as azkiwi, so I called Go Daddy and I had php version 5.2.  I asked for php version 5.4, and an hour or so later I had it and the new release of the quake script works perfectly.
Dave Sommerfed
Peotone Illinois USA
CW7762, KILPEOT1
NWS COOP, CoCoRaHS, Spotter Network

Offline Stetson1

  • Cordera Weather
  • Forecaster
  • *****
  • Posts: 364
    • Cordera Weather
Re: Problem with new quake-json.php
« Reply #9 on: July 27, 2015, 03:12:31 PM »
Mine is not working and I have PHP Version 5.4.43. I just get a blank page, cannot figure out what is wrong. I am running the current 1.08 version of the quake-json.php. Any thoughts?

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Problem with new quake-json.php
« Reply #10 on: July 27, 2015, 03:17:24 PM »
Mine is not working and I have PHP Version 5.4.43. I just get a blank page, cannot figure out what is wrong. I am running the current 1.08 version of the quake-json.php. Any thoughts?
Please post the URL. The globe on the left below your avatar points to a non-existing website. Without the URL of your site it is very difficult to check what could be the cause.
Wim

Offline Stetson1

  • Cordera Weather
  • Forecaster
  • *****
  • Posts: 364
    • Cordera Weather
Re: Problem with new quake-json.php
« Reply #11 on: July 27, 2015, 03:28:49 PM »
Sorry, I forgot to update my profile. http://stetsonwx.com/wxquake.php is the URL.

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Problem with new quake-json.php
« Reply #12 on: July 27, 2015, 03:43:46 PM »
Sorry, I forgot to update my profile. http://stetsonwx.com/wxquake.php is the URL.
The output is normal, the script reads the file and stores it in the cache.

The message is: No earthquakes of magnitude 2.0 or greater within 200 mi reported in last 7 days.
When the script does not find any earthquakes it does not displays the map either.

To see if there is an error with the script you should widen the search area in the script to say 2000 mi.

Succes, Wim

Offline Stetson1

  • Cordera Weather
  • Forecaster
  • *****
  • Posts: 364
    • Cordera Weather
Re: Problem with new quake-json.php
« Reply #13 on: July 27, 2015, 03:57:37 PM »
Interesting, it used to display the map regardless of if any were within range. I just figured it was broken, guess I'll have to put a note on the page explaining why the map is not present.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Problem with new quake-json.php
« Reply #14 on: July 27, 2015, 06:10:06 PM »
The script displays a map ONLY if there is at least one quake to display.

Try wxquake.php?distance=1000 and it works fine, so changing your default distance would likely ensure a map is displayed.

BTW.. the quake-json.php script has worked that way from the initial release :)
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 Stetson1

  • Cordera Weather
  • Forecaster
  • *****
  • Posts: 364
    • Cordera Weather
Re: Problem with new quake-json.php
« Reply #15 on: July 28, 2015, 05:58:03 PM »
My apologies, I was unaware of that. Seems that I have always had some quake close enough to display the map.