21491 Posts in 5783 Topics by 2621 members
General Questions
SilverStripe Forums » General Questions » [SOLVED] [Warning] set_time_limit() [function.set-time-limit]: Cannot set time limit due to system policy
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 5942 Views |
-
[SOLVED] [Warning] set_time_limit() [function.set-time-limit]: Cannot set time limit due to system policy

1 February 2010 at 11:50am Last edited: 2 February 2010 12:13pm
Hi
My settings is
php 5.2.12
silverstripe 2.3.5
Apache server
Linux srv38 2.6.18-6-vserver-amd64
MysqlI 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 policySource
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 }
331
332 }
333Anyone 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
-
Re: [SOLVED] [Warning] set_time_limit() [function.set-time-limit]: Cannot set time limit due to system policy

1 February 2010 at 4:45pm
Hi hwi,
Have a quick look at this post;
http://silverstripe.org/installing-silverstripe/show/271972?start=0#post278079
The issue that he is seeing is the same.
Basically, the set_time_limit function is disabled in php.ini.
Hope that helps.
Cheers
Owen -
Re: [SOLVED] [Warning] set_time_limit() [function.set-time-limit]: Cannot set time limit due to system policy

2 February 2010 at 1:06am Last edited: 2 February 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.
CheersEDIT 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
Cheers -
Re: [SOLVED] [Warning] set_time_limit() [function.set-time-limit]: Cannot set time limit due to system policy

25 March 2010 at 10:38am
Hi,
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
-
Re: [SOLVED] [Warning] set_time_limit() [function.set-time-limit]: Cannot set time limit due to system policy

11 June 2010 at 8:51am Last edited: 11 June 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?
-
Re: [SOLVED] [Warning] set_time_limit() [function.set-time-limit]: Cannot set time limit due to system policy

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.
| 5942 Views | ||
|
Page:
1
|
Go to Top |


