darkfreaks Posted December 29, 2008 Share Posted December 29, 2008 Fatal error: Maximum execution time of 30 seconds exceeded in /home/kabooc/public_html/func.lib.php on line 293 any help would be great <?php // Turn register globals off function unregister_GLOBALS() { if ( !ini_get('register_globals') ) return; if ( isset($_REQUEST['GLOBALS']) ) die('GLOBALS overwrite attempt detected'); // Variables that shouldn't be unset $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix'); $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array()); foreach ( $input as $k => $v ) if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) ) { $GLOBALS[$k] = NULL; unset($GLOBALS[$k]); // line 293 } }?> Link to comment https://forums.phpfreaks.com/topic/138686-function-error/ Share on other sites More sharing options...
btherl Posted December 29, 2008 Share Posted December 29, 2008 Edit: Oops, you marked it I see Will reply in a moment.. Link to comment https://forums.phpfreaks.com/topic/138686-function-error/#findComment-725092 Share on other sites More sharing options...
darkfreaks Posted December 29, 2008 Author Share Posted December 29, 2008 hehe Link to comment https://forums.phpfreaks.com/topic/138686-function-error/#findComment-725093 Share on other sites More sharing options...
btherl Posted December 29, 2008 Share Posted December 29, 2008 I tried the code on my server and it didn't exceed execution time. Theres 2 avenues I would investigate 1. Is the function itself being called infinitely many times in a loop from somewhere else? 2. Can you log to a file all the variables being unset (just before you unset them) and see if there's a specific one that causes it to loop? Link to comment https://forums.phpfreaks.com/topic/138686-function-error/#findComment-725095 Share on other sites More sharing options...
darkfreaks Posted December 29, 2008 Author Share Posted December 29, 2008 i only call it once in globals.php after the session_start() like <?php session_start(); unreigster_GLOBALS();?> it usually works but now it is taking awhile to execute. :-\ Link to comment https://forums.phpfreaks.com/topic/138686-function-error/#findComment-725099 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.