Overriding PHP Settings

There are a few ways to override global PHP (php.ini) settings with local settings. For example you can use a .htaccess file or local php.ini file depending on what options exist for your site hosting. If your site uses php-fpm you use a .user.ini file instead.

Another way to do it, is to override the settings in config.php. This has the benefit of being part of the standard moodle code configuration setup. All you need to do is use the ini_set() function.

For example, to increase the max_execution_time from 30s to 60s you can do this in config.php:

ini_set('max_execution_time', 60);

The best place for a change like this is towards the end of the config.php, with a starting comment indicating it is custom configuration.

Check that your configuration is in place by navigating to:

Site administration > Server > PHP info
No Comments
Back to top