Fatal error: Maximum execution time of 30 seconds exceeded

Fatal error: Maximum execution time of 30 seconds exceeded

by Paolo Oprandi -
Number of replies: 15
Upon installing Moodle 1.94 and chnaging my debug settings I get:

Fatal error: Maximum execution time of 30 seconds exceeded in /lib/moodlelib.php on line 5394

This is in the function get_string

Any help much appreciated.

I have even tried downloading a new version, but it is still the same! Should I file bug report?

Paolo
Average of ratings: -
In reply to Paolo Oprandi

Re: Fatal error: Maximum execution time of 30 seconds exceeded

by Andrea Bicciolo -
Paolo, it is not a bug but a limit on your php.ini. Basically, any php script running for more than 30 seconds is killed.

You may want to raise it editing max_execution_time on your php.ini file.
In reply to Andrea Bicciolo

Re: Fatal error: Maximum execution time of 30 seconds exceeded

by Paolo Oprandi -
Yes, I understand this - but I am only changing a field variable aren't I?

Presumably it is taking so long because it is looking for something in the get_string which it isn't finding.

Paolo
In reply to Paolo Oprandi

Re: Fatal error: Maximum execution time of 30 seconds exceeded

by Richard Enison -
PO,

I very strongly doubt that. Because get_string is a simple little function that doesn't do a whole lot of searching. It is used a lot in all parts of Moodle. It's purpose is quite simply: to retrieve the correct string from the language pack the user has selected. Whenever Moodle needs to get a string of text in the language of choice, whether it's an error msg, a button label, etc., it calls get_string (or print_string) and it supplies the name of the file it should be in (default file name is moodle). The file extension is always assumed to be .php. Sometimes, a small number of alternate file names are also passed to get_string.

The function then looks for the string in that file in the current language pack. If it's there it finds it right away; if it's not there, it immediately knows that, and tries the alternate files, if any. If it's not there, it goes to the language pack for the parent language, if any. Finally, if it still hasn't found the right string, it tries the English language pack, if it isn't already there. If it's not there, it aborts.

It's much more likely that get-string is part of a loop that is getting run over and over until it times out.

RLE
Average of ratings: Useful (1)
In reply to Richard Enison

Re: Fatal error: Maximum execution time of 30 seconds exceeded

by Paolo Oprandi -
thanks for that clarification, RLE.
nevertheless, something odd is going on with a clean install. if i get a chance i'll try and dig into the problem.
In reply to Paolo Oprandi

Re: Fatal error: Maximum execution time of 30 seconds exceeded

by Anjali Mahey -

Hi

I am also facing the same problem, I have also changed the max_execution_time to 300 seconds in php.ini, but my moodle still consider only 60 seconds to upload a file. If uploading process take more time it agains throws same error "fatal error: Maximum execution time of 60 seconds exceeded".

Thanks in advance.

In reply to Anjali Mahey

Re: Fatal error: Maximum execution time of 30 seconds exceeded

by Mert gokkaya -
I have the same problem on the last build fresh install. I am guessing it is not due to php.ini. Changing that simply changes the 30 sec parameter. Could it be about the querries?
Log is about the last querry log before the error.

build:
Moodle 2.0 dev (Build: 20090513)

Error:
Fatal error: Maximum execution time of 30 seconds exceeded in C:\Inetpub\lib\dml\mysqli_native_moodle_database.php on line 418

Fatal error: Maximum execution time of 30 seconds exceeded in C:\Inetpub\lib\moodlelib.php on line 7806

Mysql Query log:

236 Query CREATE INDEX mdl_roleassi_rol_ix ON mdl_role_assignments (roleid)
236 Query CREATE INDEX mdl_roleassi_con_ix ON mdl_role_assignments (contextid)
236 Query CREATE INDEX mdl_roleassi_use_ix ON mdl_role_assignments (userid)
236 Query CREATE TABLE mdl_role_capabilities (
id BIGINT(10) unsigned NOT NULL auto_increment,
contextid BIGINT(10) unsigned NOT NULL DEFAULT 0,
roleid BIGINT(10) unsigned NOT NULL DEFAULT 0,
capability VARCHAR(255) NOT NULL DEFAULT '',
permission BIGINT(10) NOT NULL DEFAULT 0,
timemodified BIGINT(10) unsigned NOT NULL DEFAULT 0,
modifierid BIGINT(10) unsigned NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
)
236 Query ALTER TABLE mdl_role_capabilities COMMENT='permission has to be signed, overriding a capability for a p'
236 Query CREATE UNIQUE INDEX mdl_rolecapa_rolconcap_uix ON mdl_role_capabilities (roleid, contextid, capability)
236 Query CREATE INDEX mdl_rolecapa_rol_ix ON mdl_role_capabilities (roleid)

In reply to Mert gokkaya

Re: Fatal error: Maximum execution time of 30 seconds exceeded

by Mert gokkaya -
after changing php.ini 30 sec limit to 60 seconds

error is;
Fatal error: Maximum execution time of 60 seconds exceeded in \lib\dml\mysqli_native_moodle_database.php on line 418

Fatal error: Maximum execution time of 60 seconds exceeded in \lib\moodlelib.php on line 7806

and query log ends here;

246 Query CREATE INDEX mdl_file_use_ix ON mdl_files (userid)
246 Query CREATE TABLE mdl_files_cleanup (
id BIGINT(10) unsigned NOT NULL auto_increment,
contenthash VARCHAR(40) NOT NULL DEFAULT '',
CONSTRAINT PRIMARY KEY (id)
)
246 Query ALTER TABLE mdl_files_cleanup COMMENT='File pool cleanup candidates'
246 Query CREATE UNIQUE INDEX mdl_fileclea_con_uix ON mdl_files_cleanup (contenthash)
246 Query CREATE TABLE mdl_repository (
id BIGINT(10) unsigned NOT NULL auto_increment,
type VARCHAR(255) NOT NULL DEFAULT '',
visible TINYINT(1) unsigned DEFAULT 1,
sortorder BIGINT(10) unsigned NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
)
246 Query ALTER TABLE mdl_repository COMMENT='This table contains one entry for every configured external '
246 Query CREATE TABLE mdl_repository_instances (
id BIGINT(10) unsigned NOT NULL auto_increment,
name VARCHAR(255) NOT NULL DEFAULT '',
typeid BIGINT(10) unsigned NOT NULL,
userid BIGINT(10) unsigned NOT NULL DEFAULT 0,
contextid BIGINT(10) unsigned NOT NULL,
username VARCHAR(255),
password VARCHAR(255),
timecreated BIGINT(10) unsigned,
timemodified BIGINT(10) unsigned,
readonly TINYINT(1) unsigned NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
)
246 Query ALTER TABLE mdl_repository_instances COMMENT='This table contains one entry for every configured external '
246 Query CREATE TABLE mdl_repository_instance_config (
id BIGINT(10) unsigned NOT NULL auto_increment,
instanceid BIGINT(10) unsigned NOT NULL,
name VARCHAR(255) NOT NULL DEFAULT '',

In reply to Mert gokkaya

Re: Fatal error: Maximum execution time of 30 seconds exceeded

by Mert gokkaya -
It worked on 160 secs smile max_execution_time = 160 on php.ini

it took 4 minutes on a decent win 2003 server. Will try an ubuntu or solaris see what happens. I never had to change this entry on php.ini before. Did we have major database structure change or this is an isolated problem?
In reply to Paolo Oprandi

回复: Fatal error: Maximum execution time of 30 seconds exceeded

by 小 魏 -

I met the same problem when I tried to install Moodle 2.2 on my windows server 2003 pack 2. But it was quite by chance when I tried again to install the Moodle on the old windows server 2003 pack 1, it worked fine. Perhaps it was because of the Pack 2 system.

In reply to Paolo Oprandi

回复: Fatal error: Maximum execution time of 30 seconds exceeded

by 以维 钟 -

Use the default language "English" will have no porblem.

Average of ratings: Useful (1)
In reply to Paolo Oprandi

Re: Fatal error: Maximum execution time of 30 seconds exceeded

by chris mwinzi -

kindly assist. i am trying to install moodle 2.4.3 from my browser and it gives the following error: Fatal error: Maximum execution time of 30 seconds exceeded in C:\Moodle\MoodleWindowsInstaller-latest\server\moodle\mod\data\db\subplugins.php on line 3    even after changing the maximum execution time to 500 secs on php.ini

In reply to chris mwinzi

Re: Fatal error: Maximum execution time of 30 seconds exceeded

by Michael E -
Picture of Core developers Picture of Testers

Chris,

Did you restart your webserver after you changed the configuration?
If no, please do so. This will load the new setting.

In reply to chris mwinzi

Re: Fatal error: Maximum execution time of 30 seconds exceeded

by Luis de Vasconcelos -
In reply to Luis de Vasconcelos

Re: Fatal error: Maximum execution time of 30 seconds exceeded

by derek reddy -

I am also having this proble and I can't find php.ini file, even on a system search

any ideas where it could be?

 

In reply to derek reddy

Re: Fatal error: Maximum execution time of 30 seconds exceeded

by nuurol F. -

if u using xampp, u can find the php.ini in php folder. 

Attachment php.JPG