Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

[SOLVED] [Warning] set_time_limit() [function.set-time-limit]: Cannot set time limit due to system policy

Go to End

6 Posts   12872 Views


Community Member, 5 Posts

1 February 2010 at 11:50am

Edited: 02/02/2010 12:13pm

My settings is
php 5.2.12
silverstripe 2.3.5
Apache server
Linux srv38 2.6.18-6-vserver-amd64

I get this warning/error :
when I do dev/build
when I try to view an uploaded image in "files view"
[Warning] set_time_limit() [function.set-time-limit]: Cannot set time limit due to system policy


318 * @param $timeLimit The time limit in seconds. If omitted, no time limit will be set.
319 */
320 function increase_time_limit_to($timeLimit = null) {
321 if(!ini_get('safe_mode')) {
322 if(!$timeLimit) {
323 set_time_limit(0);
324 } else {
325 $currTimeLimit = ini_get('max_execution_time');
326 if($currTimeLimit && $currTimeLimit < $timeLimit) {
327 set_time_limit($timeLimit);
328 }
329 }
330 }
332 }

Anyone got an idea what happens - made a local install on my machine which do not act like this - so I guess it a server setting - but I do not know where too look.

Thanks in advance


Community Member, 45 Posts

1 February 2010 at 4:45pm

Hi hwi,

Have a quick look at this post;

The issue that he is seeing is the same.

Basically, the set_time_limit function is disabled in php.ini.

Hope that helps.



Community Member, 5 Posts

2 February 2010 at 1:06am

Edited: 02/02/2010 12:15pm

Hi Owen

Thanks for your headsup on this issue. I will try my hosting company and see if they can set the settings for me.

Thanks again now I know what to ask for.

EDIT UPDATE :::::::::::::::::::::::::

Thanks Owen it ended up that the host did not support set_time on their server. So I guess its time for a new hosting company.

Thanks for your time


Community Member, 1 Post

25 March 2010 at 10:38am

is there no other way around this problem with set_time_limit than to change hosting company?
My hosting company is'nt keen on any changes in the php.ini file, so i guess it's a pretty common case.
It seems a bit narrow-minded of silverstripe not to offer a way around it.

I'm totaly new on silverstripe and just testing it out for fun, so i guess the big question from me is as following:
Is this warning message any thing to take notis of in the bigger picture?

//John, the optimist


Community Member, 1 Post

11 June 2010 at 8:51am

Edited: 11/06/2010 8:52am

I have the same problem, can anybody advice me on how to solve this issue. My Host can not change that for me, I run this ini_get('max_execution_time') only 30second is set. I see the silverstripe function try to increase to 600second in the function. Any idea?

Matty Balaam

Community Member, 74 Posts

23 June 2010 at 1:04am

I've managed to get around this problem on Fasthosts and Silverstripe 2.4 by amending the bottom of sapphire/core/core.php to

 * Increase the time limit of this script.  By default, the time will
be unlimited.
 * @param $timeLimit The time limit in seconds.  If omitted, no time
limit will be set.
function increase_time_limit_to($timeLimit = null) {
       if(!ini_get('safe_mode')) {
               if(!$timeLimit) {
               } else {
                       $currTimeLimit = ini_get('max_execution_time');
                       if($currTimeLimit && $currTimeLimit < $timeLimit) {


Your mileage may vary.