Configuration reference – an overview
config.php configuration file contains several settings and variables that heavily influence how Moodle operates. It is located in the main directory of your Moodle system (
$CFG->dirroot) and can be edited with any text editor.
Be careful when modifying
config.php! Moodle depends heavily on its content, and any faults can cause the software to malfunction.
You should create a backup of the config file before modifying it, so you can roll back to it in case of problems. Also, ensure the file permissions are correctly set, as the file contains the plain-text database username and password. In a Linux environment, the owner should be
root, the group also
root, and the permissions set to
644. A sample configuration file is shown in the following screenshot:
Figure A.1 – Sample config.php file
config.php values we are interested in are the ones that start with a dollar symbol...