Web Page full of Errors

All of a sudden my web page is displaying TONS of html errors

The only thing I updated was the buoy.php file, but that was like 2+ weeks ago.

Web page has worked fine since. NO other changes.

Any thoughts?

Thanks,

Did your host change php version?

The first error I see “Warning: date(): It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone ‘UTC’ for now, but please set date.timezone to select your timezone. in /home4/paul/public_html/Settings.php on line 104” appears to be because you have used the php date/time function in settings.php on line 104

$SITE['copyr']            = '© ' . date("Y",time()) . ', www.deputydawgwx.com';

before the timezone is defined which doesn’t happen until line 334.

The other errors also reference line 104 so I would try hard coding 2018 in there and see if it fixes stuff.

edit settings.php

I found this:

SITE[‘tz’] = ‘America/New_York’; //NOTE: this MUST be set correctly to
// translate UTC times to your LOCAL time for the displays.
// http://us.php.net/manual/en/timezones.php has the list of timezone names
// pick the one that is closest to your location and put in $SITE[‘tz’] like:
// $SITE[‘tz’] = ‘America/Los_Angeles’; // or
// $SITE[‘tz’] = ‘Europe/Brussels’;
// note: date format used for PHP parts only. Weather software dates are not processed
// except on the astronomy page

Looks like the line that has America/Los_Angeles should be something on my coast - like New_York - AND IF I read correctly the line itself is commented so I need to take out the “//”

Think that would help?

In settings.php its complaining about line 104:

$SITE[‘copyr’] = '© ’ . date(“Y”,time()) . ‘, www.deputydawgwx.com’;

Looking again I did set it to NY

############################################################################

Sitewide configuration - Station location, identity and date/time info

############################################################################

$SITE[‘organ’] = ‘DeputyDawgWx’;
$SITE[‘copyr’] = '© ’ . date(“Y”,time()) . ‘, www.deputydawgwx.com’;
$SITE[‘location’] = ‘DeKalb County, Georgia USA’;
$SITE[‘email’] = ‘mailto:[email protected]’;

Station location: latitude, longitude, cityname

$SITE[‘latitude’] = ‘33.8102230’; //North=positive, South=negative decimal degrees
$SITE[‘longitude’] = ‘-84.3486610’; //East=positive, West=negative decimal degrees
$SITE[‘cityname’] = ‘DeKalb County’;

$SITE[‘tz’] = ‘America/New_York’; //NOTE: this MUST be set correctly to
// translate UTC times to your LOCAL time for the displays.
// http://us.php.net/manual/en/timezones.php has the list of timezone names
// pick the one that is closest to your location and put in $SITE[‘tz’] like:
// $SITE[‘tz’] = ‘America/Los_Angeles’; // or
// $SITE[‘tz’] = ‘Europe/Brussels’;
// note: date format used for PHP parts only. Weather software dates are not processed
// except on the astronomy page

$SITE[‘timeFormat’] = ‘D, d-M-Y g:ia T’; // Day, 31-Mar-2006 6:35pm Tz (USA Style)
//$SITE[‘timeFormat’] = ‘m/d/Y g:ia’; // USA format 03/31/2006 14:03
//$SITE[‘timeFormat’] = ‘d/m/Y H:i’; // Euro format 31/03/2006 14:03
//$SITE[‘timeFormat’] = ‘Y-m-d H:i’; // ISO format 2006-03-31 14:03

$SITE[‘timeOnlyFormat’] = ‘g:ia’; // USA format h:mm[am|pm
//$SITE[‘timeOnlyFormat’] = ‘H:i’; // Euro format hh:mm (hh=00…23);
$SITE[‘dateOnlyFormat’] = ‘d-M-Y’; // for 31-Mar-2008 or ‘j/n/Y’ for Euro format

But you set it after you need it set for php date/time:

############################################################################

Sitewide configuration - Station location, identity and date/time info

############################################################################

$SITE[‘organ’] = ‘DeputyDawgWx’;
$SITE[‘copyr’] = '© ’ . date(“Y”,time()) . ‘, www.deputydawgwx.com’;
$SITE[‘location’] = ‘DeKalb County, Georgia USA’;
$SITE[‘email’] = ‘mailto:[email protected]’;

Station location: latitude, longitude, cityname

$SITE[‘latitude’] = ‘33.8102230’; //North=positive, South=negative decimal degrees
$SITE[‘longitude’] = ‘-84.3486610’; //East=positive, West=negative decimal degrees
$SITE[‘cityname’] = ‘DeKalb County’;

$SITE[‘tz’] = ‘America/New_York’; //NOTE: this MUST be set correctly to
// translate UTC times to your LOCAL time for the displays.
// http://us.php.net/manual/en/timezones.php has the list of timezone names
// pick the one that is closest to your location and put in $SITE[‘tz’] like:
// $SITE[‘tz’] = ‘America/Los_Angeles’; // or
// $SITE[‘tz’] = ‘Europe/Brussels’;
// note: date format used for PHP parts only. Weather software dates are not processed
// except on the astronomy page

I’m confused…

What I have is the same as what you have. The $site[‘copy’} line

Here is a screen shot of the code with line numbers. It looks the same as what you pasted

Do you have a screen shot of how yours looks perhaps?


Screen Shot 2018-10-07 at 6.49.53 PM.png

Sorry, let me try that again…

On line 104 you are using the php data/time functions to get the date which is used to display the copyright date on your webpage.

$SITE[‘copyr’] = '© ’ . date(“Y”,time()) . ‘, www.deputydawgwx.com’;

php is complaining because it doesn’t allow you to use that function without setting the timezone, and you only do that later later in the settings.php at line 334 (although you do define the time zone on line 112).

Try changing 104 to

$SITE[‘copyr’] = '© ‘2018, www.deputydawgwx.com’;

cut/pasted your line 104

now i get:

Parse error: syntax error, unexpected ‘2018’ (T_LNUMBER) in /home4/paul/public_html/Settings.php on line 104

So I put back to how it was. I’m also confused how this happened. Nothing I would have done to change this. Was working fine a few days ago, last I checked.

On second thought I did get an email from host site a few days ago that my PW was changed on my site (around midnight while I was fast asleep). I logged in and changed it.
Wonder if someone went in and changed this? who and why is a mystery

My guess is that they updated the version of php.

I will give them a call tomorrow

Hopefully Ken is reading this. When I logged on to his site with the templates, his code looks different
Instead of Los_Angeles he had PST8PDT

Otherwise, i’m clueless.

Thanks none the less for looking at this

One more then I have to run:

$SITE[‘copyr’] = ‘© 2018, www.deputydawgwx.com’;

WOW that FIXED Everything !!!

Question… do I have to change this on Jan 1 to be 2019?

Any thoughts as to what happened? I swear i never changed anything.

Gotta go now but I’ll figure that out before new year :lol:

I really think the version of php changed, this issue would only arise with later versions.

Use the code from Ken’s template settings.php, it uses gmdate which defaults to GMT so it doesn’t depend on the time zone setting.

$SITE['copyr']			= '© ' . gmdate("Y",time()) . ', Your Weather Website';

Change the line in Settings.php from

$SITE[‘copyr’] = '© ’ . date(“Y”,time()) . ‘, www.deputydawgwx.com’;

to

$SITE[‘copyr’] = '© ’ . gmdate(“Y”,time()) . ‘, www.deputydawgwx.com’;

to eliminate the warning. The timezone is not set until later in Settings.php, but gmdate() is good to use anywhere.

Just curious… :?

Why not move the setting of the timezone [ie: ‘date_default_timezone_set()’] up into the configuration file (before any of the date-related functions are used) rather than relying on the ‘gmdate()’ function as a ‘bandage’ solutions… :roll:

More likely, in a (near) future version of PHP, the ‘gmdate()’ function will be displaying the same warning situation that the ‘date()’ function is now displaying… :-k

gmdate will never display a warning as, per definition, all times in PHP are UTC. So gmdate is always correct everywhere with any server, regardless of the server time-zone.
The only drawback is the few hours every new-year that the year in the copyright notice is off for the timezone difference. Somewhere there will be a webserver to early displaying next year. 11 or 12 hours before the real new year.
Someone will notice that and post a message here on the forum :smiley:
Wim