Maximum execution time of 120 seconds exceeded in ...\lib\dml\mysqli_native_moodle_database.php

Re: Maximum execution time of 120 seconds exceeded in ...\lib\dml\mysqli_native_moodle_database.php

by Lucía Martyn -
Number of replies: 1

The error message you are receiving suggests that the script is taking longer than the maximum allowed time to execute. In this case, it is likely related to a database query that is taking too long to complete.

To resolve this issue, you can try increasing the maximum execution time in your PHP configuration. You can do this by modifying the "max_execution_time" value in your php.ini file, or by adding the following line to your .htaccess file:

php_value max_execution_time 300

This will increase the maximum execution time to 300 seconds (or 5 minutes), which should be enough time for most scripts to complete.

Another solution is to optimize your database queries. You can use the Moodle built-in database debug tool to identify the slow queries and then optimize them by adding indexes, using proper SQL syntax, or optimizing the database schema.

If the issue persists, you may want to contact your Moodle administrator or hosting provider for further assistance.

Average of ratings: Useful (1)
In reply to Lucía Martyn

Trả lời: Re: Maximum execution time of 120 seconds exceeded in ...\lib\dml\mysqli_native_moodle_database.php

by daniel keagan -
Do you have a larger max_execution_time setting in your php.ini file? While I stick with 300, you could go as high as 1200 if you really wanted to.