Time issue on new web server

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Annie
Posts: 20
Joined: Sat May 15, 2010 5:08 pm

Time issue on new web server

Post 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?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Time issue on new web server

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Annie
Posts: 20
Joined: Sat May 15, 2010 5:08 pm

Re: Time issue on new web server

Post 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.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Time issue on new web server

Post 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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Annie
Posts: 20
Joined: Sat May 15, 2010 5:08 pm

Re: Time issue on new web server

Post 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?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Time issue on new web server

Post 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?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Annie
Posts: 20
Joined: Sat May 15, 2010 5:08 pm

Re: Time issue on new web server

Post by Annie »

Thanks for the error log tip. I found a missing ; (semi-colon) on one of the lines.
Annie
Posts: 20
Joined: Sat May 15, 2010 5:08 pm

Re: Time issue on new web server

Post 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.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Time issue on new web server

Post by Klemen »

Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Annie
Posts: 20
Joined: Sat May 15, 2010 5:08 pm

Re: Time issue on new web server

Post by Annie »

That worked a treat. Many thanks.
Post Reply