TeddyKiller Posted April 14, 2010 Share Posted April 14, 2010 This script keeps giving a Fatal error. Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\uni\event.php on line 51 Whats the problem? >.< function GetDays($sStartDate, $sEndDate){ $sStartDate = gmdate("Y-m-d", $sStartDate); $sEndDate = gmdate("Y-m-d", $sEndDate); $aDays[] = date("d", strtotime($sStartDate)); $sCurrentDate = $sStartDate; while($sCurrentDate < $sEndDate){ $sCurrentDate = gmdate("Y-m-d", strtotime("+1 day", strtotime($sCurrentDate))); $aDays[] = date("d", strtotime($sCurrentDate)); } return $aDays; } $event_txt = "Dates for this holiday!<br />" . implode(", ", GetDays(strtotime($ev["event_start"]), strtotime($ev["event_end"]))) . ""; echo $event_txt; Link to comment https://forums.phpfreaks.com/topic/198509-fatal-error-maximum-execution-time/ Share on other sites More sharing options...
Deoctor Posted April 14, 2010 Share Posted April 14, 2010 change the value of max_execution_time to some higher value in the php.ini Link to comment https://forums.phpfreaks.com/topic/198509-fatal-error-maximum-execution-time/#findComment-1041627 Share on other sites More sharing options...
xt3mp0r~ Posted April 14, 2010 Share Posted April 14, 2010 Easiest way would be to add following code at beginning of your code. set_time_limit(0); Link to comment https://forums.phpfreaks.com/topic/198509-fatal-error-maximum-execution-time/#findComment-1041824 Share on other sites More sharing options...
ChemicalBliss Posted April 14, 2010 Share Posted April 14, 2010 I would reccommend a flush() now and then to make sure its working properly. cb Link to comment https://forums.phpfreaks.com/topic/198509-fatal-error-maximum-execution-time/#findComment-1041826 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.