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

Windows installation using XAMPP: Difference between revisions

From MoodleDocs
m (clean up, typos fixed: you’ll → you'll, It’s → It's (2))
 
(41 intermediate revisions by 12 users not shown)
Line 1: Line 1:
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 progrmas and how to install a Moodle standard package on the server which was created.
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 not intended for the [[Complete install packages for Windows]] from download.Moodle.org - although the troubleshooting part may help if you encounter problems.  XAMPP is also used to create Moodle's complete install packages.'''
:''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. Be aware that XAMPP is designed for developers and so deliberately has just about all security features turned off'''XAMPP-lite''' is used to create a [[Complete install packages for Windows]] which has a different installation process.  


==Overview==
==Overview==
Note: This page was updated showing an installation for XAMPP 1.7.1 but some older screenshots were kept.
Note: This page was updated showing an installation for XAMPP 1.7.1 but some older screenshots were kept. It is now October 2015 and XAMPP's current version is 5.6.8 and Moodle is 3.0    Windows is no longer supporting XP, Windows 10 is the desktop latest and greatest. 


This is a guide for installing XAMPP and Moodle on a computer using the Windows XP operating system.
This is a guide for installing XAMPP and Moodle on a computer.  The instructions are in the process of being updated.  You may find the older instructions in previous versions of MoodleDocs.


An overview of the steps:
===XAMPP===
*Download the latest version of XAMPP from Apachefriends.org
*Install XAMPP - It will ask if you want to install it at C:\xampp
**Alternatively, install in C:\xampp123 if you plan on installing more than one webserver
*Use control.exe in the XAMPP folder to start and stop Apache and MySQL
*Note the MySQL port.
*If Apache will not start because of a port conflict
**then use config button to change the http listening port to something like 127.0.0.1:181
*Type localhost in your browser, or 127.0.0.1:181 (if you changed the port number)
*You should get to localhost/xampp splash page, your localhost webserver is running.
*Unpack the latest version of Moodle into the c:\xampp\htdocs folder.
**Alternative rename the moodle folder if you plan on having different versions of Moodle
**For example, rename it something like C:\xampp\htdocs\moodle31
*In your web browser type in 127.0.0.1/moodle or 127.0.0.1:181/moodle31
*You will need to know port number and the usual Moodle Installation initial questions.
**Xampp uses the Mariadb database (based upon MySql), if the install says your MySQL database is too old go to the c:\xampp\htdocs\moodlel\config.php file and change the database line to $CFG->dbtype    = 'mariadb';
**If you have not changed the database password,  The dbuser = 'root' and dbpass ='';
*The Moodle install process takes a long time.  Be patient, even when things don't look like anything is happening.


*Download the standard Moodle install package you wish to use
===XAMPP using Bitnami to install Moodle===
*Download the latest version of XAMPP from Apachefriends.org
*Download the latest version of XAMPP from Apachefriends.org
*Install XAMPP
*Install XAMPP
*Start XAMPP, which will start Apache and MySQL
*Use control.exe in XAMPP folder to start and stop Apache and MySQL
*Confirm webserver is operating with your browser
*Note the MySQL port.
*Unzip Moodle into the htdocs folder
*If Apache will not start because of a port conflict
*Use your browser to navigate to Moodle
**then use config button to change the listening port to something like 127.0.0.1:181
*Install Moodle, perhaps pausing to update some configuration files
*Type localhost in your browser, or 127.0.0.1:181 (if you changed the port number)
*Create Admin user and Front Page settings and you have done it.
*You should get to localhost/xampp splash page.
*Click on the Moodle icon to allow Bitnami to install the latest version of Moodle.
*You will need to know port number and the usual Moodle Installation initial questions.
*The Moodle install process takes a long time.  Be patient, even when things don't look like anything is happening.
 
 
What follows are old XP instructions which will not help much.


==Preparation==
==Preparation==
Line 24: Line 47:
===Get Moodle===
===Get Moodle===
Download the standard version of Moodle you wish to install from Moodle.org [http://download.moodle.org Standard install packages].
Download the standard version of Moodle you wish to install from Moodle.org [http://download.moodle.org Standard install packages].
Alternative, once XAMPP is installed use the Moodle link and allow Bitnami to download a current version and start the free install for you.


===Get XAMPP===
===Get XAMPP===
Line 29: Line 54:


===Allow yourself some time===
===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.
Allow an hour or more 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.
:''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==
==Create XAMPP webserver==
===Installing XAMPP===
===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.
Run the installer, eventually you will be presented with an option about where to install the package. A best practice is to give the xampp folder a name that is unique.  For example, in C:\xampp568
 
[[Image:XAMPP171 Install folder.png|center]]


Continue with the installation, this will take a while!
Continue with the installation, this will take a while!
[[image:Xampp3.gif|thumb|center|200px|Installation info screen]]


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


[[image:Xampp4.gif|center|XAMPP 1.7.1 looks different]]
*It's probably best to choose “No” for now. You can always enable these as services later.
 
*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.
 
[[image:Xampp5.gif|center]]


*Click the “No” button.
Next you'll be asked if you want to start the XAMPP Control Panel. Say yes.  You can find the XAMPP-control.exe file in your XMAMPP folder.  It is useful.


=== Launch XAMPP ===
=== Launch XAMPP ===
Line 58: Line 73:
1. On your Desktop, locate the shortcut XAMPP icon and double click to launch the 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).  
**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.   
2. Alternatively, there are several start stop bat and exe files in the xampp folder.  The XAMPP-control.exe file takes the place of these.
**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 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 - please review "Troubleshooting" at the end of these instructions.'''
'''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.'''
 
==Option create the database==
In some older versions of Moodle, it was necessary to created the database before Moodle could install the tables as part of the install process. In Moodle 3.x this is not necessary.  However, you can create the database before starting the Moodle install and then put that database name when Moodle asks for it.  While these instructions refer to MySQL, they also work for MariaDB which is part of XAMPP.


==Create the MySQL database==
To create a MySQL database for your Moodle “site” we will use the phpMyAdmin utility included with XAMPP.
To create a MySQL database for your Moodle “site” we will use the phpMyAdmin utility included with XAMPP.
[[image:Xampp8.gif|right|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.


*To access phpmyadmin launch the web browser of your choice, type localhost/phpmyadmin  or 127.0.0.1/xampp/ in the address bar.
*If you have set a password you will be prompted for it.


*The XAMPP default page wiil be displayed, click the link for your preferred language – we will be using English.
*When phpMy Admin has launched in your browser window, enter the name of your database in the “Create new database” field. Usually this is simply moodle, but you might say moodle310.
 
*From the menu on the left, click on “phpMyAdmin”
 
[[image:Xampp10.gif|center|Click on phpMyAdmin]]
 
*When phpMy Admin has launched in your browser window, enter the name of your database in the “Create new database” field.  
 
[[Image:PhpMyAdmin3131 create database.png|thumb|center|Center of initial phpMyAdmin screen]]


* From the "Collation" drop down list select "utf8_unicode_ci"
* From the "Collation" drop down list select "utf8_unicode_ci"
Line 86: Line 92:
*Click the “Create” button to create the database.
*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.
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.
 
[[image:Xampp13.gif|thumb|center|Example of a phpMyAdmin database list, click on moodle to add MySQL users]]
 
[[Image:PhpMyAdmin3131 created moodle.png|thumb|center|The database is corrected, notice the privileges icon]] 


===MySQL security===
===MySQL security===
Security on a localhost maynot 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. [[Image:PhpMyAdmin3131 privileges edit.png|thumb|center|See the edit action icon]]
Security on a localhost may not be a big concern. The recent versions of XAMPP do not set a password for root, the superuser. Go to the file C:\xampp\phpmyadmin\config.inc.php, edit the line $cfg['Servers'][$i]['password'] = ''; For example to:
 
$cfg['Servers'][$i]['password'] = 'password2016';
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. [[Image:PhpMyAdmin3131 privileges create admin.png|thumb|center|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==
==Prepare server for Moodle==
Line 102: Line 102:


===Extract standard Moodle package files===
===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.   
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 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.
*Extract the Moodle files to htdocs. A default folder named “moodle” is created with all the Moodle folders and files within it. If you anticipate wanting to have different versions of Moodle on this web server, change the name of the3 folder from moodle to say "moodle31' and then the next one to say "moodle35", etc.
 
[[image:Xampp19.gif|thumb|center|Example of Moodle folder inthe server's htdocs]]


===Moodledata folder===
===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.  
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, and php folders. If you anticipate adding different versions of moodle on your XAMPP server, give the moodledata folder a unique name.
*For example: "C;\X_server\moodledata"  or "C:\apachefriends\151\moodledata".
*For example: "C:\xampp\moodledata301"  or "C:\xampp\moodledata350".


*You may have to change the permissions of the folder in some operating systems.   
*You may have to change the permissions of the folder in some operating systems.  To do this right click on the moodledata folder, select properties and the "Security" tab.
[[image:Vista_moodle_5.jpg|thumb|125px|right|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.
:Another box will pop up. Select "Users" and give them "Modify" and "Write" permissions, along with whatever existed already.
Line 126: Line 122:
===Go to moodle in web browser===
===Go to moodle in web browser===
[[image:Xampp23.gif|thumb|right|Browser address]]
[[image:Xampp23.gif|thumb|right|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 <nowiki>http://localhost/moodle</nowiki>.
In your web browser, type the path to the folder containing the Moodle files in te address bar – in this example it's <nowiki>http://localhost/moodle</nowiki>.


===Select language===
===Select language===
Line 135: Line 131:


===Diagnostic report===
===Diagnostic report===
A diagnostic report is displayed – hopefully it will look like this, if not you may need to address some issues.
A diagnostic report is displayed – hopefully every line has an "OK" in the status column. If not you may need to address some issues. Clicking on the report link will give you some hints to cure the problem. Generally speaking a line that has a "check" in the status column will allow you to continue.  
 
[[image:Xampp25.gif|thumb|center|Initial diagnostic, it passed, no warnings]]


*Click the “Next” button to continue.
*Click the “Next” button to continue.
Line 144: Line 138:
The paths for your Moodle installation are shown – accept these or amend as desired.
The paths for your Moodle installation are shown – accept these or amend as desired.


[[image:Xampp26.gif|thumb|center|Paths to parts of your Moodle]]
 


*Click the “Next” button to continue.
*Click the “Next” button to continue.


===MySQL database settings===
===MySQL database settings===
In this screen we enter the database settings. The fields are populated with some suggested values.
The interface on this screen changes over time.  However, the database settings fields are the same in 3.0. 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.
*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
*As a best practice, change the "mdl_" prefix to something else, perhaps "mdl_30_".
 
*In later versions of Moodle you maybe asked for the database port number.  Refer to the XAMPP-Control.exe program main screen for that information. The default maybe 3306.
 
:''TIP:'' You may want a separate database for each version of Moodle. UsephpMyAdmin to create the database (remember should be UTF-8)with a name something like moodle30.  Then on this screen put the new database name.  


:''TIP:'' DO NOT USE THE “ROOT” USER WITHOUT A PASSWORD FOR PRODUCTION INSTALLATIONS AS THIS CREATES A SECURITY VULNERABILITY.   
:''TIP:'' DO NOT USE THE “ROOT” USER WITHOUT A PASSWORD FOR PRODUCTION INSTALLATIONS AS THIS CREATES A SECURITY VULNERABILITY.   
Line 157: Line 156:


*When you have added or edited information on the page, click the “Next” button to continue.
*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.  
:''TIP:'' This information is creating and can later be edited in the htdocs/moodle/config.php file.


===Server check===
===Server check===
[[Image:Moodle Install Server checks.png|thumb|center|150px|Server check with minor issues]]
[[Image:Moodle Install Server checks.png|thumb|center|150px|Server check with minor issues]]
This screen will report any issues with your webserver settings. Typically the [[admin/environment/php extension/curl|CURL settings]] and [[admin/environment/php extension/openssl|OpenSLL settings]] in a new XAMPP install will receive a mild or critical warning.     
This screen will report any issues with your webserver settings. Typically the [[admin/environment/php extension/curl|CURL settings]] and [[admin/environment/php extension/openssl|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 at this point and then use the refresh button at the bottom of the server check page.  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.
:'''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 install confirmed===
Line 177: Line 176:




*Click the “Yes” button to continue.
*Click the “Yes” button to continue.


===Now you can Moodle===
===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.
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
Good job !
 
 


==Troubleshooting==
==Troubleshooting==
Line 189: Line 186:
*If you have previously created a Moodle install with the [http://bitnami.org 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.
*If you have previously created a Moodle install with the [http://bitnami.org 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===
===Skype===
*If XAMPP does not work when you launch your browser and you have [http://www.skype.com Skype] enabled it may be necessary to change the port settings in Skype.
*If XAMPP does not work when you launch your browser and you have [http://www.skype.com Skype] enabled it may be necessary to change the port settings.  You may also have issues with other programs and it might be easier to change the port settings in XAMPP and Moodle.  Here is how to change them in Skype.  


* Locate "Options..." in Skype.
* Locate "Options..." in Skype.
[[Image: Skype1.gif|thumb|center|Click to make bigger]]
* Locate the "Connection" options.
* Locate the "Connection" options.
[[Image: Skype2.gif|thumb|center|Click to make bigger]]
* Remove the tick / check from the Checkbox.
* Remove the tick / check from the Checkbox.
[[Image: Skype3.gif|thumb|center|Click to make bigger]]
* Click the "Save" button.
* Click the "Save" button.
* You may need to restart your computer for this to take effect.
* Or you can quit your Skype session while you are working on Moodle.


* You may need to re-start your computer for this to take effect.
===Still having problems but do not have Skype installed, using Windows 10?===
* Check for another program which may be using port 80. IIS is commonly found to be the culprit.  You can put the service called World Wide Web Publishing Service on manual.  If you use MS's Shared space, then do not fight city hall, leave it running.


You can change the port for you XAMPP webserver.  The easiest way is to use XAMPP-Control.exe, then click on the config button for Apache.  This will open up the httpd.conf file.  Look for the Listen lines.  A best practice is to comment out (with a #) the current active line and type in a new line.  For example, you might type
Listen 127.0.0.1:181


Next you will need to go to the Moodle config.php file and change the wwwroot location by adding the port to the address.  For example: $CFG->wwwroot  = 'http://127.0.0.1:181/moodle';


===Still having problems but do not have Skype installed?===
Don't forget to save the file and restart Apache.
* Check for another program which may be using port 80. IIS is commonly found to be the culprit.


====Moodle Networking does not work====
====Moodle Networking does not work====
You may need to enable curl. [[admin/environment/php extension/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 [http://www.tildemark.com/programming/php/enable-curl-with-xampp-on-windows-xp.html Enable curl in XAMPP on XP]
You may need to enable curl. [[admin/environment/php extension/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 [http://www.tildemark.com/programming/php/enable-curl-with-xampp-on-windows-xp.html Enable curl in XAMPP on XP]
====Installs but will not load after creating admin====
You install Moodle, your browser takes forever and then it tells you it can not find the page.
[https://moodle.org/mod/forum/discuss.php?d=229591  Ken White gave excellent instructions here] in 2013 which also worked with on 3.0 install in 2015.
Have had to do this once on a stubborn server ...run this from your browser
http://server/admin/purgecaches.php
and it that might work. 
If not continued to physically removed the contents of:
/moodledata/cache/cachestore_file/default_application
which is what the purgecaches.php script was to do.
At that point, clear the browser cookies and cache (or open another browser) and try it again.


==See also==
==See also==
*[[Windows installation]]
*[[Windows installation]]
*[[Installing AMP]] - Overview of other OS packages
*[[Installing AMP]] - Overview of other OS packages
*[https://docs.moodle.org/en/Xampp_Installer_FAQ Xampp Installer FAQ]
*[[Complete install packages|Complete install packages for Windows]]
*[[Complete install packages|Complete install packages for Windows]]
*[[Installation Quickstart]] the short and simple install notes for experienced
*[[Installation Quickstart]] the short and simple install notes for experienced

Latest revision as of 15:17, 15 February 2022

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. Be aware that XAMPP is designed for developers and so deliberately has just about all security features turned off. 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. It is now October 2015 and XAMPP's current version is 5.6.8 and Moodle is 3.0 Windows is no longer supporting XP, Windows 10 is the desktop latest and greatest.

This is a guide for installing XAMPP and Moodle on a computer. The instructions are in the process of being updated. You may find the older instructions in previous versions of MoodleDocs.

XAMPP

  • Download the latest version of XAMPP from Apachefriends.org
  • Install XAMPP - It will ask if you want to install it at C:\xampp
    • Alternatively, install in C:\xampp123 if you plan on installing more than one webserver
  • Use control.exe in the XAMPP folder to start and stop Apache and MySQL
  • Note the MySQL port.
  • If Apache will not start because of a port conflict
    • then use config button to change the http listening port to something like 127.0.0.1:181
  • Type localhost in your browser, or 127.0.0.1:181 (if you changed the port number)
  • You should get to localhost/xampp splash page, your localhost webserver is running.
  • Unpack the latest version of Moodle into the c:\xampp\htdocs folder.
    • Alternative rename the moodle folder if you plan on having different versions of Moodle
    • For example, rename it something like C:\xampp\htdocs\moodle31
  • In your web browser type in 127.0.0.1/moodle or 127.0.0.1:181/moodle31
  • You will need to know port number and the usual Moodle Installation initial questions.
    • Xampp uses the Mariadb database (based upon MySql), if the install says your MySQL database is too old go to the c:\xampp\htdocs\moodlel\config.php file and change the database line to $CFG->dbtype = 'mariadb';
    • If you have not changed the database password, The dbuser = 'root' and dbpass =;
  • The Moodle install process takes a long time. Be patient, even when things don't look like anything is happening.

XAMPP using Bitnami to install Moodle

  • Download the latest version of XAMPP from Apachefriends.org
  • Install XAMPP
  • Use control.exe in XAMPP folder to start and stop Apache and MySQL
  • Note the MySQL port.
  • If Apache will not start because of a port conflict
    • then use config button to change the listening port to something like 127.0.0.1:181
  • Type localhost in your browser, or 127.0.0.1:181 (if you changed the port number)
  • You should get to localhost/xampp splash page.
  • Click on the Moodle icon to allow Bitnami to install the latest version of Moodle.
  • You will need to know port number and the usual Moodle Installation initial questions.
  • The Moodle install process takes a long time. Be patient, even when things don't look like anything is happening.


What follows are old XP instructions which will not help much.

Preparation

Get Moodle

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

Alternative, once XAMPP is installed use the Moodle link and allow Bitnami to download a current version and start the free install for you.

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

Allow an hour or more 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. A best practice is to give the xampp folder a name that is unique. For example, in C:\xampp568

Continue with the installation, this will take a while!

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

  • 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. Say yes. You can find the XAMPP-control.exe file in your XMAMPP folder. It is useful.

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. Alternatively, there are several start stop bat and exe files in the xampp folder. The XAMPP-control.exe file takes the place of these.

  • 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.

Option create the database

In some older versions of Moodle, it was necessary to created the database before Moodle could install the tables as part of the install process. In Moodle 3.x this is not necessary. However, you can create the database before starting the Moodle install and then put that database name when Moodle asks for it. While these instructions refer to MySQL, they also work for MariaDB which is part of XAMPP.

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

  • To access phpmyadmin launch the web browser of your choice, type localhost/phpmyadmin or 127.0.0.1/xampp/ in the address bar.
  • If you have set a password you will be prompted for it.
  • When phpMy Admin has launched in your browser window, enter the name of your database in the “Create new database” field. Usually this is simply moodle, but you might say moodle310.
  • 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.

MySQL security

Security on a localhost may not be a big concern. The recent versions of XAMPP do not set a password for root, the superuser. Go to the file C:\xampp\phpmyadmin\config.inc.php, edit the line $cfg['Servers'][$i]['password'] = ; For example to:

$cfg['Servers'][$i]['password'] = 'password2016';

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 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. If you anticipate wanting to have different versions of Moodle on this web server, change the name of the3 folder from moodle to say "moodle31' and then the next one to say "moodle35", etc.

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, and php folders. If you anticipate adding different versions of moodle on your XAMPP server, give the moodledata folder a unique name.

  • For example: "C:\xampp\moodledata301" or "C:\xampp\moodledata350".
  • You may have to change the permissions of the folder in some operating systems. 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 every line has an "OK" in the status column. If not you may need to address some issues. Clicking on the report link will give you some hints to cure the problem. Generally speaking a line that has a "check" in the status column will allow you to continue.

  • Click the “Next” button to continue.

Paths for Moodle installation

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


  • Click the “Next” button to continue.

MySQL database settings

The interface on this screen changes over time. However, the database settings fields are the same in 3.0. 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.
  • As a best practice, change the "mdl_" prefix to something else, perhaps "mdl_30_".
  • In later versions of Moodle you maybe asked for the database port number. Refer to the XAMPP-Control.exe program main screen for that information. The default maybe 3306.
TIP: You may want a separate database for each version of Moodle. UsephpMyAdmin to create the database (remember should be UTF-8)with a name something like moodle30. Then on this screen put the new database name.
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. You may also have issues with other programs and it might be easier to change the port settings in XAMPP and Moodle. Here is how to change them in Skype.
  • Locate "Options..." in Skype.
  • Locate the "Connection" options.
  • Remove the tick / check from the Checkbox.
  • Click the "Save" button.
  • You may need to restart 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, using Windows 10?

  • Check for another program which may be using port 80. IIS is commonly found to be the culprit. You can put the service called World Wide Web Publishing Service on manual. If you use MS's Shared space, then do not fight city hall, leave it running.

You can change the port for you XAMPP webserver. The easiest way is to use XAMPP-Control.exe, then click on the config button for Apache. This will open up the httpd.conf file. Look for the Listen lines. A best practice is to comment out (with a #) the current active line and type in a new line. For example, you might type Listen 127.0.0.1:181

Next you will need to go to the Moodle config.php file and change the wwwroot location by adding the port to the address. For example: $CFG->wwwroot = 'http://127.0.0.1:181/moodle';

Don't forget to save the file and restart Apache.

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

Installs but will not load after creating admin

You install Moodle, your browser takes forever and then it tells you it can not find the page. Ken White gave excellent instructions here in 2013 which also worked with on 3.0 install in 2015.

Have had to do this once on a stubborn server ...run this from your browser
http://server/admin/purgecaches.php
and it that might work.  
If not continued to physically removed the contents of:
/moodledata/cache/cachestore_file/default_application
which is what the purgecaches.php script was to do.
At that point, clear the browser cookies and cache (or open another browser) and try it again.

See also