Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Windows installation using XAMPP.

Windows installation using XAMPP

From MoodleDocs

XAMPP is a fully functional web server package. It is built to test web based programs on a personal computer. It is not meant for online access via the web on a production server. This page describes how to install the XAMPP webserver package of programs and how to install a Moodle standard package on the server which was created.

TIP: These guidelines are intended for a Standard Moodle installation on a Windows PC for a private or test Moodle installation, not a production (public) site or service. XAMPP-lite is used to create a Complete install packages for Windows which has a different installation process.

Overview

Note: This page was updated showing an installation for XAMPP 1.7.1 but some older screenshots were kept.

This is a guide for installing XAMPP and Moodle on a computer using the Windows XP operating system, but it is still usable for Vista.

An overview of the steps:

  • Download the standard Moodle install package you wish to use
  • Download the latest version of XAMPP from Apachefriends.org
  • Install XAMPP
  • Start XAMPP, which will start Apache and MySQL
  • Confirm webserver is operating with your browser
  • Unzip Moodle into the htdocs folder
  • Use your browser to navigate to Moodle
  • Install Moodle, perhaps pausing to update some configuration files
  • Create Admin user and Front Page settings and you have done it.

Preparation

Get Moodle

Download the standard version of Moodle you wish to install from Moodle.org Standard install packages.

Get XAMPP

Go to apachefriends.org and download XAMPP for Windows. This example assumes that you have downloaded the “Installer” package. There are several XAMPP packages to download. Installer is about 1/2 the size of the same package as a zip file.

Allow yourself some time

We would allow 30 to 60 minutes to get to the Moodle Front Page on a new site. The time will depend upon the speed of your computer, download connection and of course your familiarity with the process.

TIP: On slower internet connections, download what you need into a folder for a later install. The serious moodler might create a MoodleZip folder to put all their different Moodle related zipfiles.

Create XAMPP webserver

Installing XAMPP

Run the installer, eventually you will be presented with an option about where to install the package. We told it to install it in a new folder called C:\X_server which XAMPP will create. You could use the browse button to point to a location.

XAMPP171 Install folder.png

Continue with the installation, this will take a while!

Installation info screen

Eventually you will be presented with the option to install Apache, MySQL, Filezilla and Mercury as a service.

XAMPP 1.7.1 looks different
  • It’s probably best to choose “No” for now. You can always enable these as services later.

Next you’ll be asked if you want to start the XAMPP Control Panel.

Xampp5.gif
  • Click the “No” button.

Launch XAMPP

There are several ways to start your webserver.

Server directory start/stop files
One way to start/stop: XAMPP control panel

1. On your Desktop, locate the shortcut XAMPP icon and double click to launch the Control Panel.

    • When the XAMPP Control Panel has launched, click the “Start” buttons for Apache and MySQL (see below).

2. In the folder you installed XAMPP, look for the XAMPP_start, or XAMPP_restart icon.

    • When XAMPP start has finished, both Apache and MySQL have been started.

3. In the folder you installed XAMPP, look for the Apache start and MySQL start icons

    • When Apache and MySQL start icons are used, two black windows command window should remain open
  • If all is well you will see something like this.

If Apache fails to run i.e. the "Running" text with the green background keeps disappearing) and you are using Skype or another program that uses port 80 e.g. IIS - please review "Troubleshooting" at the end of these instructions.


Then you have to install the PHP curl library :

  1. Open the php.ini file found in the php/php.ini folder
     (older versions of XAMPP use moodle/apache/bin folder)
  2. Find the line: ;extension=php_curl.dll
  3. Remove the ; at the beginning of the line
  4. Restart Apache if necessary 


Create the MySQL database

To create a MySQL database for your Moodle “site” we will use the phpMyAdmin utility included with XAMPP.

Browser address bar
  • To access this launch the web browser of your choice (Firefox is used in this example), type http://localhost in the address bar.


  • The XAMPP default page will be displayed, click the link for your preferred language – we will be using English.
  • From the menu on the left, click on “phpMyAdmin”
Click on phpMyAdmin
  • When phpMy Admin has launched in your browser window, enter the name of your database in the “Create new database” field.
Center of initial phpMyAdmin screen
  • From the "Collation" drop down list select "utf8_unicode_ci"
  • Click the “Create” button to create the database.

You should see the database on the left with your moodle MySQL database name without files in it and/or a notice that it was created.

Example of a phpMyAdmin database list, click on moodle to add MySQL users
The database is corrected, notice the privileges icon

MySQL security

Security on a localhost may not be a big concern, but at this point we recommend you click the moodle database, then on the privileges icon. Select one of the root users for editing. Create their passwords.

See the edit action icon

The best practice is to create a password for the root user. The "edit action" will give a place to do that. Another good practice is to copy the root user's privileges to another user. Here we changed the root user to admin, added a password and kept the user called root.

Creating an admin MySQL user
TIP: On a localhost site, that has no internet security issues, use the same name and password for the user with the most privileges/permissions, usually "admin", for both MySQL and Moodle.

Prepare server for Moodle

You will need to extract the folders and files from the downloaded package and create the moodledata folder (where images, course and user data/files will be located).

Extract standard Moodle package files

Locate the zip file of the standard install package you downloaded from Moodle.org. The easiest method is to extract everything in the file to the htdocs folder that XAMPP just created. Most XP Windows operating systems come with an program that will recognize a zip file and ask you where you want to extract the files.

  • Extract the Moodle files to htdocs. A default folder named “moodle” is created with all the Moodle folders and files within it.
Example of Moodle folder inthe server's htdocs

Moodledata folder

It is a good practice to manually create the moodledata folder. In an standard default install, Moodle will look for it in the top most level of folders on your server, the same level as htdocs, apache, php and those folders.

  • For example: "C;\X_server\moodledata" or "C:\apachefriends\151\moodledata".
  • You may have to change the permissions of the folder in some operating systems.
Windows Vista folder securities tab showing permissions
For example, in Windows Vista, you will need to manually create your moodledata folder and assign it permissions. To do this right click on the moodledata folder, select properties and the "Security" tab.
Another box will pop up. Select "Users" and give them "Modify" and "Write" permissions, along with whatever existed already.

Start of initial Moodle install

You have now installed a webserver on your computer. Next you need to get Moodle to install itself. You will use your favorite web browser to do this.

Other pages in MoodleDocs describe the install process. We will just cover the first few screens.

Go to moodle in web browser

Browser address

In your web browser, type the path to the folder containing the Moodle files in te address bar – in this example it’s http://localhost/moodle.

Select language

The initial install page will ask you to choose your preferred language.

Select language
  • Click the “Next” button.

Diagnostic report

A diagnostic report is displayed – hopefully it will look like this, if not you may need to address some issues.

Initial diagnostic, it passed, no warnings
  • Click the “Next” button to continue.

Paths for Moodle installation

The paths for your Moodle installation are shown – accept these or amend as desired.

Paths to parts of your Moodle
  • Click the “Next” button to continue.

MySQL database settings

In this screen we enter the database settings. The fields are populated with some suggested values.

  • In this example the database created is “moodle153”. If you created a password for root place it here. If you want the MySQL user admin to log into the moodle MySQL database, place that user and the password here.
TIP: DO NOT USE THE “ROOT” USER WITHOUT A PASSWORD FOR PRODUCTION INSTALLATIONS AS THIS CREATES A SECURITY VULNERABILITY.
MySQL database settings screen
  • When you have added or edited information on the page, click the “Next” button to continue.
TIP: This information is creating and can later be edited in the htdocs/moodle/config.php file.

Server check

Server check with minor issues

This screen will report any issues with your webserver settings. Typically the CURL settings and OpenSLL settings in a new XAMPP install will receive a mild or critical warning.

TIP: It is possible to open Windows Explorer and edit the php/php.ini file using a plain text editor e.g. notepad at this point and then use the refresh button at the bottom of the server check page once you have saved your changes. However, exiting the Moodle install at this point is not the end of the world, all your settings up to this point have been saved. Localhost\moodle will start the install again.

Moodle install confirmed

Moodle will tell you it has install the basics.

Confirmed
  • Click the “ Continue” button to proceed.

Moodle copyright & license

The Moodle copyright / license notices are displayed.

Copyright & license


  • Click the “Yes” button to continue.

Now you can Moodle

You will be asked to create the admin user for your Moodle site. Then as the admin Moodle user, you will be taken to the Front Page settings to start to build your new site. Good job

Troubleshooting

Bitnami

  • If you have previously created a Moodle install with the Bitnami installer you may find that Apache will not start. This is because Bitnami installs a service for Apache and MySQL. To disable these go to Control Panel > Administrative tools > Service to locate and disable these services.

Skype

  • If XAMPP does not work when you launch your browser and you have Skype enabled it may be necessary to change the port settings in Skype.
  • Locate "Options..." in Skype.
Click to make bigger


  • Locate the "Connection" options.
Click to make bigger


  • Remove the tick / check from the Checkbox.
Click to make bigger


  • Click the "Save" button.
  • You may need to re-start your computer for this to take effect.
  • Or you can quit your Skype session while you are working on Moodle.

Still having problems but do not have Skype installed?

  • Check for another program which may be using port 80. IIS is commonly found to be the culprit.

Moodle Networking does not work

You may need to enable curl. Curl help which will tell you the line of code in the php/php.ini file to change. Or find more instructions at this link Enable curl in XAMPP on XP

See also