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

Beginning Administration 3 FAQ

From MoodleDocs

This Begining Administration 3 Page was create to ease some of the problems associate with large FAQs and the first two pages. This is further specialized responses to specific question. In this page, many of the Windows questions are aired independently.

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 am getting a log error message "File does not exist: /var/www/html/favicon.ico" and users cannot get past the login page.

This appears to only happening with IEx. There seems to be a flaw somewhere in IE but so far no-one has been able to pinpoint it. There are any number of guesses, an some speculation, but it is frustrating. The one recommended solution seems to be to move away from IE, use anything else.

I have lost all my courses in one category and I am getting the error message "Table './moodle/mdl_course' is marked as crashed and should be repaired"

Occasionally, Windows and MySQL seem to not want to do the right thing, and a table can become corrupted. The best way out is to use the phpMyAdmin interface and work directly with the table itself. Go to Administration > Server > Database and in the left hand column, select the mdl_course table.

From the tabbed workspace, in the main panel, select the SQL tab and replace the default "SELECT ... " statement with

 REPAIR TABLE mdl_course

Then click the "Go" button on the right. This solution can be applied to any table in the database.

Sometimes, you will be unable to log in, but instead get the error message:

 "Session Replace: Table './moodle/mdl_sessions2' is marked as crashed and should be repaired"

While annoying, it is not unrecoverable. If you look at this document, How to check your database for corruption, it explains how you can repair your database from the command line.

Why not use Windows Notepad?

Windows Notepad is not necessarily helpful here, it can add in some additional characters or leave out some other characters and that do not sit well inside some versions of Moodle. Windows' Notepad does not save files using the UTF-8 charset, which is required for Moodle. Well, Moodle saves files in the database as a UTF-8 format, Moodle PHP files are written, then saved in the UTF-8 format, so it is easier to setup and use a text editor that can do the same. The UTF-8 format uses a larger range of characters than the ASCII charset that Notepad does.

I am running Windows 2008 Server and IIS, which download packs should I use?

There are a couple of installation packs you can download. Generally when Windows users are downloading for the first time we go directly to the Moodle packages for Windows page. This is a very handy installation package that uses the Xampp installer to set up Apache, MySQL and PHP with a minimum of fuss. This package is the best for the Windows OS on a home Moodle or a dedicated PC. It is easy to set up and to maintain. However, be aware that this edition of the Xampp installer was not really designed for a production site, so it may introduce some security issues. (If you are intending more than about 50 users to access this Moodle then you definitely should consider the next option.)

If you are using your Server as the location for your Moodle, the Xampp installer may not be helpful. You would be much better off using the Standard Moodle Packages. While this is more work setting up, there are fewer opportunities for things to cancel each other out or cause errors in your network or in Moodle.

Installing anything, and Moodle is no exception, needs careful planning and clear strategies in place to achieve the desired outcomes. One suggestion is that Moodle should be installed on a dedicated machine, then as it becomes more popular, more heavily trafficked, another machine can be added. The Moodle can be mirrored and the load sharing properties of the NOS can be implemented. This strategy allows the system to grow at demand, organically, if you like while not compromising at any stage the security of the network itself. An alternative could be clustering machines, this is a considerably more cost effective solution to redundancy issues and just as effective as mirroring. The next question then is should it be Linux or Windows?

We are using Microsoft IIS, do we need Apache?

No. Moodle has been primarily developed in a LAMP environment, Linux, Apache, MySQL, PHP, but it will run in other environments. A WAMP (Win etc) environment will run PHP, so Moodle will run fine. The reason PHP was chosen was because it is a powerful cross-platform language. MySQL is a database package that uses SQL which is also a powerful cross-platform language. Moodle was written to be as generic as possible, so it would be able to run in any environment. It makes extensive use of both PHP and SQL, therefore as long as the Server can utilize PHP and the database can recognize SQL, you can use any combination you like. The only limitation is the database interface level. Moodle only works in MySQL, PostGres, Oracle and MSSQL. It seems each DBMS uses its own variations on SQL so the layer between the database and Moodle needs be specifically configured for its environment. There are many excellent DBMS packages, but it is not possible to cater for them all and these were considered to be the four most likely, or most popular, DBMS packages.

I am getting a blank screen after installing to Windows Vista - What can I do next?

Installing Moodle on Windows Vista computer can create a number of problems. It seems that Microsoft has been so intent on improving security that it is refusing to allow other programs to operate as a server. There is an Installing Moodle on Windows Vista installation page that can help you resolve most issues in Vista.

How can I install on a Windows Vista or Windows 7 computer

While Microsoft has improved security on its Windows products, it seems, sometimes in a bizarre way, that security is now so strong it is hard to install anything onto your new Windows computers. If you look at this Moodle Doc, you will find links to some tutorials that may, or may not, help.

My site renders fine in Firefox and Opera, but not IE7

Each browser looks at the webworld differently. Each person or organization will have a preference for their web browser. Unfortunately, there can be issues with different releases of some versions of MS Internet Explorer. For example, at times some of the style elements in Moodle are not rendered properly in IE7 or 8 so text can appear incredibly small, or a box is sized incorrectly, distorting the page. It has also been suggested the Java implementation in IE8 is not fully compliant and it may not render some LMS and SCORM packages properly. These problems are not unique to Moodle but other web browsers seem to be rendering styles more accurately.

There is a discussion Forum for users of Microsoft servers and IIS. Many of the technical discussions are between developers, but there is some good information there for site administrators.

My default e-mail programme is Outlook Express. Do I need to configure it in some way to get e-mails from Moodle?

No, an email from Moodle is like any other email. Perhaps more importantly is the email server on your site. PHP will send out the mail using its built-in mail server but some sites will need a specific Simple Mail Transfer Protocol (SMTP) server to relay the mail. Moodle has settings to do this.

If you want a different mail program on your local computer, then there are many different ones to choose, such as Thunderbird.

Am using IE7, but every time users go to click on a lesson grid or a piece of work within any course IE crashes and throws them out.

Look at what is causing the browser the break, possibly the css, far too complex for IE to handle, or perhaps it is just the server settings are giving IE some grief. You may want to check the server logs, or ask your provider if you cannot access them yourself. Turn on error messages in Moodle, see if you can find something there. Go to

   * Administration ► Server ► Debugging

Set the drop down list to DEVELOPER, and that will show any and all messages. Do not leave it on too long though, once you have some ideas on causes, if they are detectable in Moodle, turn it off. If you find nothing, turn it off, error messages can provide some smart hacker a door into your Moodle, so do not leave them on too long.

What is happening here, all I am getting is a repeating blank page that is trying to open a cache file?

The problem appears something like this in the browser:

An error in the browser

The error is usually associated with the cache. For some reason, Moodle is trying to open a file in the cache and all it is doing is repeatedly opening a file that actually no longer exists. To remedy this problem, clear the cache. You can use the browser to do this. Moodle will run properly again.

I have HTML code in many of my courses, and I do not know how to get rid of it when I cannot see it in edit mode.

Well, this is usually the copying of a Microsoft Word document that has caused this. Word has a persistent coding presence when transferring resources and activities from Word documents to Moodle web pages. There is no way to get rid of this unless you either manually get into the page and delete it using the Text mode of the HTML editor. The other way is easier, and that is the editing tool bar has a button with a Word icon on it. When pasting from Word, just click the button, that should fix the issue.

I am getting a "An application has made an attempt to load the C runtime library incorrectly" error when installing.

Using a Win Server 2003 R2 64 Bit with MySQL and IIS that keeps stopping when Moodle install tries to create the tables in the database. There are then PHP Access errors which means IIS has to be restarted, restarting PHP, and that seems to work properly when running phpinfo().

What is probably happening is MySQL is trying to use its own libmysql.dll which is not compatible with PHP 64bit. To fix this, go into the MySQL directory and rename or delete the libmysql.dll file. Download and unzip the corresponding libmysql.dll file into the folder from which PHP is calling dll files e.g the C:\WINDOWS\System32 folder.

I want to use a dedicated server for Moodle, but how reliable is Moodle together with EasyPHP?

See Installation guide for Windows using EasyPHP. A dedicated machine for your production Moodle site is a good idea. EasyPHP, Fantastico and even XAMPP are designed to get a site up and running quickly but will still need to be adjusted for a production site.

Another option for an intranet (classroom or school based network) clean install on a new XP Pro server would be one of the Windows Installer Package. This package uses the XAMPP installer to automatically install and configure Apache Server, MySQL and PHP. Once installation is complete and setup and running, all you may need do is to edit the config.php file to show your IP address.

The XAMPP installer package may reduce effective security on an public internet site, so be careful with it. The other issue is the the XAMPP installer is resource hungry, so it does not easily handle a lot of users simultaneously. However unless your Students are whiz-kids, and really know their PHP and MySQL, one of the Windows package should be secure enough for your intranet.

I have a lot of Staff, how can I enter them as Users quickly?

You can set up a bulk upload of Users, irrespective of what their Role in the Moodle will be by using a flat file. It is simple to do, but like a lot of things with PHP, it must be exactly right or it does not work.

  1. Create a new file in a text editor (but not Windows Notepad, it does not render the UTF-8 character set.)
  2. Add fields in this order, and they must be separated by a comma, username, password, firstname, lastname, email
  3. Save the file in a UTF-8 format, this is apparently safer than other formats and use the file extension *.csv
  4. Go to Administration > Users > Accounts > Upload users
  5. Browse for the file and click "Upload Users".

As an alternative, you can also use MS-Excel, saving the file as a csv.

As the file is uploaded, Moodle will do validity checks on usernames, passwords and email addresses. Ensure that all fields have legal characters, no underscores or slashes.

If you want to make sure that Users will change their passwords as soon as they log-on, use the same password for all Users - "changeme" (without the quotes, of course).

If you want to make sure that Users enter the correct email address, then you can leave this field blank, in 1.9.+ only apparently.

For more information you can look at Upload users.

Which Enrollment option should I be using?

There is no easy answer here, depends on the needs of your site. Internal enrollments is the default setting. This means that you enter the students onto the Users list via a flat file, or dynamically authorize them with LADP and students can be enrolled when courses are created by Teachers or Course Creators, or later when they are given access via enrollment keys or if there is no security key, they can enroll anytime.

For a commercial site, you need to develop a strategy depending on what it is you are offering. The PayPal and Authorize.Net can set up the payment end of things, and an email based self-enrollment, using Captcha, becomes viable.

Here is a discussion about this topic. As you can see, this is an ongoing issue.

When I created courses, no summary icon becomes visible in the Categories screen.

Usually, in any web page, if an image does not display it is not where it is supposed to be. In Moodle this is not necessarily so, but because a number of settings have been reset and images are not included. when this happens the theme is using custom pix (in theme config.php $THEME->custompix = true; ) and even if the image file does exist it is not necessarily used unless Administration ► Miscellaneous ► Experimental ► Smartpix feature is enabled. Seems that some themes require different settings than others.

Why can I not seem to get files to overwrite older files? Some do not delete either, we just keep getting older files, why?

This can be a bit of a nuisance, but it has to do with Moodle itself. Moodle relies heavily on the cache, and files that are uploaded, downloaded and so on are placed into the cache. You can try emptying the cache, before you delete a file or delete then empty the cache, then upload the newer version. Or, delete the older file, then change the name of the newer file, upload that and make reference to the newer file. Assignment uploads overwrite the existing file in Moodle, but the cache gets in the way there too. Upload a file using version numbers, the older file will be overwritten when using the Upload Assignment activity. .

How do I restore an older graphics course that is way over the file upload limit?

This happens when you do not want to change the maxfile upload on your Moodle site but you do have access to the moodledata folder via FTP or some other program. There are two answers here, but they are in fact the same thing, just executed in different ways.

  • If you DO NOT know the settings or Moodle ID of the course here is the quick and dirty:

FTP your backup zip file to the site files folder, which is normally the folder named "1" inside the Moodledata folder. Go to Site Administration > Front Page > Front Page restore and go through the restore options.

Restore the course to a new course and remember to delete the zip file from the front page files or from the moodledata/1 folder. All files in the site files folder are visible to all Users. It is a good idea to backup your new course right away.

  • Longer method with detailed instructions:

Log into Moodle and create a new course, Ideally this will have the same course settings as the old course. Have your backup of the old course or the zip file of all the images you want to upload handy. The quickest way of getting to the moodledata/folder is to check the address bar. It will show the new folder number inside the moodledata folder. The address will read something like:

 [http://your.moodle.address/]files/index.php?id=[a number say-12]

You can then upload your file via FTP directly into the moodledata/12 folder.

Alternatively, enter the new course and go to Course Administration > Files. Inside Files, upload a new small file. This will create a new folder in your moodledata with the same ## as your course id. Return to the course homepage. Note the course ID in your browser address bar. For example purposes the course ID is 12. You can minimize your Moodle window and return to your FTP program.

Connect to your Moodle via FTP and look for the Moodledata folder. Inside Moodledata look for the folder with the course id, 12 in our example (/moodledata/12). Copy your zip file or what ever you want there.

In your Moodle, look in your files folder. You will see the files you transferred there. If it is a course backup, you can select the restore link right now, or unzip a file that contains all your images and sub-directories.

As you can see, if you are dealing with several courses, you really just need one course to dump the large zip files via FTP or your favorite file transfer program. Then you merely have to go to the file folder and restore the course backups to a new course. You might want to go back and delete the course backups that you transferred so students do not see them.

Students seem to be disappearing from courses and I cannot see why?

Sometimes we forget that if Students can enroll themselves, they can also unenroll themselves. Go to Administration > Users > Permissions > Define roles and select Students. In Permissions reset "Unassign own roles moodle/role:unassignself" to Prevent.

We need to limit enrolments to specific time periods some that are more than 365 days allowable in the course settings, how can we do that?

The "Enrolment duration" setting in your course settings page can limit the time period of the enrolment. The enrolment actually begins the moment the enrolment is confirmed, so pretty much straight away. To change the settings beyond the existing limits means you have to change code in the PHP page that controls the editing page.

If you go to your text editor, and it is not Windows Notepad, something like Notepad++ or TextPad or Crimson Editor, or anything in Linux that saves files as a UFT-8 file, and open the file course/edit_form.php. Scroll down to about line 240 and you should see this code:

 $periodmenu=array();
 $periodmenu[0] = get_string('unlimited');
 for ($i=1; $i<=365; $i++) {
   $seconds = $i * 86400;
   $periodmenu[$seconds] = get_string('numdays', , $i);

And change the code to read:

 $periodmenu=array();
 $periodmenu[0] = get_string('unlimited');
 for ($i=1; $i<=731; $i++) {
   $seconds = $i * 86400;
   $periodmenu[$seconds] = get_string('numdays', , $i);

The 365 is the number of days in a normal year, so change that number to 731 to double that period. You can be generous and give an extra day to account for leap years.

This solution below is from James McLean.

An alternative solution could be even slicker. It would be a slightly better idea to change the number 365 to a variable that can be defined in the config.php file, so that in future should this value need to change it can be done easily (by nearly anyone) rather than having to trawl through code that can be easily broken.

Something like this:

 In the config.php file add the line:
 $CFG->days_until_expire = 730;

And in the course/edit_form.php add the line:

 $periodmenu=array();
 $periodmenu[0] = get_string('unlimited');
 for ($i=1; $i<= $CFG->days_until_expire; $i++) {
   $seconds = $i * 86400;
   $periodmenu[$seconds] = get_string('numdays', , $i);
  }

And don't forget you made this change, because if you upgrade/update Moodle it's possible you'll loose it.

How can I hide User Profile Fields?

First, to remove a field from view go to:

   * Administration ► Users ► Permissions ► User policies

and select a field from "Hide user fields" - that should hide the field, but be careful, it might hide it everywhere, not just where you want it to be hidden.

Custom User fields have three visibility settings Seen by User, Seen by None or Seen by all. First is only user and Admins, second is only Admins and last is everyone, you can set this when you create the field.

We need to prevent a few users from changing their own passwords, but how?

You can prevent a user from changing their password by creating a new role with the capability to change own password prevented, then assigning the role in the system context. Please see Demo teacher role for an example usage.

Thanks Helen Foster

How do I control the Default Subscription option for Users?

Administrators do not need to at one level, as this is a setting at found in the User Profile - click the Show Advanced button. The User can set the field "Forum auto-subscribe" to either "Automatically subscribe me when I post" or "Don't autosubscribe me when I post" or you can set this as a default.

When you create users via an upload you can set the default setting in the user profile to be "Don't subscribe".

When a forum is created, you can set the Force everyone to be subscribed? option to Not allow subscriptions.

If you want to make it a site wide restriction for all Students, say, then the "initialsubscription", "managesubscriptions" permissions can be set to Prevent. Or perhaps you may want to set the "Throttling applies" permission to Allow and "View Discussions" to Prevent.

I am having difficulty with the edit icon in a summary block. It will not take me to the editor.

Generally, this happens when the summary block edit icon been disconnected from the HTML editor. There are usually a number of causes, but the most common seems to be the pasting of a Microsoft Word document into the summary block. The document brings with it a lot of Word generated HTML, very little of which is actually useful outside Microsoft generated environments. To fix this issue is a little time consuming and detailed, but really easy.

Go to your course and turn on Editing, then open the section prior to the section that has the corrupted summary in it. In the address bar of that page it should read something like: "http://your.moodle.address.ip_or_path/course/editsection.php?id=28". It is the number that is important here, just replace it with the next sequential number, and see what opens, if it is not the right section, then try the next one and so on until you get the section you are looking for. It may take a number of tries to get the right section, but this is simpler than hunting for it in the database.

An alternative would be to do a backup of the course, edit the moodle.xml file and restore it.

See also