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.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

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

First Time run Dev/build?flush= 1 [Warning] set_time_limit()


Reply


4 Posts   5232 Views

Avatar
go2planC

Community Member, 19 Posts

28 October 2009 at 3:07pm

Hi I've had this problem before and i never have worked out what the problem is, I know it's fixable as I have got several site running silverstripe on the same server.

What happens after I install silverstripe, even if i don't add any of my own custom code i get the following error:

[Warning] set_time_limit() has been disabled for security reasons
GET /dev/build

Line 87 in /home/fhlinux130/t/thisisbubble.co.uk/user/htdocs/sapphire/core/model/DatabaseAdmin.php
Source

78    }
79
80
81    /**
82     * Updates the database schema, creating tables & fields as necessary.
83     */
84    function build() {
85       // The default time limit of 30 seconds is normally not enough
86       if(ini_get("safe_mode") != "1") {
87          set_time_limit(600);
88       }
89
90       // Get all our classes
91       ManifestBuilder::create_manifest_file();
92       require(MANIFEST_FILE);
93       

any ideas>

Thanks in advance!

Avatar
OwenW

Community Member, 45 Posts

1 February 2010 at 4:11pm

HI go2planc,

you problem here is that the set_time_limit function is disabled within php.ini for some reason.

If you are running on a hosted server that you don't control, you can talk to your hosting provider and ask them if they will enable set_time_limit.

If you are hosting the server yourself, then look in the php.ini file for a line like this;

disable_functions = set_time_limit

and remove the set_time_limit from the list and run again.

Other than that you would be able to make changes to DatabaseAdmin.php and remove the set_time_limit call, but there are several other references to the function in other places in silverstripe.

Out of interest, what version of Silverstripe are you trying to install?

Cheers
Owen

Avatar
go2planC

Community Member, 19 Posts

2 February 2010 at 7:35am

Hi Owen,

Thanks for the reply. I run into the same problem on every version of Silverstripe that I have installed including the latest release. Unfortunatly I have asked my hosting provider if they would be willing to alter settings within the php.ini file before and their response was 'no'.

However the solution I found all-be-it a bit strange is to run the install script and leave the site for about 5 minutes (just enough time to make a cup of tea) then return and run dev/build again and it works fine. I haven't run into the problem else where either - it is just after the initial install.

Thank you once again for you help.

Cheers
Rob

Avatar
Matty Balaam

Community Member, 69 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.