Windows installation using XAMPP: Difference between revisions

From MoodleDocs
m (Minor corrections)
 
(111 intermediate revisions by 14 users not shown)
Line 1: Line 1:
*Return to [[Windows installation]]
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.


== Windows installation using XAMPP ==
:''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.
===Introduction===


Not: This guide uses XAMPP 1.5.1
==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. 


In this guide to installing Moodle on a computer using the Windows XP operating system there are a series of steps you will need to take which are explained step-by-step below. In overview the process is as follows:
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.


The first steps are to obtain the Moodle files themselves and the software package (XAMPP) which installs the environment (PHP, Apache and MySql) Moodle requires to run on you computer. When these have been downloaded you will need to install XAMPP on you computer in much the same way as any other Windows program. The steps detail a recommended change to one of the installed components before explaining how to launch XAMPP and create the database required by Moodle (the database you create will be referred to later when installing Moodle).
===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.


Having set up the environment you must then place the Moodle files downloaded earlier into the correct location so that they can be accessed for the purposes of initiating the installation process (now) and later to run Moodle. (The installation and use of Moodle is conducted entirely from you web browser e.g. Internet Explorer, Firefox).
===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.


'''Note: These guidelines are not intended for the Complete Install Package from Downloads at Moodle.org - although the troubleshooting part may help if you encounter problems.'''


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


====Get Moodle!====
==Preparation==


*Download the version of Moodle you wish to install from [http://download.moodle.org/ Moodle.org]
===Get Moodle===
Download the standard version of Moodle you wish to install from Moodle.org [http://download.moodle.org Standard install packages].


[[Image: 14a.gif]].
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===
Go to apachefriends.org and download [http://www.apachefriends.org/en/xampp-windows.html 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. 


*Download XAMPP for Windows from [http://www.apachefriends.org/en/xampp.html Apachefriends.org]. This example assumes that you have downloaded the “Installer” package.
===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.
[[image:Xampp1.png]]
:''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.
 
====Allow yourself some time====
*Say 45 minutes.


==Create XAMPP webserver==
===Installing XAMPP===
===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


*Run the installer, eventually you will be presented with an option about where to install the package.
Continue with the installation, this will take a while!
 
[[image:Xampp2.gif]]
 
*In this example we are installing the package at c:\apachefriends\151 – that’s because it suits what our needs, you can choose you own location by specifying any suitable alternative folder.


*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.
 
[[image:Xampp3.gif]]
 
*Eventually you will be presented with the option to install Apache, MySQL, Filezilla as a service.
 
[[image:Xampp4.gif]]


*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.
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.
 
[[image:Xampp5.gif]]
 
*Click the “No” button.
 
===Change PHP version===
 
*It's often a good idea to switch to PHP version 4.x before installing Moodle to lessen the chances of any incompatibilities with more recent versions. Currently Moodle requires PHP version 4.3 (or higher).
 
To roll back to an earlier version of PHP as follows:
 
*From the “Start” menu locate the program group for apachefriends > xampp
 
[[image:Xampp20.gif]]
 
*Select “php switch”


[[image:Xampp21.gif]]
=== Launch XAMPP ===
 
There are several ways to start your webserver. [[Image:XAMPP171 start stop options.png|thumb|left|60px|Server directory start/stop files]][[image:Xampp6.gif|thumb|right|100px|One way to start/stop: XAMPP control panel]]
*Follow the instructions in the window.
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).  
[[image:Xampp22.gif]]
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.
 
===Launch XAMPP Control Panel ===
 
*On your Desktop, locate the 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.  
 
[[image:Xampp6.gif]]


*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.'''
 
[[image:Xampp31.gif]]
 
===Create the database===
 
*To create a database for your Moodle “site” we will use the phpMyAdmin utility included with XAMPP.
 
*To access this launch the web browser of your choice (Firefox is used in this example), type http://localhost in the address bar.
 
[[image:Xampp8.gif]]


*The XAMPP default page is displayed, click the link for your preferred language – we will be using English.
==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.


[[image:Xampp9.gif]]
To create a MySQL database for your Moodle “site” we will use the phpMyAdmin utility included with XAMPP.


*From the menu on the left, click on “phpMyAdmin”
*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.


[[image:Xampp10.gif]]
*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.


*When phpMy Admin has launched in your browser window, enter the name of your database in the “Create new database” field. In this example we are naming our database “moodle153”.
* From the "Collation" drop down list select "utf8_unicode_ci"
 
[[image:Xampp11.gif]]


*Click the “Create” button to create the database.
*Click the “Create” button to create the database.


[[image:Xampp12.gif]]
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.


The new database should be present in the dropdown list when the page has refreshed.
===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';


[[image:Xampp13.gif]]
==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 the downloaded Moodle files to the correct location.===
===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. 


*Locate the file downloaded from Moodle.org and either copy or cut the file to the Windows clipboard.
*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.


*Open the XAMPP Control Panel and click on the “Explore” button.
===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".


[[image:Xampp15.gif]]
*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.


*A Windows Explorer view similar to the one below will be displayed.
:Another box will pop up. Select "Users" and give them "Modify" and "Write" permissions, along with whatever existed already.


[[image:Xampp16.gif]]
==Start of initial Moodle install==


*Open the “htdocs” folder.
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.


[[image:Xampp17.gif]]
Other pages in MoodleDocs describe the install process.  We will just cover the first few screens.


[[image:Xampp18.gif]]
===Go to moodle in web browser===
[[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>.


*Paste the file cut/copied earlier into this folder.
===Select language===
The initial install page will ask you to choose your preferred language.  
[[image:Xampp24.gif|thumb|center|150px|Select language]]


*Extract the Moodle files from the file downloaded earlier. A default folder named “moodle” is created with the Moodle files within.
*Click the “Next” button.


[[image:Xampp19.gif]]
===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. 


===Start the installation===
*Click the “Next” button to continue.


*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>.
===Paths for Moodle installation===
The paths for your Moodle installation are shown accept these or amend as desired.


[[image:Xampp23.gif]]


*The initial install page is displayed.
[[image:Xampp24.gif]]
*Choose your preferred language (English is used in this example) and click the “Next” button.
*A diagnostic report is displayed – hopefully it will look like this, if not you may need to address some issues.
[[image:Xampp25.gif]]


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


*The paths for your Moodle installation are shown – accept these or amend as desired.
===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.  


[[image:Xampp26.gif]]
*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_".


*Click the “Next” button to continue.
*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.


*In this screen we enter the database settings. The fields are populated with some suggested values.
:''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.  


[[image:Xampp27.gif]]
:''TIP:'' DO NOT USE THE “ROOT” USER WITHOUT A PASSWORD FOR PRODUCTION INSTALLATIONS AS THIS CREATES A SECURITY VULNERABILITY. 
[[image:Xampp28.gif|thumb|center|MySQL database settings screen]]


*In this example the database created is “moodle153”. The “root” user will be used without a password.
*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.


*DO NOT USE THE “ROOT” USER WITHOUT A PASSWORD FOR PRODUCTION INSTALLATIONS AS THIS CREATES A SECURITY VULNERABILITY
===Server check===
[[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.   
:'''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.


[[image:Xampp28.gif]]
===Moodle install confirmed===
Moodle will tell you it has install the basics.


*When the fields have been populated, click the “Next” button to continue.
[[image:Xampp29.gif|thumb|center|125px|Confirmed]]


*Provided the Moodle folder is writable a message confirming the configuration has been completed will be displayed.
*Click the “ Continue” button to proceed.


[[image:Xampp29.gif]]
===Moodle copyright & license===
The Moodle copyright / license notices are displayed.


*Click the “ Continue” button to proceed.
[[image:Xampp30.gif|thumb|center|Copyright & license]]


The Moodle copyright / licence notices are displayed.


[[image:Xampp30.gif]]
*Click the “Yes” button to continue.


*Click the “Yes” button to continue, then follow the instructions on the following screens.
===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===
==Troubleshooting==
====Skype====
===Bitnami===
*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 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===
*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.
* Locate the "Connection" options.
* Remove the tick / check from the Checkbox.
* 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.


[[Image: Skype1.gif]]
===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.


* Locate the "Connection" options.
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';


[[Image: Skype2.gif]]
Don't forget to save the file and restart Apache.


* Remove the tick / check from the Checkbox.
====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]


[[Image: Skype3.gif]]
====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.


* Click the "Save" button.
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.


* You may need to re-start your computer for this to take effect.
==See also==
*[[Windows installation]]
*[[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]]
*[[Installation Quickstart]] the short and simple install notes for experienced


====Still having problems but do not have Skype installed?====
[[sk:Moodle Windows Inštalácia pomocou XAMPP]]
* Check for another program which may be using port 80. IIS is commonly found to be the culprit.
[[de:Windows-Installation mit XAMPP]]


[[Category:Administrator]]
[[Category:Administrator]]
[[Category:Installation]]
[[Category:Installation]]

Latest revision as of 17:31, 26 February 2018

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 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, 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