Page 1 of 1

Time issue on new web server

Posted: Wed Mar 23, 2016 1:48 pm
by Annie
Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: server, time

Write your message below:
I had my whole cPanel migrated to a new server but I'm running into a slight problem. The old server was in America and my new one is in the UK. When someone posts to the guestbook, the time is 5 hours ahead. Is there somewhere in the script where I can update the time?

Re: Time issue on new web server

Posted: Wed Mar 23, 2016 2:00 pm
by Klemen
Add something like this to the bottom of the settings.php file:

Code: Select all

date_default_timezone_set('America/New_York');
Supported time zones are here: http://php.net/manual/en/timezones.america.php

Re: Time issue on new web server

Posted: Wed Mar 23, 2016 2:22 pm
by Annie
Thanks for the reply. Unfortunately it didn't work. The script is usually installed on a different domain but I haven't updated the nameservers for that one so a copy of it can be seen at http://www.shopwithsam.uk/guestbook/gbook.php where the nameservers for this domain do point to the new server. I used the following;
date_default_timezone_set('Europe/London');

I'm using version 1.7. I tried installing a brand new installation of version 1.7.2 but I can't even get that one to show up - http://www.shopwithsam.uk/guestbook2/gbook.php

My new hosting company don't seem to be able to sort it out but I'm wondering whether there's something in the cPanel settings somewhere which is overriding the time.

Re: Time issue on new web server

Posted: Thu Mar 24, 2016 2:43 pm
by Klemen
You can try asking your hosting company to set the correct timezone for your account.

You get a blank page probably because of errors in the settings.php file.

Re: Time issue on new web server

Posted: Thu Mar 24, 2016 4:22 pm
by Annie
Thanks for getting back to me. I didn't get very far with the new hosting company. I've also checked the settings.php file several times and can't spot a mistake. The server is Cloud Linux. Is this different to normal Linux and could this be the problem?

Re: Time issue on new web server

Posted: Thu Mar 24, 2016 7:29 pm
by Klemen
Cloudlinux doesn't make a difference.

The blank page is almost certainly due to a syntax error. Do you have any "error_log" files generated in the 1.7.2 folder? Do you get the same blank page error if you upload an original unmodified settings file?

Re: Time issue on new web server

Posted: Thu Mar 24, 2016 8:04 pm
by Annie
Thanks for the error log tip. I found a missing ; (semi-colon) on one of the lines.

Re: Time issue on new web server

Posted: Thu Mar 24, 2016 8:23 pm
by Annie
The 1.7.2 version at http://www.shopwithsam.uk/guestbook2/gbook.php doesn't show a time of the post. I can't remember how it got there in the 1.7 version. Tried searching the forum but the word 'time' won't come up.

Re: Time issue on new web server

Posted: Fri Mar 25, 2016 11:00 am
by Klemen

Re: Time issue on new web server

Posted: Fri Mar 25, 2016 4:57 pm
by Annie
That worked a treat. Many thanks.