wwfc_barmy_army Posted October 9, 2006 Share Posted October 9, 2006 Hello.I have been developing a site on my personal webserver on my computer but today i went to make it live on the net but i am getting this error on my server but not on my personal webserver:[quote]Fatal error: Call to undefined function: date_default_timezone_set() in /home/rpgsfind/public_html/site.php on line 72[/quote]It's with this bit of code:[code=php:0]<?phpdate_default_timezone_set("US/Eastern");list($year, $mon, $day) = explode('-', $qry[4]);$sevenDays = (7 * 24 * 60 * 60); // 604,800 seconds in 7 days$entryTime = strtotime("$year-$mon-$day");$now = strtotime("now");if (($now - $entryTime) < $sevenDays){echo "<img src='images/new.gif'>";}?>[/code]Why isn't it working on the live server, do i need to change something? any advice is welcome.Thanks.Peter. Link to comment https://forums.phpfreaks.com/topic/23404-date_default_timezone_set-problem/ Share on other sites More sharing options...
HuggieBear Posted October 9, 2006 Share Posted October 9, 2006 Make sure the PHP version you're using on the site is greater than or equal too Version 5.1.0Create a file on the site called phpinfo.php and have it look like this:[code]<?php phpinfo();?>[/code]When you run it, it should produce the info you're after.RegardsHuggie Link to comment https://forums.phpfreaks.com/topic/23404-date_default_timezone_set-problem/#findComment-106152 Share on other sites More sharing options...
wwfc_barmy_army Posted October 9, 2006 Author Share Posted October 9, 2006 Thanks for your reply i have version PHP Version 4.4.3. Is this the problem?Thanks.Peter. Link to comment https://forums.phpfreaks.com/topic/23404-date_default_timezone_set-problem/#findComment-106154 Share on other sites More sharing options...
HuggieBear Posted October 9, 2006 Share Posted October 9, 2006 Yes, I'm afraid so.If you look at the page in the manual for [url=http://uk.php.net/manual/en/function.date-default-timezone-set.php]date_default_timezone_set()[/url] you'll see it only works with versions later than 5.1.0RegardsHuggie Link to comment https://forums.phpfreaks.com/topic/23404-date_default_timezone_set-problem/#findComment-106155 Share on other sites More sharing options...
wwfc_barmy_army Posted October 9, 2006 Author Share Posted October 9, 2006 Ah, so whats the advantage of having php 4 over php 5 and is there a reason i shouldn't update?Thanks. Link to comment https://forums.phpfreaks.com/topic/23404-date_default_timezone_set-problem/#findComment-106156 Share on other sites More sharing options...
HuggieBear Posted October 9, 2006 Share Posted October 9, 2006 There's no advantage of having php4 over php5, otherwise they wouldn't have released 5 :)As for updating, as PHP6 development is well under way and PHP5 has been out for a long time, I'd say if you have the option to upgrade then do. Unfortunately I don't have that option as I use hosted services as opposed to my own.I'm sure others will come to the party and chip in their two cents if I've advised incorrectly though.RegardsHuggie Link to comment https://forums.phpfreaks.com/topic/23404-date_default_timezone_set-problem/#findComment-106157 Share on other sites More sharing options...
wwfc_barmy_army Posted October 9, 2006 Author Share Posted October 9, 2006 Thanks for your advice HuggieBear. :)Thanks.Peter. Link to comment https://forums.phpfreaks.com/topic/23404-date_default_timezone_set-problem/#findComment-106158 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.