mjlogan Posted January 15, 2007 Share Posted January 15, 2007 Hi,I am working on a server with safe mode enabled, (not possible to change that), and I have a PHP script that is run via a cronjob every day. The problem is the script takes up to 10mins to run at the moment and all it is going to do is increase in time as the site grows. This isn't a problem.The problem is the time out for execution, PHP default it 30secs, and in safe mode it is not possible to change the time limit within the script, (I have a nice error log full or fatal errors saying execution time exceeded and warnings saying not possible to change the time limit).I have tried the no chance of working but hopefully:ini_set("safe_mode",0);at the top of the script.I just wondered if there was any way of disabling safe mode for a certain directory or script. Or other means of overcoming the problem of 30 seconds isn't long enough.I had thought about increasing the time limit to 15mins, but I wasn't 100% sure what side effects that would have on the rest of the site.I have complete access to the server, it's a windows machines.ThanksMark Link to comment https://forums.phpfreaks.com/topic/34236-safe-mode-question-script-timeouts/ Share on other sites More sharing options...
Orio Posted January 15, 2007 Share Posted January 15, 2007 When in safe mode, you can't use set_time_limit() nor ini_set("max_execution_time", $secs). You have no way disabling safe mode if it's on unless you do it directly- by changing your php.ini file.I made a few tests myself, I couldn't find a way to do something about it (using .htaccess files etc'). The only option (that I know and can think of) is changing your php.ini file.Orio. Link to comment https://forums.phpfreaks.com/topic/34236-safe-mode-question-script-timeouts/#findComment-161141 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.