Beginning Administration 4 FAQ

Jump to: navigation, search

Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Beginning Administration 4 FAQ.

This page has grown as an overflow of the other pages concerning Beginning Administration.

These questions relate specifically to Moodle v1.9.x and some earlier versions. Many of the responses here may also work on Moodle v2.x, but not all, so be careful if you want to apply them to Moodle 2.x.


I have Ubuntu 8.04 server set up as LAMP server and used apt-get to install Moodle. MySQL is on another server, but Moodle won't work.

apt-get is an Advanced Packaging Tool that automates the installation process for many Linux distros. While it is an excellent tool under many circumstances, it is not perfect, so it may very well be the problem when setting up a Moodle where parts of it are located on different servers. Manual installations can be a bit more time consuming, but have a much greater chance of success. Having said that, check the config.php file and make sure that each path is pointing to the correct place e.g.

  $CFG->wwwroot = 'http://yourwebsiteURL';
  $CFG->dirroot = '/home/yourAccountName/public_html';
  $CFG->dataroot = '/http://yourMySQLServeraddress/path/moodledata';

I upgraded Ubuntu from 8.10 to 9.04 and have lost my Moodle - where did it go?

In this situation, usually, you will get the Apache "It works" message but when you try to access the Moodle, it will come back with an error message telling you it cannot locate the Moodle. You can try to locate the Moodle yourself, and update the various files, like config.php:

 $CFG->dbtype = 'mysql';
 $CFG->dbhost = 'localhost';
 $CFG->dbname = 'moodle';
 $CFG->dbuser = 'moodleuser';
 $CFG->dbpass = 'xxxx';
 $CFG->prefix = 'mdl_';
 $CFG->dbpersist = "false";
 $CFG->wwwroot = '';
 $CFG->dirroot = '/var/www/moodle';
 $CFG->dataroot = '/var/moodledata';
 $CFG->directorypermissions = 00777;
 $CFG->admin = 'admin';

Reedit and change wwwroot to to what your IP address is, even if it has not changed, re-enter the path.

Check the actual location and make sure the dirroot and dataroot are also correct. Try it and if it works, then you have successfully re-configured the Moodle, but do not count on it. This method seems pretty hit and miss.

It may be faster and safer to just reinstall the Moodle, so make sure you have a backup prepared to go if needed.

How do I give my users a dummy email when I'm using LDAP?

When using Active Directory you can map the email address field to "userPrincipalName". This will populate your users email address with their AD username@yourdomain email.

I want to install MediaWiki onto my Moodle Server, can I do this?

Easily. Find where the server document root is and install it there. Let the MediaWiki install take care of the database issue, you need not worry about it.

That is good, but I would prefer to segment the server, using virtual hosts.

For Apache it is a fairly simple process. Using your UTF-8 compatible editing program, open the Apache httpd.config file.

  • Uncomment the line #Include conf/extra/httpd-vhosts.conf by removing the hash symbol. Save and close.

Then, using the text editor, go to conf/extra/ and open the httpd-vhosts.conf file. Enter this information:

    DocumentRoot "C:\My\Moodle\path\moodle"
    ServerName moodle
    DocumentRoot "C:\My\Moodle\path\mediawiki"
    ServerName mwiki

Do not put spaces into the Servername.

For Windows users, go to system32\drivers\etc\ and open the hosts file. There is no extension for this file, just hosts. Add in the lines:       localhost     # source server	  mediawiki     # x client host       moodle        # y client host

The first should already be there, but you never know.

For IIS users, it is a little different, but too detailed to go into here. Look at this tutorial at BloggingDeveloper.

I have installed different versions of Moodle onto one server but I get a "Session timed out" error message.

Using Moodle 1.8.x, 1.9.x and now Moodle 2.0 on one server is easily done. The session timed out message is related to Server/Moodle issues, and can be overcome via the use of cookies. Go to: Administration ► Server ► Session Handling and in the Cookie Prefix add a value (say 18, 19 and 20 to your version cookies). Save the page and it should be good to go. If you have more than one Moodle using the same version, then it might be 19, 191, 192, 193 etc or any value, A, B, C, D..AA, AB, as long as each version has a different value.

Thanks to Jon Witts for this solution.

I am having an issue with emailing from my Moodle. They are being sent but not received. Why is that?

This can happen for any number of reasons, and none of them are good. There has been a number of discussions around this topic and here is one of them.

I want to look at the styles applied by my selected theme, but how?

Difficult with Internet Exlorer before version 8, but it has gotten better. Much easier in all versions of Firefox. Using Firefox, download the "Firebug" add-on and install it. When installed, right click what you want to look at in detail, select Inspect Element, it will appear in the Firebug viewing window. For IE8, go to Tools > Developer Tools and this will display the whole window. Click on the crosses, like in Windows Explorer folders view, and navigate to the element you want to view. Of course, if you cannot identify the element you want to view, IE8 cannot help you.

I have these cool icons I want to use rather than those supplied. How can I change them?

Do it very carefully. It is a good idea to create a custom theme by copying the theme you like, then changing the icons in it. Remember, if one theme has the icons you want to use in another theme, copy them. CAUTION: Make sure you know the correct icon to change and have the right size and correct image. 150 x 150 pixel images do not make good icons.

It is a good idea to understand themes. With CSS some themes have no special icons defined in their folders. They will or can default to the moodle/pix folder for icons it can not find in the theme.

For example: I use the CoolestMoodle theme based on my copy of the Chameleon theme. I want to use a standard black "delete" icon, with a yellow background. I know a black delete icon is located in the pix/t folder as delete.gif. I copy that image and with an image editor put yellow around the X. I place my new image in the theme/CoolestMoodle/t folder as "delete.gif".

The quick way is to change the image in the pix/t folder or the image in the Chameleon theme. The problem is that when you upgrade your site, it will copy over those files. It will not copy over a custom theme folder and its files.

I want to use my own logo but do not know how to change it

There are a couple of options here, but if you look at the Front Page FAQ that will provide you with some answers.

Our front page is plain, how can we change this to something that looks better?

This is considerably more simple than you may have expected, once you know how. If you go to the Front Page FAQ, this will explain it a lot better.

I just upgraded my Xserve from Leopard 10.5.8 to Snow Leopard 10.6.3 and broke our school's Moodle Site.

It appears that Apple have changed their versions of both PHP and mySQL.

To fix the problem I reverted back to the original Apple version of PHP as this now has GD support built in... no need for Entropy.

But of bigger concern was that mySQL would not stop or allow me to restart.

To remedy this I used the following steps:

 First logged in as a Root user onto my server.
 Disable the mySQL service using Server Admin
 Then enabled the viewing of all the hidden folders on the Server hard drive. To do this use enter the following command using the Terminal -
 defaults write AppleShowAllFiles YES
 Enter the Server's hard drive and navigate to /var, it will appear as shortcut. Double click, find the mySQL folder and remove it i.e. drag to the desktop
 Now go to Server Admin again and re enable and restart the mySQL service, this will recreate a new mySQL folder in /var.
 Now hopefully you have a backup of your system prior to completing the upgrade, I had used 'Time Machine". 
 Enter your time machine physical drive don't use  the Time Machine app. Then navigate to /var/mySQL and open the folder. 
 Copy any Moodle related files/folders back to your current /var folder.
 Now check your Moodle Website using your browser of choice and all should function again.

Thanks to Ross Oates for this question and solution.


I want to change the look of my course pages, but how?

There are a three ways you can do this. You can stack your columns to the right by adding this

 $THEME->layouttable = array('left', 'right', 'middle');

in config.php your current used theme folder.

You can completely hide left column by adding this css code at the end your styles.css in your current theme folder

 td#left-column {
   display: none;

As a third alternative you can stack your left column on top of your right column by jQuery in header.html in your current theme folder

 <script src=""></script>
  <script type="text/javascript">
    $(document).ready(function() {

Thanks to John St and Navin Dutta for this answer.

Can I issue fake email addresses for Users who have no email when I upload the User file?

Yes. A generic fake email like is acceptable in Moodle. The address must look like an email address format. Further information on alternatives can be found at the No Email page. (And a quiet aside "How about gmail or yahoo mail or even hotmail", is anyone without an email today?)

We are getting the message: ERROR: Could not instantiate mail function.

If you are using a Linux distro, then ensure that your SMTP server is working as it should. If you are using Windows then you have to install an SMTP server. This server can be any valid Windows mail server. Mercury mail is one such. If you need to then you can go to your email program and look at its preferences and see where it is pointing to use this same mail server.

The email server is working, but the emails are not getting where they should be going

Usually your firewall is preventing emails getting out. Check to make sure the firewall has an exception rule set. If it does, then check your virus software, McAfee's has a small firewall that can prevent emails being sent.

The Staff at my School want to see what other Staff Members are doing. Can I set this up easily?

Yes, you can. In many instances a lot of Staff Members will want to look at what their colleagues are doing and make sure they are working within whatever academic parameters need to be met. While this may seem intrusive for a lot of teachers, it is one way of getting a cross-fertilization of ideas across different curricular areas.

However, as the number of courses grow, this can mean that the teachers "My courses" block can grow to a ridiculous length. To get around this issue, set up a special user that is enrolled in all courses. If all Staff know the User ID they can access other courses easily. To limit this though, you may consider using a different special users for each subject area or discipline or category. Make that ID available only to those people delivering courses in that subject, discipline, or category. You might also create a special role for that user to limit their activities.

I am getting an error message about using the UTF-8 code in my database. What does it mean?

Essentially, someone has set up your database with a character set, charset, other than UTF-8. To fix this problem is simple in MySQL, but you are going to have to investigate further for PostGres or Oracle - and MSSQL is, I understand, different again. To make the change open the Moodle database either from the command line, or using phpMyAdmin. Enter the command:

 ALTER DATABASE 'your_dbase_name' DEFAULT CHARACTER SET utf-8_unicode_ci;
NOTE: Later versions of MySQL seem not to respond to this command, so you may need to do it one table at a time. The SQL code for this is:
   ALTER TABLE 'your_table_name' DEFAULT CHARACTER SET utf-8_unicode_ci;

I am not sure what would happen if you replaced the table name with a wild card, *, but it may be worth a try. While this may change the default character set, but it does not necessarily change the Collation to a UTF-8. Try this video, but please, be patient with the video, it is not a great video to watch, but it is helpful.

If you have the issue being caused by Fantastico in cPanel, you may want to try this:

  1. From cPanel click on phpMyAdmin
  2. On the left hand panel, click on your Moodle database, whatever you named it.
  3. On the right hand panel click the "Operations" tab, the last tab at the top of the page. At the bottom of that next page, you will see Collation and in the dropdown menu, click on utf8_unicode_ci. Click "Go" and that should change your Collation.

Thanks to William Ratto for this outline.

I changed themes and now just get a blank screen. What happened?

Chances are the theme is no longer supported in Moodle. For example, many themes suitable for v1.7.x and earlier may not work in v1.8.x or later, or themes from anything earlier than v2.0 will not work at all. Try deleting the theme folder so that Moodle will not find it, it SHOULD then look for the Standard theme and run. If that does not work, then add the line: $CFG->theme = 'standard' to the config.php file. As a last resort, you may have to edit the database, using phpMyAdmin. Go to table mdl_config and change the field "theme" to 'standard'.

When Moodle starts, you should be able to change the theme using the Appearance > Themes > Theme Selector. If you use the config.php file to do this, do not forget to erase the variable line after you have restarted and before you select your new theme.

When I click on Notifications in the Site Admin block, it times out resulting in a blank page..

First things first, turn on debugging messages. Go to Administration ► Server ► Debugging to turn on messages, and check error messages.

There are a number of errors that might cause this problem, (I will add them below as I find them), but this may perhaps be one of the more common.

 Warning: feof() expects parameter 1 to be resource, boolean given in D:\Moodle\lib\adminlib.php on line 3141 Warning: fread() expects parameter 1 to be 
 resource, boolean given in D:\Moodle\lib\adminlib.php on line 3142

This line refers to the Aspell spell checking program, To fix this, go to Administration ► Server ► System Path and remove anything that you may find in the Path to Aspell dialog variable.

  • Thanks to Chris Swaffield, Petr Kalis, Steve Henshaw and Mauno.

See also