Time for action - creating the config.php file
1. In the
htdocs
folder of your Mahara site you will find a file calledconfig-dist.php
. Use thenano
command in your terminal to start editingconfig-dist.php
file.
nano config-dist.php
Note
Other Linux people use much more sophisticated text editors like Vim (http://www.vim.org/) and Emacs (http://www.gnu.org/software/emacs/). We are simple folk and are perfectly happy with nano: http://www.nano-editor.org/.
2. You will now see the file open on the command line. Use the arrow keys on your keyboard to scroll up and down the page until you get to a section called database connection details. In the following example the user is using
mysql5
, rather than PostgreSQL. Fill in the information so that it matches the details you used to set up your own database:
3. Next, continue scrolling down the file until you reach a line that starts with
$cfg->dataroot
. Here, you must fill in the full path from the server root directory to the data directory we created earlier in this chapter.
4. Congratulations, you've now finished editing the configuration file. Save it by clicking Ctrl + C on your keyboard. When asked if you would like to rename the file, type Y for yes and name the file
config.php
.
What Just Happened?
What we just did was very important, we let Mahara know where the database is and the password needed to access it. We also let it know the location of the dataroot
directory.