<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/32/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Howardsmiller</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/32/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Howardsmiller"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/Special:Contributions/Howardsmiller"/>
	<updated>2026-04-18T11:43:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=MySQL_full_unicode_support&amp;diff=127457</id>
		<title>MySQL full unicode support</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=MySQL_full_unicode_support&amp;diff=127457"/>
		<updated>2017-04-26T10:01:31Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Steps to upgrade */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Environment}}&lt;br /&gt;
==UTF-8==&lt;br /&gt;
&lt;br /&gt;
UTF-8 is a character encoding that most websites use. It encodes each of the 1,112,064 valid code points. To store all of this information, four bytes is required. The most popular values are in the three byte region. MySQL by default only uses a three byte encoding and so values in the four byte range (eg. Asian characters and Emojis) can not be stored. Any attempt to enter a text that contains four byte characters will result in a Moodle database error.&lt;br /&gt;
&lt;br /&gt;
MySQL does provide full four byte UTF-8 support, but it requires certain database settings to be configured. From version 3.3 on Moodle uses full UTF-8 for both MySQL and MariaDB by default. Existing databases will still run with partial support, but it is recommended to move over to full support.&lt;br /&gt;
&lt;br /&gt;
Moodle comes with a Command Line Interface (CLI) script for converting to full UTF-8 for MySQL (and MariaDB). Before Moodle versions 3.1.5 and 3.2.2 this conversion tool would only change the Collation to some variant of &#039;utf8_bin&#039;. &#039;utf8_unicode_ci&#039; was the recommended Collation. We now recommend using &#039;utf8mb4_unicode_ci&#039; which supports four byte characters (utf8_unicode_ci only supports three).&lt;br /&gt;
&lt;br /&gt;
This script will attempt to change the database Collation, Character set, default table settings and column definitions.&lt;br /&gt;
&lt;br /&gt;
To summarise:&lt;br /&gt;
&lt;br /&gt;
* Fresh installs of Moodle 3.1.5 and 3.2.2 onwards will use utf8mb4 by default, if the database server is configured appropriately (see below).&lt;br /&gt;
* Sites upgrading to Moodle 3.1.5 or 3.2.2 can use the script to update to utf8mb4. In Moodle 3.3 a warning will show that the database isn&#039;t using full UTF-8 support and suggest moving to &#039;utf8mb4_unicode_ci&#039;, but you may choose to keep using &#039;utf8_*&#039;.&lt;br /&gt;
&lt;br /&gt;
===File format===&lt;br /&gt;
&lt;br /&gt;
To allow for large indexes on columns that are a varchar, a combination of settings needs to be set. The file format for the system needs to be using &amp;quot;Barracuda&amp;quot;. This allows for the row format to be set to &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot;. To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
===File per table===&lt;br /&gt;
&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
===Large prefix===&lt;br /&gt;
&lt;br /&gt;
This in conjunction with the row format being either &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot; allows for large varchar indexes above 191 characters.&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
==Steps to upgrade==&lt;br /&gt;
&lt;br /&gt;
Most important: Please backup your database before making any changes or running the CLI script.&lt;br /&gt;
&lt;br /&gt;
* Change configuration settings for MySQL (exactly the same for MariaDB). This step is optional. You can run the script and it will try and make these changes itself. If errors occur then try manually changing these settings as listed below.&lt;br /&gt;
** On Linux based systems you will want to alter my.cnf. This may be located in &#039;/etc/mysql/&#039;.&lt;br /&gt;
** Make the following alterations to my.cnf:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
[client]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&lt;br /&gt;
[mysqld]&lt;br /&gt;
innodb_file_format = Barracuda&lt;br /&gt;
innodb_file_per_table = 1&lt;br /&gt;
innodb_large_prefix&lt;br /&gt;
&lt;br /&gt;
character-set-client-handshake = FALSE&lt;br /&gt;
character-set-server = utf8mb4&lt;br /&gt;
collation-server = utf8mb4_unicode_ci&lt;br /&gt;
&lt;br /&gt;
[mysql]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* Restart your MySQL server.&lt;br /&gt;
* Run the CLI script to convert to the new Character set and Collation (requires Moodle 3.1.5, 3.2.2 or newer): &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: For large sites, this script will be slow. For very large sites it may take hours or even days! It is recommended to dump and reimport your data according to https://docs.moodle.org/32/en/Converting_your_MySQL_database_to_UTF8#Default_Mysql_character_set&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Adjust the $CFG-&amp;gt;dboptions Array in your &#039;&#039;&#039;config.php&#039;&#039;&#039; to make sure that Moodle uses the right Collation when connecting to the MySQL Server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dboptions = array(&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
  &#039;dbcollation&#039; =&amp;gt; &#039;utf8mb4_unicode_ci&#039;,&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Try adding some Emojis 🇦🇺👏🎓 to your Moodle site to verify that the upgrade was successful.&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|UTF-8]]&lt;br /&gt;
[[Category:UTF-8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:MySQL soporte unicode completo]]&lt;br /&gt;
[[fr:Support unicode complet pour MySQL]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Cron&amp;diff=127367</id>
		<title>Cron</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Cron&amp;diff=127367"/>
		<updated>2017-04-06T13:55:38Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* The web based Moodle cron command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
The Moodle &#039;cron&#039; process is a PHP script (part of the standard Moodle installation) that must be run regularly in the background.   The Moodle cron script runs different tasks at differently scheduled intervals.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: Do not skip setting up the cron process on your server for your Moodle. Your site will not work properly without it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is recommended that &#039;&#039;the cron is run every minute&#039;&#039;, as required for asynchronous activity deletion when using the [[Recycle bin|recycle bin]].&lt;br /&gt;
&lt;br /&gt;
The cron program (that runs the Moodle script) is a core part of Unix based systems (including Linux and OSX) being used to run all manner of time-dependent services. On Windows the simplest solution is to create a task in the Windows Task Scheduler and set it to run at regular intervals. On shared hosting, you should find the documentation (or ask support) how cron is configured. &lt;br /&gt;
&lt;br /&gt;
Essentially, the task involves adding a single command to the list of cron activities on your system. On Unix based systems this list is a file called a &#039;crontab&#039; which all users have.  &lt;br /&gt;
&lt;br /&gt;
== General discussion ==&lt;br /&gt;
&lt;br /&gt;
See the later sections for your server type; this section contains some general background information. &lt;br /&gt;
&lt;br /&gt;
There are essentially two steps to implementing cron:&lt;br /&gt;
# identifying the correct command to run&lt;br /&gt;
# finding the right place on your system to put the command&lt;br /&gt;
&lt;br /&gt;
=== Working out the Moodle cron command ===&lt;br /&gt;
&lt;br /&gt;
Moodle has two different ways to deploy cron which use different scripts within the Moodle install. These are as follows...&lt;br /&gt;
# The CLI (command line interpreter) script. This will be at the path &amp;lt;pre&amp;gt;/path/to/moodle/admin/cli/cron.php&amp;lt;/pre&amp;gt; If in doubt, this is the correct script to use. This needs to be run by a &#039;PHP CLI&#039; program on your computer. So the final command may look something like &amp;lt;pre&amp;gt;/usr/bin/php /path/to/moodle/admin/cli/cron.php&amp;lt;/pre&amp;gt; You can (and should) try this on your command line to see if it works. &#039;&#039;&#039;WARNING: Check your command-line PHP version is compatible with your chosen version of Moodle. The command-line PHP program is different to the one running your web site and is not always the same version.&#039;&#039;&#039;&lt;br /&gt;
# If, for some reason, you cannot run the CLI script there is the web based script. Note that this is now deprecated and may be removed in future versions. This needs to be run from a web browser and will be accessed via a web url something like &#039;&#039;&#039;http://your.moodle.site/admin/cron.php&#039;&#039;&#039;. You can find command line based web browser (e.g. wget) so the final command may look like &amp;lt;pre&amp;gt;/usr/bin/wget http://your.moodle.site/admin/cron.php&amp;lt;/pre&amp;gt; This has the advantage that it can be run from *anywhere*. If you can&#039;t get cron to work on your machine it can be run somewhere else.&lt;br /&gt;
&lt;br /&gt;
===The web based Moodle cron command===&lt;br /&gt;
* If you have a choice, do not use the web based cron. It is likely to be removed in a future Moodle version. &lt;br /&gt;
* From Moodle 2.9 onwards, the cron job can no longer be run from web by default. You will get an error message:&lt;br /&gt;
 !!! Sorry, internet access to this page has been disabled by the administrator. !!! &lt;br /&gt;
* You can change this in &#039; Dashboard ► Site administration ► Security ► Site policies &#039; by deselecting &#039;Cron execution via command line only&#039;.&lt;br /&gt;
** You will be warned that &#039;Running the cron from a web browser can expose privileged information to anonymous users. Thus it is recommended to only run the cron from the command line or set a cron password for remote access.&#039;&lt;br /&gt;
** You can then write a &#039;Cron password for remote access&#039;. If this field is left empty, no password is required.&lt;br /&gt;
** This means that the cron.php script cannot be run from a web browser without supplying the password using the following form of URL:&lt;br /&gt;
  http://site.example.com/admin/cron.php?password=opensesame&lt;br /&gt;
&lt;br /&gt;
=== Finding the right place to put the command ===&lt;br /&gt;
&lt;br /&gt;
This really does depend on the system you are using and you should find and read the documentation for your platform or hosting. In most cases getting the Moodle cron to run consists of establishing the correct command (above) and then adding it, and the time to run the command, to some sort of file. This might be either through a specific user interface or by editing the file directly.&lt;br /&gt;
&lt;br /&gt;
If using the CLI version you also need to make sure that the cron process is run as the correct user. This is not an issue with the web version. &lt;br /&gt;
&lt;br /&gt;
Example... installing cron on Ubuntu/Debian Linux. Assuming logged in as root..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;use the crontab command to open a crontab editor window for the www-data user. This is the user that Apache (the web server) runs as on Debian based systems&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ crontab -u www-data -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;This will open an editor window. To run the cli cron script every 1 minute, add the line:&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*/1 * * * * /usr/bin/php  /path/to/moodle/admin/cli/cron.php &amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE: the final &#039;&#039;&#039;&amp;gt;/dev/null&#039;&#039;&#039; sends all the output to the &#039;bin&#039; and stops you getting an email every 1 minute.&lt;br /&gt;
&lt;br /&gt;
== Setting up cron on your system ==&lt;br /&gt;
 &lt;br /&gt;
Choose the information for your server type:&lt;br /&gt;
&lt;br /&gt;
*[[Cron with Unix or Linux]]- Cron services on various UNIX and Linux flavored operating systems.&lt;br /&gt;
*[[Cron with Windows OS]] - Cron services in Windows&lt;br /&gt;
*&#039;&#039;Apple OSX&#039;&#039; - use the built-in &#039;crontab&#039; service which is exactly the same as [[Cron with Unix or Linux]]. However, you might want to do it the &#039;Apple way&#039; using launchd - see [[Cron with MAC OS X]]&lt;br /&gt;
*[[Cron with web hosting services]]- Cron services in various web hosting examples.&lt;br /&gt;
&lt;br /&gt;
Here are some more instructions for specific hosts (please check that these are up to date):&lt;br /&gt;
&lt;br /&gt;
*[[Cron on 1and1 shared servers]]&lt;br /&gt;
&lt;br /&gt;
== Using third party cron service ==&lt;br /&gt;
 &lt;br /&gt;
Besides using cron hosted on your own server, you may use third party cron service (usually called webcron):&lt;br /&gt;
&lt;br /&gt;
*[https://cron-job.org/ cron-job.org] is a free service. (1Minute cron is possible)&lt;br /&gt;
&lt;br /&gt;
*[https://www.easycron.com EasyCron] - A webcron service provider that eliminates the need of crontab or other task schedulers to set cron job.&lt;br /&gt;
&lt;br /&gt;
=== Cron settings in Moodle ===&lt;br /&gt;
&lt;br /&gt;
An admin can set cron execution via command line only or a cron password for remote access in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Remote cron===&lt;br /&gt;
Using the &#039;web based&#039; version of cron it is perfectly ok to place the cron process on a different machine to the Moodle server. For example, the cron service on a Unix server can invoke the cron web &#039;page&#039; on a Windows based Moodle server.&lt;br /&gt;
&lt;br /&gt;
==Scheduling tasks==&lt;br /&gt;
An administrator can schedule cron tasks very precisely from Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks, see [[Scheduled tasks]]&lt;br /&gt;
&lt;br /&gt;
==Running cron for several Moodle servers==&lt;br /&gt;
* Tasks can run in parallel and processes use locking to prevent tasks from running at the same time which allows cron to be triggered from multiple web servers that serve the same Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* If you are running different Moodle instances on the same server, then each Moodle instance needs a cron job. (Even a single Apache web server can run different Moodle instances on different domains by using its virtual hosts capability [https://httpd.apache.org/docs/2.2/vhosts/index.html https://httpd.apache.org/docs/2.2/vhosts/index.html].)&lt;br /&gt;
&lt;br /&gt;
== Debugging Scheduled Tasks ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, a particular cron task may not be working correctly. In Moodle versions before 2.7 - any cron task that was throwing exceptions would prevent the rest of cron from running. The only way to monitor if cron was completing each time, was to add some automated checking of the output of running cron (e.g. searching for the string &amp;quot;Cron completed at &amp;quot;).&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.7 and later, a single failing scheduled task will not prevent the remaining tasks from completing. When any single scheduled task fails, it is marked as a failure, and scheduled to be reattempted. If the task keeps failing, the next scheduled time will be backed off until it is attempted at most once every 24 hours. But checking the [[Scheduled tasks]] admin page, you can see if any task is currently failing (it will have a non-zero fail delay - which is the number of seconds to wait before reattempting a failed task). A simple way to debug a failing task, is to run it immediately using the [[Administration via command line#Scheduled_tasks|cli scheduled task runner]] and monitor the output.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Scheduled tasks]]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Cron Wikipedia article on cron function]&lt;br /&gt;
&lt;br /&gt;
Forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=139263#p609060 How to log the output of a Scheduled Task on Windows] - this discussion explains a nice trick that can be very useful when you are experiencing problems with your Windows Scheduled Task and you need to log the output of the Scheduled Task to a log file.&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=324443 Cron Lock] &lt;br /&gt;
&lt;br /&gt;
[[es:Cron]]&lt;br /&gt;
[[fr:Cron]]&lt;br /&gt;
[[ja:Cron]]&lt;br /&gt;
[[de:Cron-Job]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Cron&amp;diff=127366</id>
		<title>Cron</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Cron&amp;diff=127366"/>
		<updated>2017-04-06T13:54:54Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Working out the Moodle cron command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
The Moodle &#039;cron&#039; process is a PHP script (part of the standard Moodle installation) that must be run regularly in the background.   The Moodle cron script runs different tasks at differently scheduled intervals.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: Do not skip setting up the cron process on your server for your Moodle. Your site will not work properly without it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is recommended that &#039;&#039;the cron is run every minute&#039;&#039;, as required for asynchronous activity deletion when using the [[Recycle bin|recycle bin]].&lt;br /&gt;
&lt;br /&gt;
The cron program (that runs the Moodle script) is a core part of Unix based systems (including Linux and OSX) being used to run all manner of time-dependent services. On Windows the simplest solution is to create a task in the Windows Task Scheduler and set it to run at regular intervals. On shared hosting, you should find the documentation (or ask support) how cron is configured. &lt;br /&gt;
&lt;br /&gt;
Essentially, the task involves adding a single command to the list of cron activities on your system. On Unix based systems this list is a file called a &#039;crontab&#039; which all users have.  &lt;br /&gt;
&lt;br /&gt;
== General discussion ==&lt;br /&gt;
&lt;br /&gt;
See the later sections for your server type; this section contains some general background information. &lt;br /&gt;
&lt;br /&gt;
There are essentially two steps to implementing cron:&lt;br /&gt;
# identifying the correct command to run&lt;br /&gt;
# finding the right place on your system to put the command&lt;br /&gt;
&lt;br /&gt;
=== Working out the Moodle cron command ===&lt;br /&gt;
&lt;br /&gt;
Moodle has two different ways to deploy cron which use different scripts within the Moodle install. These are as follows...&lt;br /&gt;
# The CLI (command line interpreter) script. This will be at the path &amp;lt;pre&amp;gt;/path/to/moodle/admin/cli/cron.php&amp;lt;/pre&amp;gt; If in doubt, this is the correct script to use. This needs to be run by a &#039;PHP CLI&#039; program on your computer. So the final command may look something like &amp;lt;pre&amp;gt;/usr/bin/php /path/to/moodle/admin/cli/cron.php&amp;lt;/pre&amp;gt; You can (and should) try this on your command line to see if it works. &#039;&#039;&#039;WARNING: Check your command-line PHP version is compatible with your chosen version of Moodle. The command-line PHP program is different to the one running your web site and is not always the same version.&#039;&#039;&#039;&lt;br /&gt;
# If, for some reason, you cannot run the CLI script there is the web based script. Note that this is now deprecated and may be removed in future versions. This needs to be run from a web browser and will be accessed via a web url something like &#039;&#039;&#039;http://your.moodle.site/admin/cron.php&#039;&#039;&#039;. You can find command line based web browser (e.g. wget) so the final command may look like &amp;lt;pre&amp;gt;/usr/bin/wget http://your.moodle.site/admin/cron.php&amp;lt;/pre&amp;gt; This has the advantage that it can be run from *anywhere*. If you can&#039;t get cron to work on your machine it can be run somewhere else.&lt;br /&gt;
&lt;br /&gt;
===The web based Moodle cron command===&lt;br /&gt;
* From Moodle 2.9 onwards, the cron job can no longer be run from web by default. You will get an error message:&lt;br /&gt;
 !!! Sorry, internet access to this page has been disabled by the administrator. !!! &lt;br /&gt;
* You can change this in &#039; Dashboard ► Site administration ► Security ► Site policies &#039; by deselecting &#039;Cron execution via command line only&#039;.&lt;br /&gt;
** You will be warned that &#039;Running the cron from a web browser can expose privileged information to anonymous users. Thus it is recommended to only run the cron from the command line or set a cron password for remote access.&#039;&lt;br /&gt;
** You can then write a &#039;Cron password for remote access&#039;. If this field is left empty, no password is required.&lt;br /&gt;
** This means that the cron.php script cannot be run from a web browser without supplying the password using the following form of URL:&lt;br /&gt;
  http://site.example.com/admin/cron.php?password=opensesame&lt;br /&gt;
&lt;br /&gt;
=== Finding the right place to put the command ===&lt;br /&gt;
&lt;br /&gt;
This really does depend on the system you are using and you should find and read the documentation for your platform or hosting. In most cases getting the Moodle cron to run consists of establishing the correct command (above) and then adding it, and the time to run the command, to some sort of file. This might be either through a specific user interface or by editing the file directly.&lt;br /&gt;
&lt;br /&gt;
If using the CLI version you also need to make sure that the cron process is run as the correct user. This is not an issue with the web version. &lt;br /&gt;
&lt;br /&gt;
Example... installing cron on Ubuntu/Debian Linux. Assuming logged in as root..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;use the crontab command to open a crontab editor window for the www-data user. This is the user that Apache (the web server) runs as on Debian based systems&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ crontab -u www-data -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;This will open an editor window. To run the cli cron script every 1 minute, add the line:&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*/1 * * * * /usr/bin/php  /path/to/moodle/admin/cli/cron.php &amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE: the final &#039;&#039;&#039;&amp;gt;/dev/null&#039;&#039;&#039; sends all the output to the &#039;bin&#039; and stops you getting an email every 1 minute.&lt;br /&gt;
&lt;br /&gt;
== Setting up cron on your system ==&lt;br /&gt;
 &lt;br /&gt;
Choose the information for your server type:&lt;br /&gt;
&lt;br /&gt;
*[[Cron with Unix or Linux]]- Cron services on various UNIX and Linux flavored operating systems.&lt;br /&gt;
*[[Cron with Windows OS]] - Cron services in Windows&lt;br /&gt;
*&#039;&#039;Apple OSX&#039;&#039; - use the built-in &#039;crontab&#039; service which is exactly the same as [[Cron with Unix or Linux]]. However, you might want to do it the &#039;Apple way&#039; using launchd - see [[Cron with MAC OS X]]&lt;br /&gt;
*[[Cron with web hosting services]]- Cron services in various web hosting examples.&lt;br /&gt;
&lt;br /&gt;
Here are some more instructions for specific hosts (please check that these are up to date):&lt;br /&gt;
&lt;br /&gt;
*[[Cron on 1and1 shared servers]]&lt;br /&gt;
&lt;br /&gt;
== Using third party cron service ==&lt;br /&gt;
 &lt;br /&gt;
Besides using cron hosted on your own server, you may use third party cron service (usually called webcron):&lt;br /&gt;
&lt;br /&gt;
*[https://cron-job.org/ cron-job.org] is a free service. (1Minute cron is possible)&lt;br /&gt;
&lt;br /&gt;
*[https://www.easycron.com EasyCron] - A webcron service provider that eliminates the need of crontab or other task schedulers to set cron job.&lt;br /&gt;
&lt;br /&gt;
=== Cron settings in Moodle ===&lt;br /&gt;
&lt;br /&gt;
An admin can set cron execution via command line only or a cron password for remote access in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Remote cron===&lt;br /&gt;
Using the &#039;web based&#039; version of cron it is perfectly ok to place the cron process on a different machine to the Moodle server. For example, the cron service on a Unix server can invoke the cron web &#039;page&#039; on a Windows based Moodle server.&lt;br /&gt;
&lt;br /&gt;
==Scheduling tasks==&lt;br /&gt;
An administrator can schedule cron tasks very precisely from Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks, see [[Scheduled tasks]]&lt;br /&gt;
&lt;br /&gt;
==Running cron for several Moodle servers==&lt;br /&gt;
* Tasks can run in parallel and processes use locking to prevent tasks from running at the same time which allows cron to be triggered from multiple web servers that serve the same Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* If you are running different Moodle instances on the same server, then each Moodle instance needs a cron job. (Even a single Apache web server can run different Moodle instances on different domains by using its virtual hosts capability [https://httpd.apache.org/docs/2.2/vhosts/index.html https://httpd.apache.org/docs/2.2/vhosts/index.html].)&lt;br /&gt;
&lt;br /&gt;
== Debugging Scheduled Tasks ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, a particular cron task may not be working correctly. In Moodle versions before 2.7 - any cron task that was throwing exceptions would prevent the rest of cron from running. The only way to monitor if cron was completing each time, was to add some automated checking of the output of running cron (e.g. searching for the string &amp;quot;Cron completed at &amp;quot;).&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.7 and later, a single failing scheduled task will not prevent the remaining tasks from completing. When any single scheduled task fails, it is marked as a failure, and scheduled to be reattempted. If the task keeps failing, the next scheduled time will be backed off until it is attempted at most once every 24 hours. But checking the [[Scheduled tasks]] admin page, you can see if any task is currently failing (it will have a non-zero fail delay - which is the number of seconds to wait before reattempting a failed task). A simple way to debug a failing task, is to run it immediately using the [[Administration via command line#Scheduled_tasks|cli scheduled task runner]] and monitor the output.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Scheduled tasks]]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Cron Wikipedia article on cron function]&lt;br /&gt;
&lt;br /&gt;
Forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=139263#p609060 How to log the output of a Scheduled Task on Windows] - this discussion explains a nice trick that can be very useful when you are experiencing problems with your Windows Scheduled Task and you need to log the output of the Scheduled Task to a log file.&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=324443 Cron Lock] &lt;br /&gt;
&lt;br /&gt;
[[es:Cron]]&lt;br /&gt;
[[fr:Cron]]&lt;br /&gt;
[[ja:Cron]]&lt;br /&gt;
[[de:Cron-Job]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Upload_users&amp;diff=127132</id>
		<title>Upload users</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Upload_users&amp;diff=127132"/>
		<updated>2017-03-16T14:30:36Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Hints */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Accounts}}&lt;br /&gt;
==Uploading users via text file==&lt;br /&gt;
&lt;br /&gt;
There are many options for uploading information (fields associated with a user) with this method: from enrolling users in multiple courses with course specific [[Roles|roles]] to updating user information in the [[User profile]] to deleting users from the site.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Tip:&#039;&#039; It is usually not necessary to upload users in bulk with Upload users. To keep maintenance work down you should first explore forms of authentication that do not require manual maintenance, such as [[External database authentication|connecting to existing external databases]] or letting the users create their own accounts ([[Self enrolment]]). See [[Authentication]] for more information.&lt;br /&gt;
&lt;br /&gt;
==File formats for upload users file==&lt;br /&gt;
The upload users file has fields separated by a comma (or other delimiter) ONLY - no space.   The first line contains the valid field names.  The rest of the lines (records) contain information about each user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Tip:&#039;&#039; Avoid special characters in field information like quotes or other commas. Test a file with only one record before a large upload.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Tip:&#039;&#039; You can use a spread sheet program to create the file with the required columns and fields. Then save the file as &amp;quot;CSV (comma delimited)&amp;quot;. These files can be opened with simple text editors (eg, [https://notepad-plus-plus.org/ Notepad++]) for verification. &lt;br /&gt;
&lt;br /&gt;
===Valid upload file for testing===&lt;br /&gt;
Here is an example of a simple valid upload file:&lt;br /&gt;
(Column headers on the first line of the file are only highlighted in bold in this example to distinguish it from the rest of the of the data/user details)&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;username,password,firstname,lastname,email,course1,group1,cohort1&#039;&#039;&#039;&lt;br /&gt;
 jonest,verysecret,Tom,Jones,jonest@someplace.edu,math102,Section 1,year 3&lt;br /&gt;
 reznort,somesecret,Trent,Reznor,reznort@someplace.edu,math102,Section 3,year 4&lt;br /&gt;
&lt;br /&gt;
===Fields that can be included===&lt;br /&gt;
&#039;&#039;Tip:&#039;&#039; We strongly recommend that you test a file that contains fields you proposed to use with one user before attempting a file upload for the first time. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Required fields&#039;&#039;&#039;: &lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;username,firstname,lastname,email&amp;lt;/code&amp;gt;&lt;br /&gt;
:Validity checks are performed for:&lt;br /&gt;
#&amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; can only contain alphabetical &#039;&#039;&#039;lowercase&#039;&#039;&#039; letters , numbers, hypen &#039;-&#039;, underscore &#039;_&#039;, period &#039;.&#039;, or at-sign &#039;@&#039; &lt;br /&gt;
#&amp;lt;code&amp;gt;email&amp;lt;/code&amp;gt; is in the form: &#039;&#039;name@example.com&#039;&#039; .&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Password field&#039;&#039;&#039;: &amp;quot;password&amp;quot; field is optional if &amp;quot;Create password if needed&amp;quot; setting is chosen (default). &lt;br /&gt;
**If included, values should meet the requirements for the site&#039;s [[Site_policies#Password_policy|Password policy]]. To force password change for a particular user, set the password field to &amp;lt;code&amp;gt;changeme&amp;lt;/code&amp;gt;. &lt;br /&gt;
**If omitted, a password will be generated for each user (during the next Cron job) and welcome e-mails sent out.&lt;br /&gt;
**Note: the text for the welcome e-mail is in the language settings. Please refer to this [https://moodle.org/mod/forum/discuss.php?d=210359&amp;amp;parent=917138 forum thread]for details.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Optional fields&#039;&#039;&#039;: To provide values other than the default include one or more of these&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;institution,department,city,country,lang,auth,timezone,idnumber,icq,phone1,phone2,address,url,description,mailformat,maildisplay,htmleditor,autosubscribe&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Additional name fields]]&#039;&#039;&#039;&lt;br /&gt;
*Country- use a country TWO LETTER CODE&lt;br /&gt;
* The auth field must be used if the site uses an alternative authentication method, such as LDAP, as otherwise the authentication method will default to manual and users using a different auth method won&#039;t be able to log in.&lt;br /&gt;
*Some fields have a maximum number of characters that are allowed (notably institution should be &#039;&#039;&#039;at most 40 characters&#039;&#039;&#039; long).  See hints below.&lt;br /&gt;
*Maildisplay, htmleditor and autosubscribe can be set from an import screen.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Custom profile field names&#039;&#039;&#039;: (Optional). xxxxx is the real custom user profile field name (i.e. the unique shortname)&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;profile_field_xxxxx&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
: Create the custom fields BEFORE importing. Use the standard header. The &amp;quot;shortname&amp;quot; for your custom field is xxxxx (NB the shortname must be all lowercase, otherwise won&#039;t be recognised). The first record must include &amp;quot;profile_field_xxxxx&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
:&#039;&#039;&#039;Example&#039;&#039;&#039;: To create a custom field &amp;quot;genre&amp;quot;, you must write a shortname &amp;quot;genre&amp;quot; in the new field, and write &amp;quot;profile_field_genre&amp;quot; in the header of the .csv file.&lt;br /&gt;
&lt;br /&gt;
: For custom profile fields that are a menu, use the corresponding value.&lt;br /&gt;
&lt;br /&gt;
For custom profile fields that are dates, use the ISO standard format YYYY-MM-DD, eg. 2014-06-19 which will then be properly localized in the interfaced.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Example&#039;&#039;&#039;: A custom field &#039;Department&#039; with one of three values &#039;HR&#039;, &#039;Marketing&#039; or &#039;Training&#039;. Just insert one of those three words (e.g. &#039;Training&#039;) as the value for that field. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Special fields&#039;&#039;&#039;: Used for changing of usernames or deleting of users&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;oldusername&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;suspended&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
*&#039;&#039;&#039;Enrolment fields&#039;&#039;&#039;: (Optional):&lt;br /&gt;
:&amp;lt;code&amp;gt;course1,type1,role1,group1,enrolperiod1,enrolstatus1,course2,type2,role2,group2,enrolperiod2,enrolstatus2&amp;lt;/code&amp;gt; etc.&lt;br /&gt;
&lt;br /&gt;
:* Header fields must have a numeric suffix such that &amp;lt;code&amp;gt;type1&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;role1&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;group1&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;enrolperiod1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;enrolstatus1&amp;lt;/code&amp;gt; all apply to &amp;lt;code&amp;gt;course1&amp;lt;/code&amp;gt; for course&amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; to course&amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
:*&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; is the &amp;quot;shortname&amp;quot; of the course, if present the user will be enrolled in that course.&lt;br /&gt;
:* &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; sets the role to be used for the enrolment. A value of &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; is default course role, &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;  is legacy Teacher role and &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; is legacy Non-editing Teacher.&lt;br /&gt;
:* &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt; may be used to specify roles directly, using either role short name or id (numeric names of roles are not supported).&lt;br /&gt;
:* &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; may be used to assign users to groups in course, using name or id (numeric group names are not supported)&lt;br /&gt;
:* &amp;lt;code&amp;gt;enrolperiod&amp;lt;/code&amp;gt; may be used to set the enrolment duration, in days, for each course.&lt;br /&gt;
:* &amp;lt;code&amp;gt;enrolstatus&amp;lt;/code&amp;gt; can suspend users from a course when set to 1 or left blank for enrolled. If a user is previously set as inactive / suspended then a value of 0 will unsuspend them.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Cohort field&#039;&#039;&#039;: (Optional):&lt;br /&gt;
:&amp;lt;code&amp;gt;cohort1&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
:Internal cohort id numbers or non-numeric Cohort IDs of existing cohorts must be used; names are not allowed.&lt;br /&gt;
*&#039;&#039;&#039;mnethostid&#039;&#039;&#039; (Optional)&lt;br /&gt;
&lt;br /&gt;
Existing [[MNet]]users can be added to courses, groups or cohorts as below:&lt;br /&gt;
#enrolling to courses: username+mnethostid+course required&lt;br /&gt;
# adding to group: username+mnethostid+course+group required&lt;br /&gt;
#adding to cohort: username+mnethostid+cohort required&lt;br /&gt;
#suspending/reviving accounts: username+mnethostid+suspended required&lt;br /&gt;
All other operations are ignored. You can not add users, delete them or update them (such as change names or email, profile fields, etc.)&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;System role&#039;&#039;&#039; (Optional)&lt;br /&gt;
:&amp;lt;code&amp;gt;sysrole1,sysrole2,sysrole3&amp;lt;/code&amp;gt; etc&lt;br /&gt;
Users may be uploaded to a system role (usually Manager or Course creator)  by entering the shortname of that role. Other roles can only be uploaded if they have already been assigned in the &#039;system&#039; context. See [[Creating custom roles]]. Multiple roles can be assigned using &amp;lt;code&amp;gt;sysrole2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sysrole3&amp;lt;/code&amp;gt;, etc. fields. Note that the number suffix in no way relates to the number suffixes on the enrolment fields. The numbers must go up in sequence starting at 1.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Unassigning roles&#039;&#039;&#039;&lt;br /&gt;
Users can also be removed from a given system role by entering the shortname of that role prefixed with a minus symbol: &#039;-&#039;. If the user is currently assigned to that role, they are removed from it. If the user is not currently assigned to that system role, the field value is ignored. However, the field value must refer to a system role that does exist on the system, otherwise an error will occur.&lt;br /&gt;
[[File:GlobalRoles1.png|thumb|500px|center|Example of a file for uploading users with global/system roles]]&lt;br /&gt;
&lt;br /&gt;
Commas within  a field must be encoded as &amp;amp;#44 - the script will decode these back to commas.&lt;br /&gt;
&lt;br /&gt;
For Boolean fields, use &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for false and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for true.&lt;br /&gt;
&lt;br /&gt;
To prevent users from receiving a large number of emails from courses or forced subscription forums use the &#039;&#039;&#039;maildigest&#039;&#039;&#039;.  The options for this field are 0 = No digest, 1 = Complete digest and 2 = Digest with just subjects.&lt;br /&gt;
==Upload user process==&lt;br /&gt;
&lt;br /&gt;
# Create file for uploading&lt;br /&gt;
# Go to &#039;&#039;Site administration &amp;gt; Users &amp;gt; Accounts &amp;gt; Upload users&#039;&#039;&lt;br /&gt;
# Add file to upload&lt;br /&gt;
# Upload users preview - check settings and default user profile settings&lt;br /&gt;
# Upload users preview - click &amp;quot;Upload users&amp;quot;&lt;br /&gt;
# Upload users results - shows list of users, exceptions made in upload and summary of number of users&lt;br /&gt;
# Upload users results - click &amp;quot;Continue&amp;quot;&lt;br /&gt;
# Returns to Upload users screen&lt;br /&gt;
&lt;br /&gt;
==Updating users preview==&lt;br /&gt;
There are various settings to better control the desired upload behaviour. These settings are found on the &amp;quot;Upload users preview&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: errors updating existing accounts can affect your users badly. &#039;&#039;&#039;&#039;&#039;Be careful&#039;&#039;&#039;&#039;&#039; when using the options to update.&lt;br /&gt;
&lt;br /&gt;
====Upload type====&lt;br /&gt;
The Upload type specifies how to handle existing accounts.&lt;br /&gt;
;Add new only, skip existing users : is the default Moodle upload type. It creates a new user account for each new record in the uploaded file. If an existing &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is found (i.e., the &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; in the uploaded file matches an existing &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt;, that record is &#039;&#039;&#039;skipped&#039;&#039;&#039;. By skipping the existing user account, the data in the existing record is not touched (in contrast to the &amp;quot;Add new and update existing users&amp;quot; option) and a second new user account is &#039;&#039;&#039;not&#039;&#039;&#039; created (in contrast to the &amp;quot;Add all, append number to usernames if needed&amp;quot; option). &lt;br /&gt;
;Add all, append number to usernames if needed : creates a new user account for each record in the uploaded file. If an existing user account is found, a new account will be created with a number appended to the &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt;. For example, if a user account for &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; &#039;jsmith&#039; already exists and a new record in the uploaded file contains a record for &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; &#039;jsmith&#039; an additional user account is created with a 1 &#039;&#039;&#039;appended&#039;&#039;&#039; to the &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; to produce user &#039;jsmith1&#039;. &lt;br /&gt;
;Add  new and update existing users : creates a new user account for each new user in the upload file. If an existing user account with the same &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is found, the account information is &#039;&#039;&#039;updated&#039;&#039;&#039; by the data in the uploaded file. &lt;br /&gt;
;Update existing users only : ignores any new users found in the upload file and updates the user account if a matching &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; record is found in the uploaded file.&lt;br /&gt;
&lt;br /&gt;
====New user password====&lt;br /&gt;
When creating a new user account Moodle can create a new password (if one is not provided) or require a password in the uploaded file.&lt;br /&gt;
;Create password if needed : creates a default password for the new user account if one is not provided in the uploaded file.&lt;br /&gt;
;Field required in file : requires that a password be provided in the uploaded file in order. If a password is not provided, an error is generated and the user account is not created.&lt;br /&gt;
&lt;br /&gt;
====Existing user details====&lt;br /&gt;
The Existing user details options are only available when the Upload type allows existing user accounts to be updated. It specifies how Moodle should process user detail information for existing users.&lt;br /&gt;
;No changes : ignores user detail data in the uploaded and leaves the existing user account data unchanged.&lt;br /&gt;
;Override with file : overwrites data in the existing user account with the data provided in the uploaded file.&lt;br /&gt;
;Override with file and defaults : overwrites data in the existing user account with data provided in the uploaded file and fills in the default values for existing user details when no data is provided in the uploaded file.&lt;br /&gt;
;Fill in missing from file and defaults : adds data in the existing user account with data provided in the uploaded file if the field is empty (does not already contain data) and fills in the default values for existing user details when no data is provided in the uploaded file.&lt;br /&gt;
&lt;br /&gt;
====Existing user password====&lt;br /&gt;
The Existing user password option specifies how to handle password data for existing user accounts when Existing user details is set to overwrite data.&lt;br /&gt;
;No changes : ignores password field in the uploaded user file and leaves the existing user account password untouched&lt;br /&gt;
;Update : overwrites the existing user account password with the password provided in the uploaded file&lt;br /&gt;
&lt;br /&gt;
====Force password change====&lt;br /&gt;
The Force password change option specifies when to tag a user account so that the next login attempt will require the user to change the user&#039;s password.&lt;br /&gt;
;Users having a weak password : If the user account has a weak password as defined by the stie&#039;s [[Password_policy#Password_policy|Password policy]] then the user will be forced to change the password during the next login attempt. This option is not shown if there the site does not have a [[Password_policy#Password_policy|Password policy]], in other words &amp;lt;code&amp;gt;$CFG-&amp;gt;passwordpolicy&amp;lt;/code&amp;gt; must be set to see this option. &lt;br /&gt;
;None : None of the users in the uploaded file will be forced to change the password during the user&#039;s next login attempt.&lt;br /&gt;
;All : All of the users in the uploaded file will be forced to change the password during the user&#039;s next login attempt.&lt;br /&gt;
&lt;br /&gt;
====Allow renames====&lt;br /&gt;
If the uploaded flie contains the special &amp;lt;code&amp;gt;oldusername&amp;lt;/code&amp;gt; field, it is possible to rename a user from the &amp;lt;code&amp;gt;oldusername&amp;lt;/code&amp;gt; to a new &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt;. The default setting is to &#039;&#039;&#039;not&#039;&#039;&#039; allow renames. Keep in mind that renaming a user will require the user to use the new username when logging in.&lt;br /&gt;
;No : ignores the &amp;lt;code&amp;gt;oldusername&amp;lt;/code&amp;gt; field and leaves the existing user account&#039;s &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; field unchanged.&lt;br /&gt;
;Yes : allows the existing user account&#039;s &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; to be changed by the data provided in the uploaded file&#039;s &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; field. The &amp;lt;code&amp;gt;oldusername&amp;lt;/code&amp;gt; will be searched for and then updated with the data provided in the &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; column. &lt;br /&gt;
&lt;br /&gt;
====Allow deletes====&lt;br /&gt;
If the uploaded file contains the &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt; special field, it is possible to use the upload file to delete existing user accounts. The default setting is to &#039;&#039;&#039;not&#039;&#039;&#039; allow deletes. Keep in mind that deleting a user account will prevent that user from logging in. As a protection, site administrator user accounts cannot be deleted with this method. &lt;br /&gt;
;No : ignores the &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt; special field in the uploaded file and leaves the existing user account unchanged&lt;br /&gt;
;Yes : allows the existing user account to be deleted when the value of the of the &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt; field is 1. &lt;br /&gt;
&lt;br /&gt;
====Allow suspending and activating of accounts====&lt;br /&gt;
If the uploaded file contains the &amp;lt;code&amp;gt;suspended&amp;lt;/code&amp;gt; special field, it is possible to use the upload file to either suspend or make active (unsuspend) existing user accounts. The default setting is to allow suspending/activating of existing user accounts. Keep in mind that suspending an existing user account will prevent that user from logging in. &lt;br /&gt;
;Yes : allows the existing user account to be suspended when the value of the of the &amp;lt;code&amp;gt;suspended&amp;lt;/code&amp;gt; field is 1. &lt;br /&gt;
;No : ignores the &amp;lt;code&amp;gt;suspended&amp;lt;/code&amp;gt; special field in the uploaded file and leaves the existing user account status unchanged.&lt;br /&gt;
&lt;br /&gt;
====Prevent email address duplicates====&lt;br /&gt;
It is possible, but &#039;&#039;&#039;not&#039;&#039;&#039; recommended to upload users with duplicate email addresses. By default, uploading users with duplicate email addresses is prevented. See MDL-38104 for some discussion. Further, since MDL-41115 added the ability for users to login with their email address it is even more important that duplicate email addresses be avoided.&lt;br /&gt;
&lt;br /&gt;
To allow duplicate email addresses, go to Site administration ► Plugins ► Authentication ► Manage authentication. You can tick &amp;quot;Allow accounts with same email&amp;quot;. Then on the upload users screen you will be allowed to change the &amp;quot;Prevent email address duplicates&amp;quot; setting. However, doing this is not recommended. For more info, see the [[Managing_authentication#Allow_accounts_with_same_email|Managing authentication]] docs page&lt;br /&gt;
;Yes : prevents user accounts from being created from the uploaded if an existing user account already has the same email address as found in the uploaded file&#039;s  &amp;lt;code&amp;gt;email&amp;lt;/code&amp;gt; column.&lt;br /&gt;
;No : allows user accounts to be created if an existing user account already has the same email address found in the uploaded file&#039;s  &amp;lt;code&amp;gt;email&amp;lt;/code&amp;gt; column.&lt;br /&gt;
&lt;br /&gt;
====Standardise usernames====&lt;br /&gt;
Standardise usernames is used by default to convert the username to all lower case and to strip out illegal characters. It is possible to not standardise the usernames; however, doing so is &#039;&#039;&#039;not&#039;&#039;&#039; recommended.&lt;br /&gt;
;Yes : standardises usernames found in the uploaded file before updating existing or creating new user accounts so that the username contains only lowercase letters and numbers.&lt;br /&gt;
;No : skips standardising usernames found in the uploaded file so that the newly created or updated usernames will be exactly as they are in the uploaded file (&#039;&#039;&#039;not recommended&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
For those seeking a more technical explanation, the process for standardising the usernames consists of ensuring the characters are all UTF-8 (fix_utf8) encoded, converting the username to lower case, and then stripping out non-letters/non-number characters (unless &#039;&#039;Site administration &amp;gt; Security &amp;gt; Site policies &amp;gt; Allow extended characters in usernames&#039;&#039; is set on) with something similar to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$username = preg_replace(&#039;/[^-\.@_a-z0-9]/&#039;, &#039;&#039;, $username);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Select for bulk user actions====&lt;br /&gt;
After the uploaded file has finished being processed (all new accounts have been created and existing accounts updated as specified by the previous settings), there is an option to select some of those user accounts to perform additional [[admin/user/user_bulk|bulk user actions]] such as &lt;br /&gt;
*Confirm user accounts created through Email-based self-registration which are not yet confirmed by the user&lt;br /&gt;
*Send a message (requires Messaging to be enabled)&lt;br /&gt;
*Delete user accounts&lt;br /&gt;
*Display a list of users on a page&lt;br /&gt;
*Download user data in text, ODS or Excel file format&lt;br /&gt;
*Force users to change their passwords&lt;br /&gt;
*Add users to a cohort&lt;br /&gt;
&lt;br /&gt;
By default, no users are selected for [[admin/user/user_bulk|bulk user actions]].&lt;br /&gt;
&lt;br /&gt;
;No : No users are selected for [[admin/user/user_bulk|bulk user actions]]&lt;br /&gt;
;New users : Only newly created users are selected for [[admin/user/user_bulk|bulk user actions]]&lt;br /&gt;
;Updated users : Only updated user accounts are selected for [[admin/user/user_bulk|bulk user actions]]&lt;br /&gt;
;All users : All users found (existing updated users and newly created user accounts) in the uploaded file are selected for [[admin/user/user_bulk|bulk user actions]]&lt;br /&gt;
&lt;br /&gt;
===Default values===&lt;br /&gt;
&lt;br /&gt;
You can provide default user values for some fields not included in the uploaded file. Some fields include:&lt;br /&gt;
*Email display&lt;br /&gt;
*Forum auto-subscribe&lt;br /&gt;
*City/town&lt;br /&gt;
*ID number&lt;br /&gt;
*Institution&lt;br /&gt;
*Department&lt;br /&gt;
&lt;br /&gt;
==Upload user results ==&lt;br /&gt;
After accepting the preview settings by clicking on &amp;quot;Upload users&amp;quot;, you should see the the Upload users results screen.&lt;br /&gt;
[[File:Upload users results 2.0.JPG|thumb|center|The results screen; everything went well!]]&lt;br /&gt;
This screen will show you any exceptions or changes that were made to each user in the upload process.   For example if you were updating user information, the updated information will be shown.  Or if a user was not added that record will be highlighted.&lt;br /&gt;
&lt;br /&gt;
The screen will summarize how many users were uploaded or updated, indicate the number of weak passwords and the number of errors.&lt;br /&gt;
&lt;br /&gt;
==Advanced potentials of Upload user==&lt;br /&gt;
===Templates===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: This section needs checking and updating if necessary for Moodle 2.0. Please do so and remove this note when finished.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The default values are processed as templates in which the following codes are allowed:&lt;br /&gt;
&lt;br /&gt;
* %l - will be replaced by the lastname&lt;br /&gt;
* %f - will be replaced by the firstname&lt;br /&gt;
* %u - will be replaced by the username&lt;br /&gt;
* %% - will be replaced by the %&lt;br /&gt;
&lt;br /&gt;
Between the percent sign (%) and any code letter (l, f or u) the following modifiers are allowed:&lt;br /&gt;
&lt;br /&gt;
* (-) minus sign - the information specified by the code letter will be converted to lowercase&lt;br /&gt;
* (+) plus sign - the information specified by the code letter will be converted to UPPERCASE&lt;br /&gt;
* (~) tilde sign - the information specified by the code letter will be converted to Title Case&lt;br /&gt;
* a decimal number - the information specified by the code letter will be truncated to that many characters&lt;br /&gt;
&lt;br /&gt;
For example, if the firstname is John and the lastname is Doe, the following values will be obtained with the specified templates:&lt;br /&gt;
&lt;br /&gt;
* %l%f = DoeJohn&lt;br /&gt;
* %l%1f = DoeJ&lt;br /&gt;
* %-l%+f = doeJOHN&lt;br /&gt;
* %-f_%-l = john_doe&lt;br /&gt;
*&amp;lt;nowiki&amp;gt; http://www.example.com/~%u/&amp;lt;/nowiki&amp;gt; results in  &amp;lt;nowiki&amp;gt;http://www.example.com/~jdoe/&amp;lt;/nowiki&amp;gt; (if the username is jdoe or %-1f%-l)&lt;br /&gt;
&lt;br /&gt;
Template processing is done only on default values, and not on the values retrieved from the CSV file.&lt;br /&gt;
&lt;br /&gt;
In order to create correct Moodle usernames, the username is always converted to lowercase. Moreover, if the &amp;quot;Allow extended characters in usernames&amp;quot; option in the Site policies page is off, characters different to letters, digits, dash (-) and dot (.) are removed. For example if the firstname is John Jr. and the lastname is Doe, the username %-f_%-l will produce john jr._doe when Allow extended characters in usernames is on, and johnjr.doe when off.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;New username duplicate handling&amp;quot; setting is set to Append counter, an auto-increment counter will be append to duplicate usernames produced by the template. For example, if the CSV file contains the users named John Doe, Jane Doe and Jenny Doe without explicit usernames, the default username is %-1f%-l and New username duplicate handling is set to Append counter, then the usernames produced will be jdoe, jdoe2 and jdoe3.&lt;br /&gt;
&lt;br /&gt;
===Deleting accounts===&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt; field is present, users with value 1 for it will be deleted. In this case, all the fields may be omitted, except for &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt;. After uploading the file, be sure to change the &amp;quot;Upload type&amp;quot; to &amp;quot;Update existing users only&amp;quot; and the &amp;quot;Allow deletes&amp;quot; option to &amp;quot;Yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039;  A similar field is available for &amp;lt;code&amp;gt;suspended&amp;lt;/code&amp;gt;. This enables a user account to be temporarily disabled rather than completely removed.&lt;br /&gt;
&lt;br /&gt;
Deleting and uploading accounts could be done with a single CSV file. For example, the following file will add the user Tom Jones and delete the user reznort:&lt;br /&gt;
&lt;br /&gt;
 username,firstname,lastname,deleted&lt;br /&gt;
 jonest,Tom,Jones,0&lt;br /&gt;
 reznort,,,1&lt;br /&gt;
&lt;br /&gt;
==Encoding file format==&lt;br /&gt;
On the initial Upload user screen, you may select the file encoding format from a pull down list.  These include UTF-8 (the default), ASCII,  ISO-8859-1 to ISO-8859-11 or any one of over 36 formats.&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
&lt;br /&gt;
===Spreadsheet===&lt;br /&gt;
&lt;br /&gt;
If you use a spreadsheet program such as Excel to create your .csv file, check the resulting output in a text editor before you upload it.  It is possible to get trailing commas on each line from an empty field if you have added and deleted columns of information prior to saving the final file. Also check the character encoding. A csv file is a simple text file (ASCII or Unicode) that can be used to upload user accounts.&lt;br /&gt;
&lt;br /&gt;
Excel translates passwords that begin with - (minus) or + (plus) as zero. Even when saving as .csv and saying &amp;quot;Yes&amp;quot; to &amp;quot;Keep this format, and leave out any incompatible features.&amp;quot; Check for this before uploading, as a zero halts the upload process.&lt;br /&gt;
&lt;br /&gt;
If you use a formula in Excel to create fields (for example, the concatenate function to create a user name), then remember to copy the cells with the formula and use special paste with values checked to make them into an acceptable data for a csv file.&lt;br /&gt;
&lt;br /&gt;
The upload will also fail if you have trailing spaces at the end of your data fields. Often, this can not be removed with a simple Find &amp;quot; &amp;quot; and Replace with &amp;quot;&amp;quot;. If information has been copied from web sources than it is possible to include non-breaking spaces which will prevent your upload from being completed correctly. To find these invisible spaces, use the Find and Replace function in Excel. In the find field, hold alt and type 0160. Leave the replace field blank. &lt;br /&gt;
&lt;br /&gt;
===Country===&lt;br /&gt;
The country should be written as a two letter code, in capitals. For example, use BE for Belgium or NL for the Netherlands.  Using &amp;quot;be&amp;quot; or &amp;quot;nl&amp;quot; or &amp;quot;USA&amp;quot; as a country code will result in a database error.&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039;  If you are having trouble working out the two-letter code for a country, you can consult the list of [http://www.iso.org/iso/country_names_and_code_elements country names and code elements] available on the ISO Website. A common error is to use UK for United Kingdom; it should be GB.&lt;br /&gt;
&lt;br /&gt;
===Field size limits===&lt;br /&gt;
Some fields have maximum character lengths, as defined in the database fields.  Typically the file will import to the preview list screen but not finish the process. Turn on debug to see the fields that are too long. The error will be &amp;quot;User not added - error&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The sizes of some common fields, in number of characters, are currently (3.2):&lt;br /&gt;
&lt;br /&gt;
*username - 100 	 &lt;br /&gt;
*password - 255 	 &lt;br /&gt;
*idnumber - 255 	 &lt;br /&gt;
*firstname - 100 	 &lt;br /&gt;
*lastname - 100 	 &lt;br /&gt;
*lastnamephonetic - 255 	 &lt;br /&gt;
*firstnamephonetic - 255 	 &lt;br /&gt;
*middlename - 255 	 &lt;br /&gt;
*alternatename - 255 &lt;br /&gt;
*institution -  255 	 &lt;br /&gt;
*department - 255 	 &lt;br /&gt;
*address - 255 	 &lt;br /&gt;
*city - 120 	 &lt;br /&gt;
*icq -15 	 &lt;br /&gt;
*skype - 50 	 &lt;br /&gt;
*yahoo - 50 	 &lt;br /&gt;
*aim - 50&lt;br /&gt;
*msn - 50 	 &lt;br /&gt;
*phone1 - 20 	 &lt;br /&gt;
*phone2  - 20&lt;br /&gt;
&lt;br /&gt;
===Time zones===&lt;br /&gt;
&lt;br /&gt;
The entry is case sensitive so &amp;lt;code&amp;gt;Europe/London&amp;lt;/code&amp;gt; will work but &amp;lt;code&amp;gt;europe/london&amp;lt;/code&amp;gt; will not. Use the names from the Timezone list found in &#039;&#039;Site administration &amp;gt; Location &amp;gt; Default timezone&#039;&#039; in their proper format.&lt;br /&gt;
&lt;br /&gt;
===All user fields listed here===&lt;br /&gt;
:All the user fields that are valid in an upload file are listed below, except for any custom fields you may have created (for which see below.)&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;firstname,lastname,username,email,password,auth,idnumber,institution,department,city,country,timezone,lang,mailformat,maildisplay,maildigest,htmleditor,autosubscribe,skype,msn,aim,yahoo,icq,phone1,phone2,address,url,description,descriptionformat,oldusername,deleted,suspended,alternatename,lastnamephonetic,firstnamephonetic,middlename&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
TIP: You can copy/paste the above as plain text and save it as a csv file to use as a template header for your upload files.&lt;br /&gt;
&lt;br /&gt;
The courses are listed by number as&amp;lt;pre&amp;gt;course1,course2,course3,course4&amp;lt;/pre&amp;gt; etc.&lt;br /&gt;
&lt;br /&gt;
===Enroll users to Cohorts (system groups)===&lt;br /&gt;
You can enroll users to any Cohort (system level group) by using only the &amp;quot;username&amp;quot; and the &amp;quot;Cohort ID&amp;quot;.&lt;br /&gt;
Here is a sample CSV file:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;username,cohort1&#039;&#039;&#039;&lt;br /&gt;
 teacher1,system-teachers&lt;br /&gt;
 teacher2,system-teachers&lt;br /&gt;
 teacher3,system-teachers&lt;br /&gt;
&lt;br /&gt;
Make sure you set &amp;quot;Upload type&amp;quot; to &amp;quot;Update existing users only&amp;quot; (So you are not asked to add firstname, lastname and email fields too)&lt;br /&gt;
&lt;br /&gt;
===Capabilities===&lt;br /&gt;
&lt;br /&gt;
You may wish to create a limited role to allow some users access to this function. Create a role and assign to the user at the system/site level with the following capabilities allowed&lt;br /&gt;
* moodle/site:uploadusers&lt;br /&gt;
* moodle/role:assign&lt;br /&gt;
* In &#039;Allow role assignments&#039; permit this new role to assign the required roles&lt;br /&gt;
&lt;br /&gt;
In particular, don&#039;t forget the moodle/role:assign capability (even if these users have it in the courses they will be enrolling users in - it won&#039;t work).&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://youtu.be/PFGLZnuu_JI Adding users by using a CSV in Moodle]  MoodleBites video on YouTube&lt;br /&gt;
*[[Flat file]] enrolment&lt;br /&gt;
* [[User profile fields]] for details of how to include data about custom user profile fields in the upload users file&lt;br /&gt;
* [[Upload courses]]&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=36851 Can I auto enroll from Excel?]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=97903 Uploading users to custom roles]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=181259 User upload option: standardise usernames]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=144569 Matriculacion con flat file csv] - discussion in Spanish&lt;br /&gt;
&lt;br /&gt;
[[fr:Importer des utilisateurs]]&lt;br /&gt;
[[ja:ユーザのアップロード]]&lt;br /&gt;
[[de:Nutzerliste hochladen]]&lt;br /&gt;
[[es:Subir usuarios]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=125737</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=125737"/>
		<updated>2016-10-28T20:40:55Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Create the (moodledata) data directory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (sometimes known as the LAMP platform). Typically this is also how Moodle is run, although there are other options as long as the software requirements of the  [{{Release notes}} release] are met.&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
For very large sites, you are much better starting with a small pilot and gaining some experience and insight. A &amp;quot;what hardware do I need for 50,000 user?&amp;quot; style post in the forums is highly unlikely to get a useful answer.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
Depending the use case a Moodle server may be anything from a Desktop PC (e.g. for testing and evaluating) to a rackmounted or  [[Server cluster|clustered]] solution. As mentioned above there are lots of possibilities for installing the basic server software, some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]. &lt;br /&gt;
&lt;br /&gt;
It will help hugely, regardless of your deployment choices, if time is taken to understand how to configure the different parts of your software stack (HTTP daemon, database,  PHP etc). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require tuning to get the best out of Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code (including host provided Moodle installers), you are strongly advised to only obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can typically place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the default way Moodle caches data you may have serious performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=125736</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=125736"/>
		<updated>2016-10-28T20:38:17Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Download and copy files into place */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (sometimes known as the LAMP platform). Typically this is also how Moodle is run, although there are other options as long as the software requirements of the  [{{Release notes}} release] are met.&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
For very large sites, you are much better starting with a small pilot and gaining some experience and insight. A &amp;quot;what hardware do I need for 50,000 user?&amp;quot; style post in the forums is highly unlikely to get a useful answer.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
Depending the use case a Moodle server may be anything from a Desktop PC (e.g. for testing and evaluating) to a rackmounted or  [[Server cluster|clustered]] solution. As mentioned above there are lots of possibilities for installing the basic server software, some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]. &lt;br /&gt;
&lt;br /&gt;
It will help hugely, regardless of your deployment choices, if time is taken to understand how to configure the different parts of your software stack (HTTP daemon, database,  PHP etc). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require tuning to get the best out of Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code (including host provided Moodle installers), you are strongly advised to only obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can typically place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=125735</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=125735"/>
		<updated>2016-10-28T20:36:51Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Download and copy files into place */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (sometimes known as the LAMP platform). Typically this is also how Moodle is run, although there are other options as long as the software requirements of the  [{{Release notes}} release] are met.&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
For very large sites, you are much better starting with a small pilot and gaining some experience and insight. A &amp;quot;what hardware do I need for 50,000 user?&amp;quot; style post in the forums is highly unlikely to get a useful answer.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
Depending the use case a Moodle server may be anything from a Desktop PC (e.g. for testing and evaluating) to a rackmounted or  [[Server cluster|clustered]] solution. As mentioned above there are lots of possibilities for installing the basic server software, some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]. &lt;br /&gt;
&lt;br /&gt;
It will help hugely, regardless of your deployment choices, if time is taken to understand how to configure the different parts of your software stack (HTTP daemon, database,  PHP etc). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require tuning to get the best out of Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code (including host provided Moodle installers), you are strongly advised to only obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=125734</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=125734"/>
		<updated>2016-10-28T20:35:56Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Set up your server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (sometimes known as the LAMP platform). Typically this is also how Moodle is run, although there are other options as long as the software requirements of the  [{{Release notes}} release] are met.&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
For very large sites, you are much better starting with a small pilot and gaining some experience and insight. A &amp;quot;what hardware do I need for 50,000 user?&amp;quot; style post in the forums is highly unlikely to get a useful answer.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
Depending the use case a Moodle server may be anything from a Desktop PC (e.g. for testing and evaluating) to a rackmounted or  [[Server cluster|clustered]] solution. As mentioned above there are lots of possibilities for installing the basic server software, some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]. &lt;br /&gt;
&lt;br /&gt;
It will help hugely, regardless of your deployment choices, if time is taken to understand how to configure the different parts of your software stack (HTTP daemon, database,  PHP etc). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require tuning to get the best out of Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=125733</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=125733"/>
		<updated>2016-10-28T20:34:26Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (sometimes known as the LAMP platform). Typically this is also how Moodle is run, although there are other options as long as the software requirements of the  [{{Release notes}} release] are met.&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
For very large sites, you are much better starting with a small pilot and gaining some experience and insight. A &amp;quot;what hardware do I need for 50,000 user?&amp;quot; style post in the forums is highly unlikely to get a useful answer.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
Depending the use case a Moodle server may be anything from a Desktop PC (e.g. for testing and evaluating) to a rackmounted or  [[Server cluster|clustered]] solution. As mentioned above there are lots of possibilities for installing the basic server software, some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]. &lt;br /&gt;
&lt;br /&gt;
It will help hugely, regardless of your deployment choices, if time is taken to understand how to configure the different parts of your software stack (HTTP daemon, database,  PHP etc). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require optimisation to work optimally with Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=125732</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=125732"/>
		<updated>2016-10-28T20:20:54Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Installation is complete :) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (sometimes known as the LAMP platform). Typically this is also how Moodle is run, although there are other options as long as the software requirements of the  [{{Release notes}} release] are met.&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
Depending the use case a Moodle server may be anything from a Desktop PC (e.g. for testing and evaluating) to a rackmounted or  [[Server cluster|clustered]] solution. As mentioned above there are lots of possibilities for installing the basic server software, some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]. &lt;br /&gt;
&lt;br /&gt;
It will help hugely, regardless of your deployment choices, if time is taken to understand how to configure the different parts of your software stack (HTTP daemon, database,  PHP etc). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require optimisation to work optimally with Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Security_keys&amp;diff=125508</id>
		<title>Security keys</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Security_keys&amp;diff=125508"/>
		<updated>2016-10-07T09:02:49Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: Vital information missing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RSS feeds}}&lt;br /&gt;
A security key or token enables other systems to access Moodle securely. A security key may be used for secure RSS feeds or web services.&lt;br /&gt;
&lt;br /&gt;
A user can obtain a security key via the Preferences link of the user menu top right and then entering the key in an external application accessing Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: In order for this to be accessible the user needs the moodle/webservice:create token capability. The easiest way to do this is to allow the capability for the Authenticated User role. This does not allow the user to use web services, only to create a token.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At any time, a user can reset their key by clicking the reset link. A new different key is automatically generate which will then need to be entered in the external application.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The security keys page can not generate web service keys/tokens for admins. Admins can create a token manually from the administration block: &#039;&#039; Site administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; Manage tokens&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Secure RSS feeds==&lt;br /&gt;
&lt;br /&gt;
Secure RSS feeds are a way you can read [[Using_RSS_feeds|forum posts, blog entries, etc]] while you are offline, and without having to log in.  For example, if you want to read the posts in a forum, you usually need to log in to Moodle.  But if your site administrator has [[RSS_feeds_settings|enabled RSS]], these posts are available as a feed you can subscribe to with a [http://en.wikipedia.org/wiki/Comparison_of_feed_aggregators feed reader], and you can read entries even when you don&#039;t have access to the Internet.&lt;br /&gt;
&lt;br /&gt;
Secure RSS feeds allow your feed reader, which usually expects feeds to be publicly available, to download material from Moodle without having to log in.&lt;br /&gt;
&lt;br /&gt;
Whenever you are viewing an activity that provides an RSS feed, look in the Administration block for a link labelled &amp;quot;RSS feed of posts&amp;quot;.  This link is unique to your Moodle account.  Paste it into your feed reader to have it obtain new entries for you automatically.&lt;br /&gt;
&lt;br /&gt;
If you ever think your RSS feed token has been compromised in some way, e.g. you have lost a mobile phone that subscribed to a news forum, you can request a new one by clicking the &#039;&#039;Reset&#039;&#039; link on the &#039;&#039;Security Keys&#039;&#039; page from the Preferences link in your user menu.  This will disable the old feed token and generate a new one.  You can then visit the activities you wish to subscribe to and copy the URL, which will contain your new security key.&lt;br /&gt;
&lt;br /&gt;
[[Category:Web Services]]&lt;br /&gt;
&lt;br /&gt;
[[ja:セキュリティキー]]&lt;br /&gt;
[[es:Claves de seguridad]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=PHP&amp;diff=125420</id>
		<title>PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=PHP&amp;diff=125420"/>
		<updated>2016-09-21T09:45:56Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* PHP Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
PHP is the scripting language in which Moodle is developed. It is integrated with your web server. The web server detects php pages (by their extension) and sends them to PHP for execution. PHP must be installed and configured properly for Moodle to work effectively (or at all). &lt;br /&gt;
&lt;br /&gt;
==PHP Settings==&lt;br /&gt;
Check these settings in your php.ini or .htaccess file (if you&#039;re using Apache). For settings which use ON/OFF as their values, you can substitute 1 for ON and 0 for OFF if you prefer. If you change php.ini, don&#039;t forget to restart the server. &lt;br /&gt;
* &#039;&#039;register_globals&#039;&#039; &#039;&#039;&#039;MUST&#039;&#039;&#039; be OFF - (Feature removed as of PHP 5.4. PHP 5.4 is a minimum requirement of Moodle 2.7)&lt;br /&gt;
* &#039;&#039;safe_mode&#039;&#039; needs to be OFF - (Feature removed as of PHP 5.4. PHP 5.4 is a minimum requirement of Moodle 2.7)&lt;br /&gt;
* &#039;&#039;memory_limit&#039;&#039; needs to be at least 96M (although some functions may not work if this low).  Moodle will refuse to install if lower. 128M is recommended. Large systems may need an even higher setting.&lt;br /&gt;
* &#039;&#039;session.save_handler&#039;&#039; needs to be set to FILES.&lt;br /&gt;
* &#039;&#039;magic_quotes_gpc&#039;&#039; should be OFF - (Feature removed as of PHP 5.4. PHP 5.4 is a minimum requirement of Moodle 2.7)&lt;br /&gt;
* &#039;&#039;magic_quotes_runtime&#039;&#039; needs to be OFF.&lt;br /&gt;
* &#039;&#039;file_uploads&#039;&#039; needs to be ON.&lt;br /&gt;
* &#039;&#039;session.auto_start&#039;&#039; needs to be OFF.&lt;br /&gt;
* &#039;&#039;session.bug_compat_warn&#039;&#039; needs to be OFF - (Feature removed as of PHP 5.4. PHP 5.4 is a minimum requirement of Moodle 2.7)&lt;br /&gt;
* The temp folder must be defined and writeable by your webserver user&lt;br /&gt;
* Check the error display/logging section. Make sure the settings are appropriate for your server use.&lt;br /&gt;
* &#039;&#039;post_max_size&#039;&#039; and &#039;&#039;upload_max_filesize&#039;&#039; restrict the maximum file size that can be uploaded.&lt;br /&gt;
* Check the &#039;&#039;[mail function]&#039;&#039; and database section (for your chosen database) to make sure they match your server configuration.&lt;br /&gt;
&lt;br /&gt;
==HTTP_RAW_POST_DATA errors==&lt;br /&gt;
Some users are experiencing $HTTP_RAW_POST_DATA related errors, when establishing connection between MNET servers or making AJAX web services requests.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Request for server name returned empty response&lt;br /&gt;
 &lt;br /&gt;
    line 134 of /mnet/lib.php: call to debugging()&lt;br /&gt;
    line 115 of /admin/mnet/peers.php: call to mnet_get_public_key()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These errors are affecting users running moodle on PHP 5.6 version and it&#039;s a PHP bug on the &#039;&#039;&#039;always_populate_raw_post_data&#039;&#039;&#039; setting the default value to 0.&lt;br /&gt;
&lt;br /&gt;
To avoid the error messages above, please change the value following setting on your php.ini file:&lt;br /&gt;
* &#039;&#039;&#039;always_populate_raw_post_data&#039;&#039;&#039; should be changed to &#039;&#039;&#039;-1&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
For more information about this bug, see: https://bugs.php.net/bug.php?id=66763&lt;br /&gt;
&lt;br /&gt;
==Finding the correct php.ini==&lt;br /&gt;
Sometimes it is not obvious where the php.ini file is located or you may even find more than one. To be certain run &#039;phpinfo&#039; - see below. The path of the php.ini file is a few lines down in the top section. &lt;br /&gt;
&lt;br /&gt;
Note that if you are using command-line (CLI) PHP for running cron (or anything else) it may be configured with a &#039;&#039;different&#039;&#039; php.ini file.  To check, run the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
php -i | grep php.ini&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==PHP Extensions and libraries==&lt;br /&gt;
The following PHP extensions are required or recommended (some, e.g. iconv, ctype and tokenizer are now included in PHP by default). Others will need to be installed or selected.&lt;br /&gt;
* The &#039;&#039;&#039;iconv&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;mbstring&#039;&#039;&#039; extension is recommended.&lt;br /&gt;
* The &#039;&#039;&#039;curl&#039;&#039;&#039; extension is required (required for networking and web services).&lt;br /&gt;
* The &#039;&#039;&#039;openssl&#039;&#039;&#039; extension is recommended (required for networking and web services).&lt;br /&gt;
* The &#039;&#039;&#039;tokenizer&#039;&#039;&#039; extension is recommended.&lt;br /&gt;
* The &#039;&#039;&#039;xmlrpc&#039;&#039;&#039; extension is recommended (required for networking and web services).&lt;br /&gt;
* The &#039;&#039;&#039;soap&#039;&#039;&#039; extension is recommended (required for web services).&lt;br /&gt;
* The &#039;&#039;&#039;ctype&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;zip&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;gd&#039;&#039;&#039; extension is recommended (required for manipulating images).&lt;br /&gt;
* The &#039;&#039;&#039;simplexml&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;spl&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;pcre&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;dom&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;xml&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;intl&#039;&#039;&#039; extension is recommended.&lt;br /&gt;
* The &#039;&#039;&#039;json&#039;&#039;&#039; extension is required.&lt;br /&gt;
* &#039;&#039;&#039;The appropriate extension for your chosen database is also required.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Other PHP extensions may be required to support optional Moodle functionality, especially external authentication and/or enrolment (e.g. LDAP extension for LDAP authentication and the sockets extension for Chat server).&lt;br /&gt;
&lt;br /&gt;
==Installing (missing) extensions==&lt;br /&gt;
&lt;br /&gt;
This depends on how PHP was installed on your machine and what access you have. Here are some possibilities:&lt;br /&gt;
* If this is a hosted server you are likely to have to ask the administrator or hosting company. &lt;br /&gt;
* If PHP was compiled from source you will need to recompile, changing the &#039;configure&#039; settings - see [[Compiling PHP from source]].&lt;br /&gt;
* If it was installed using packages (typically Linux) you can install the required package (see your Linux distribution&#039;s documentation)&lt;br /&gt;
* If you are using Windows you just need to uncomment the appropriate DLL files in php.ini&lt;br /&gt;
&lt;br /&gt;
After making any changes or additions, don&#039;t forget to re-start your web server.&lt;br /&gt;
&lt;br /&gt;
== .htaccess files ==&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have access to the php.ini file or there are conflicting requirements with other PHP applications on the same server you may be able to change PHP settings in an .htaccess file. This should be placed in the &#039;root&#039; of your Moodle installation (i.e. the same place as the config.php file). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The file isn&#039;t always called .htaccess and may not work at all. Contact your server administrator to be sure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Settings are made by adding lines in one of two formats:&lt;br /&gt;
* php_value &#039;&#039;name value&#039;&#039;&lt;br /&gt;
* php_flag &#039;&#039;name on/off&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
* &#039;&#039;&#039;php_value memory_limit 128M&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;php_flag register_globals off&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==PHP info==&lt;br /&gt;
&lt;br /&gt;
The phpinfo display contains information about the configuration of your PHP installation. This is useful for checking:&lt;br /&gt;
* that your PHP installation meets Moodle&#039;s system requirements.&lt;br /&gt;
* the values that are currently applied to your server&#039;s PHP install, e.g. File upload limits&lt;br /&gt;
* that you have installed the required modules needed for Moodle to work, e.g. the LDAP module for LDAP authentication.&lt;br /&gt;
&lt;br /&gt;
=== Displaying phpinfo in Moodle===&lt;br /&gt;
&lt;br /&gt;
An administrator can find PHP info in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; PHP info&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Displaying phpinfo outside of Moodle ===&lt;br /&gt;
&lt;br /&gt;
To view the phpinfo information:&lt;br /&gt;
* Create a file called info.php using your text editor, containing this single line:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code php&amp;gt;&lt;br /&gt;
 &amp;lt;?php phpinfo(); ?&amp;gt;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Save this file as info.php&lt;br /&gt;
* Upload this file into the root web accessible folder on your server.&lt;br /&gt;
* Now open this file in your browser. For example &amp;lt;nowiki&amp;gt;http://&amp;lt;server-name&amp;gt;/info.php&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Compiling PHP from source]]&lt;br /&gt;
* [https://docs.moodle.org/dev/Moodle_and_PHP7 Moodle and PHP7] in the developers documentation&lt;br /&gt;
*http://www.php.net/ - the PHP web site&lt;br /&gt;
*http://php.iis.net/ - Microsoft PHP Installer for IIS&lt;br /&gt;
&lt;br /&gt;
[[de:PHP-Versionen für Moodle]]&lt;br /&gt;
[[es:PHP]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=admin/environment/php_setting/memory_limit&amp;diff=125402</id>
		<title>admin/environment/php setting/memory limit</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=admin/environment/php_setting/memory_limit&amp;diff=125402"/>
		<updated>2016-09-19T09:06:08Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Environment}}&lt;br /&gt;
&#039;&#039;memory_limit&#039;&#039; should be at least 96M. Large sites may need much more. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|PHP]]&lt;br /&gt;
&lt;br /&gt;
[[es:admin/environment/php setting/memory limit]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=124955</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=124955"/>
		<updated>2016-08-18T14:26:50Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Download and copy files into place */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (sometimes known as the LAMP platform). Typically this is also how Moodle is run, although there are other options as long as the software requirements of the  [{{Release notes}} release] are met.&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
Depending the use case a Moodle server may be anything from a Desktop PC (e.g. for testing and evaluating) to a rackmounted or  [[Server cluster|clustered]] solution. As mentioned above there are lots of possibilities for installing the basic server software, some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]. &lt;br /&gt;
&lt;br /&gt;
It will help hugely, regardless of your deployment choices, if time is taken to understand how to configure the different parts of your software stack (HTTP daemon, database,  PHP etc). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require optimisation to work optimally with Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=124954</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=124954"/>
		<updated>2016-08-18T14:25:18Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: Removing some &amp;#039;wordiness&amp;#039; and some poor grammar.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (sometimes known as the LAMP platform). Typically this is also how Moodle is run, although there are other options as long as the software requirements of the  [{{Release notes}} release] are met.&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
Depending the use case a Moodle server may be anything from a Desktop PC (e.g. for testing and evaluating) to a rackmounted or  [[Server cluster|clustered]] solution. As mentioned above there are lots of possibilities for installing the basic server software, some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]. &lt;br /&gt;
&lt;br /&gt;
It will help hugely, regardless of your deployment choices, if time is taken to understand how to configure the different parts of your software stack (HTTP daemon, database,  PHP etc). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require optimisation to work optimally with Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--depth=1  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
--single-branch  option to limit cloning to a single branch, this fetches the Moodle 3.1 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=124953</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=124953"/>
		<updated>2016-08-18T14:21:57Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (sometimes known as the LAMP platform). Typically this is also how Moodle is run, although there are other options as long as the software requirements of the  [{{Release notes}} release] are met.&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
Depending the use case a Moodle server may be anything from a Desktop PC (e.g. for testing and evaluating) to a rackmounted or  [[Server cluster|clustered]] solution. As mentioned above there are lots of possibilities for installing the basic server software, some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]. &lt;br /&gt;
&lt;br /&gt;
It will help hugely, regardless of your deployment choices, if time is taken to understand how to configure the different parts of your software stack (HTTP daemon, database,  PHP etc). For example it is important that the HTTP daemon is configured to support [[Using slash arguments| slash arguments]].&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform, otherwise all the core configuration should be done. It will be helpful to become familiar with how to change setting within the hosting providers platform (e.g. PHP file upload maximums) as the options and tools provided can vary a huge amount between them.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--depth=1  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
--single-branch  option to limit cloning to a single branch, this fetches the Moodle 3.1 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Administration_via_command_line&amp;diff=124042</id>
		<title>Administration via command line</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Administration_via_command_line&amp;diff=124042"/>
		<updated>2016-06-09T09:55:00Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Tool for converting tables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
==Running CLI scripts==&lt;br /&gt;
If you have shell access to your web server, you may find various CLI (command line interface) scripts useful during Moodle administration. Core admin CLI tools are located in the &amp;lt;code&amp;gt;admin/cli/*&amp;lt;/code&amp;gt; folder. Other plugins provide their CLI functionality via scripts in their own cli folder. For example, the enrol_db sync script is located in &amp;lt;code&amp;gt;enrol/db/cli/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To avoid problems with access control, you should run them as the owner of the web server process. It is especially important for CLI installation and upgrade as they create new files in moodledata directory and the web server has to have write access to them. In Linux distributions, the user that runs the web server is usually apache or wwrun or httpd or something similar. As a root, you will probably want to execute Moodle CLI scripts like this:&lt;br /&gt;
&lt;br /&gt;
    $ cd /path/to/your/moodle/dir&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/somescript.php --params&lt;br /&gt;
&lt;br /&gt;
Most of the scripts accept common --help (or -h) parameter to display the full usage information, for example:&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/install.php --help&lt;br /&gt;
&lt;br /&gt;
== Upgrading ==&lt;br /&gt;
&lt;br /&gt;
Moodle can be upgraded from the command line. As with the installation script, there is either interactive or non-interactive mode of the upgrade. The script itself does not put the site into the maintenance mode, you have to do it on your own. Also, the script does not backup any data (if you read this page, you probably have some own scripts to backup your moodledata and the database, right?)&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/upgrade.php&lt;br /&gt;
&lt;br /&gt;
Upgrading via command line is a very comfortable way of Moodle upgrade if you use Git checkout of the Moodle source code (see [[Git for Administrators]]). See the following procedure how to upgrade your site within several seconds to the most recent version while preserving your eventual local customizations tracked in git repository:&lt;br /&gt;
&lt;br /&gt;
    $ cd /var/www/sites/moodle/htdocs/&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/maintenance.php --enable&lt;br /&gt;
    $ git pull&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/upgrade.php&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/maintenance.php --disable&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
There are two modes of installing Moodle from the command line. In interactive mode, the install script asks you for all data needed to properly set up new Moodle site. In non-interactive mode, you must provide all required data as the script parameters and then the new site is installed silently. The parameters can be passed in the interactive mode, too. The provided values are then used as the default values during the interactive session.&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/install.php --lang=cs&lt;br /&gt;
&lt;br /&gt;
If required, the database install may be skipped, with just config.php populated.&lt;br /&gt;
&lt;br /&gt;
   $ sudo -u apache /usr/bin/php admin/cli/install.php --skip-database&lt;br /&gt;
&lt;br /&gt;
== Maintenance mode ==&lt;br /&gt;
&lt;br /&gt;
To switch your site into the maintenance mode via CLI, you can use&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/maintenance.php --enable&lt;br /&gt;
&lt;br /&gt;
To turn maintenance mode off, just execute the same script with --disable parameter.&lt;br /&gt;
&lt;br /&gt;
== Offline mode ==&lt;br /&gt;
&lt;br /&gt;
In some situations, you may want to switch your Moodle site into offline mode so that it is not accessible via the web but you can not stop the web server completely (typically because there are other web pages and applications running there). If a file called &amp;lt;code&amp;gt;climaintenance.html&amp;lt;/code&amp;gt; exists in the root folder of moodledata directory, Moodle will automatically display the contents of that file instead of any other page.&lt;br /&gt;
&lt;br /&gt;
    $ cd /var/www/sites/moodle/moodledata/&lt;br /&gt;
    $ echo &#039;&amp;amp;lt;h1&amp;amp;gt;Sorry, maintenance in progress&amp;amp;lt;/h1&amp;amp;gt;&#039; &amp;amp;gt; climaintenance.html&lt;br /&gt;
&lt;br /&gt;
You can prepare a nice formatted HTML page to inform your users about the server being down and keep in the moodledata directory under a name like &amp;lt;code&amp;gt;climaintenance.off&amp;lt;/code&amp;gt; and rename it to the &amp;lt;code&amp;gt;climaintenance.html&amp;lt;/code&amp;gt; if needed.&lt;br /&gt;
&lt;br /&gt;
== Custom site defaults ==&lt;br /&gt;
&lt;br /&gt;
During the install and upgrade via CLI, Moodle sets the administration variables to the default values. You can use different defaults. See MDL-17850 for details. Shortly, all you need to do is to add a file &amp;lt;code&amp;gt;local/defaults.php&amp;lt;/code&amp;gt; into your Moodle installation. The format of the file is like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$defaults[&#039;pluginname&#039;][&#039;settingname&#039;] = &#039;settingvalue&#039;; // for plugins&lt;br /&gt;
$defaults[&#039;moodle&#039;][&#039;settingname&#039;] = &#039;settingvalue&#039;;     // for core settings&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These defaults are used during install, upgrade and are also displayed as defaults on Site administration pages.&lt;br /&gt;
&lt;br /&gt;
== Reset user password ==&lt;br /&gt;
&lt;br /&gt;
If you happen to forget your admin password (or you want to set a password for any other user on the site), you can use reset_password.php script. The script sets the correctly salted password for the given user.&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/reset_password.php&lt;br /&gt;
&lt;br /&gt;
== MySQL storage engine conversion ==&lt;br /&gt;
&lt;br /&gt;
If you run your Moodle site with MySQL database backend and use the default MyISAM as the storage engine for your tables, you may want to convert them to use some more reliable engine like InnoDB (actually, you should want to switch to PostgreSQL ;-) anyway).&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/mysql_engine.php --engine=InnoDB&lt;br /&gt;
&lt;br /&gt;
==Converting InnoDB tables to Barracuda==&lt;br /&gt;
&lt;br /&gt;
Sites using MySQL with database tables using Antelope as the file format are recommended to convert the tables to the Barracuda file format.&lt;br /&gt;
&lt;br /&gt;
This is because tables using Antelope as the file format cannot handle more than 10 text columns. This file formats only supports &#039;&#039;compact&#039;&#039; and &#039;&#039;redundant&#039;&#039; row formats for backward compatibility reasons. This may cause a problem on larger sites when restoring a course, in which case the following error will be displayed: &lt;br /&gt;
&lt;br /&gt;
 Row size too large (&amp;gt;8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help.&lt;br /&gt;
&lt;br /&gt;
Barracuda is the newest innoDB file format. In addition to supporting &#039;&#039;compact&#039;&#039; and &#039;&#039;redundant&#039;&#039; row formats, Barracuda also supports &#039;&#039;compressed&#039;&#039; and &#039;&#039;dynamic&#039;&#039; row formats. &lt;br /&gt;
&lt;br /&gt;
However, converting tables to Barracuda is only recommended, and not required, since not all MySQL users are affected. (It may only be a problem for larger sites.)&lt;br /&gt;
&lt;br /&gt;
===Tool for converting tables===&lt;br /&gt;
&lt;br /&gt;
A command line tool is included in Moodle for converting tables to Barracuda.&lt;br /&gt;
&lt;br /&gt;
To view tables requiring conversion, use the list option:&lt;br /&gt;
&lt;br /&gt;
 $ php admin/cli/mysql_compressed_rows.php --list&lt;br /&gt;
&lt;br /&gt;
Here is an example output:&lt;br /&gt;
&lt;br /&gt;
 mdl_data                            Compact     (needs fixing) &lt;br /&gt;
 mdl_data_fields                     Compact     (needs fixing)&lt;br /&gt;
 mdl_enrol_paypal                    Compact     (needs fixing)&lt;br /&gt;
&lt;br /&gt;
To proceed with the conversion, run the command using the fix option:&lt;br /&gt;
&lt;br /&gt;
 $ php admin/cli/mysql_compressed_rows.php --fix&lt;br /&gt;
&lt;br /&gt;
Successful table conversion will be reported in the output, for example:&lt;br /&gt;
&lt;br /&gt;
 mdl_data                   ... Compressed&lt;br /&gt;
 mdl_data_fields            ... Compressed&lt;br /&gt;
 mdl_enrol_paypal           ... Compressed&lt;br /&gt;
&lt;br /&gt;
Please note that the commands must be executed on your moodle directory. Once tables are fixed, the warning message will no longer be displayed.&lt;br /&gt;
 &lt;br /&gt;
For further information on InnoDB file formats see the [http://dev.mysql.com/doc/innodb/1.1/en/glossary.html#glos_antelope MySQL InnoDB glossary - Antelope] and the [http://dev.mysql.com/doc/innodb/1.1/en/glossary.html#glos_barracuda MySQL InnoDB glossary - Barracuda].&lt;br /&gt;
&lt;br /&gt;
If you get errors due to having insufficient privileges to run these commands (this is quite likely) then the easiest solution is to generate the required SQL commands using,&lt;br /&gt;
&lt;br /&gt;
 $ php admin/cli/mysql_compressed_rows.php --showsql&lt;br /&gt;
&lt;br /&gt;
You can then copy the generated SQL into your mysql client running as the &#039;root&#039; user.&lt;br /&gt;
&lt;br /&gt;
== Running cron via command line ==&lt;br /&gt;
&lt;br /&gt;
In versions 1.x, you could execute admin/cron.php either from command line or via the web. Since Moodle 2.0, only admin/cli/cron.php script can be run via command line.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Scheduled tasks are automatically run by the cron script, but the specific tasks which run on each cron iteration are determined by the scheduled tasks configuration. It is possible to override the scheduled tasks configuration and run a single scheduled task immediately using the admin/tool/task/cli/schedule_task.php script. &lt;br /&gt;
&lt;br /&gt;
This script accepts the following arguments:&lt;br /&gt;
&lt;br /&gt;
 --list - list all the known scheduled tasks. The tasks are listed by the class name used to run the task. This class name is required as the argument to the next option in order to run a specific task immediately.&lt;br /&gt;
&lt;br /&gt;
 --execute=&amp;lt;task&amp;gt; - Runs a single scheduled task immediately - regardless of scheduling settings. This will even run disabled tasks. Tasks will still use locking to prevent concurrent execution of the same task - even on clusters. The format of the &amp;lt;task&amp;gt; argument must be the same as returned by the --list option above.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must escape the &amp;quot;\&amp;quot; with an extra \ when using the --execute command. Take the following for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;php schedule_task.php --list&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will return something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
== List of scheduled tasks (http://yourserver.com/moodle) ==&lt;br /&gt;
\enrol_imsenterprise\task\cron_task                10 * * * * *      ASAP&lt;br /&gt;
\logstore_legacy\task\cleanup_task                 * 5 * * * *       ASAP&lt;br /&gt;
\logstore_standard\task\cleanup_task               * 4 * * * *       Wednesday, November 12, 2014, 4:35 AM&lt;br /&gt;
\mod_forum\task\cron_task                          * * * * * *       ASAP&lt;br /&gt;
\core\task\automated_backup_task                   50 * * * * *      ASAP&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the first task in that list, you would execute&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;php schedule_task.php --execute=\\enrol_imsenterprise\\task\\cron_task&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database transfer==&lt;br /&gt;
&lt;br /&gt;
A command line script for [[Database transfer]] may be found in &#039;&#039;admin/tool/dbtransfer/cli/migrate.php&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Purge caches==&lt;br /&gt;
&lt;br /&gt;
You can purge caches using this script:&lt;br /&gt;
&lt;br /&gt;
  php admin/cli/purge_caches.php&lt;br /&gt;
&lt;br /&gt;
==Fix course / module sequences==&lt;br /&gt;
&lt;br /&gt;
In rare cases (such as after upgrading from a very old version of Moodle), the course / section / module sequence data can be out of sync. This can cause various problems for affected courses, such as sections not appearing, backups failing, pages not displaying etc. There is a specific check to check for errors caused by this problem, and to fix the data in the database if they are found. To run this script please use the command below:&lt;br /&gt;
&lt;br /&gt;
  php admin/cli/fix_course_sequence.php -c=* --fix&lt;br /&gt;
&lt;br /&gt;
This will check every course in Moodle and report which ones had errors and were fixed.&lt;br /&gt;
&lt;br /&gt;
==Fix orphaned question categories==&lt;br /&gt;
&lt;br /&gt;
When a quiz is created, a new question category for the quiz is automatically created. In versions of Moodle prior to 2.9.1, if the quiz is deleted, the question category and any questions in the category remain in database. These orphaned question categories may be fixed by running the admin/cli/fix_orphaned_question_categories.php script with the --fix option.&lt;br /&gt;
&lt;br /&gt;
==Search and replace text==&lt;br /&gt;
&lt;br /&gt;
This script can be used to search and replace text throughout the whole database. Use carefully and backup first always. More info in [[Search and replace tool]].&lt;br /&gt;
&lt;br /&gt;
  php admin/tool/replace/cli/replace.php --search=//oldsitehost --replace=//newsitehost&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* MDL-35736 - Manage plugins via command line&lt;br /&gt;
* MDL-36237 - Resort course list via CLI&lt;br /&gt;
* [http://moosh-online.com/ MOOSH] - MOOdle SHell. It is a commandline tool that will allow you to perform most common Moodle tasks.&lt;br /&gt;
&lt;br /&gt;
[[fr:Administration en ligne de commande]]&lt;br /&gt;
[[de:Administration über Kommandozeile]]&lt;br /&gt;
[[ja:コマンドライン経由の管理]]&lt;br /&gt;
[[es:Administración por línea de comando]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Universal_Office_Converter_(unoconv)&amp;diff=123675</id>
		<title>Universal Office Converter (unoconv)</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Universal_Office_Converter_(unoconv)&amp;diff=123675"/>
		<updated>2016-05-19T08:55:01Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Installing unoconv on Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Installing unoconv=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;unoconv&amp;quot; is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. &lt;br /&gt;
&lt;br /&gt;
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. &lt;br /&gt;
&lt;br /&gt;
== Installing unoconv on Linux ==&lt;br /&gt;
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:&lt;br /&gt;
&lt;br /&gt;
(Ubuntu 16.04 LTS)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get install unoconv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.&lt;br /&gt;
&lt;br /&gt;
Potential problems:&lt;br /&gt;
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).&lt;br /&gt;
* If you are still running 14.04LTS then unoconv won&#039;t work as shipped. This might not be the most efficient route but it worked by first installing unoconv (version 0.6) from the package manager as above. You will then need to grab unoconv 0.7 from Github (https://github.com/dagwieers/unoconv), then upgrade to the latest libreoffice using the PPA (https://launchpad.net/~libreoffice/+archive/ubuntu/ppa). Point moodle at the Github version of unoconv. You need to modify the Python unoconv file by changing &#039;python&#039; in the first line to &#039;python3&#039;. You also need to change the permissions on the directory /var/www so that the user www-data can write to it (www-data needs to write to its home directory which it cannot do by default).&lt;br /&gt;
&lt;br /&gt;
== Installing unoconv on OS X ==&lt;br /&gt;
Download and install LibreOffice for Mac. Make sure to run it and verify it is working before continuing.&lt;br /&gt;
&lt;br /&gt;
Get the latest version of the unoconv python script. One way to do this is with [[http://brew.sh/ brew]].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install unoconv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t done it already - install ghostscript. One way to install ghostscript is also with [[http://brew.sh/ brew]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install ghostscript&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the paths to unoconv and ghostscript in Moodle (Site administration ▶︎ Server ▶︎ System paths ). If you used brew, they will both be installed to /usr/local/bin.&lt;br /&gt;
&lt;br /&gt;
== Installing unoconv on Windows ==&lt;br /&gt;
Download and install LibreOffice for windows.&lt;br /&gt;
&lt;br /&gt;
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. &lt;br /&gt;
&lt;br /&gt;
Rename the downloaded script to C:\unoconv\unoconv.py&lt;br /&gt;
&lt;br /&gt;
Create a batch file C:\unoconv\unoconv.bat with these contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@cd &amp;quot;C:\Program Files (x86)\LibreOffice 5\program&amp;quot;&lt;br /&gt;
@&amp;quot;python-core-3.3.0\bin\python.exe&amp;quot; unoconv.py %* &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set paths in Moodle. &lt;br /&gt;
&lt;br /&gt;
Login as admin and go to Site administration ► Server ► System paths&lt;br /&gt;
&lt;br /&gt;
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)&lt;br /&gt;
&lt;br /&gt;
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)&lt;br /&gt;
&lt;br /&gt;
Test ghostscript and unoconv are working correctly in the admin test pages &amp;quot;Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Run a unoconv listener ==&lt;br /&gt;
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it&#039;s request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.&lt;br /&gt;
&lt;br /&gt;
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.&lt;br /&gt;
&lt;br /&gt;
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]&lt;br /&gt;
&lt;br /&gt;
== Offload processing to a different server ==&lt;br /&gt;
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.&lt;br /&gt;
&lt;br /&gt;
How to do this:&lt;br /&gt;
&lt;br /&gt;
Install unoconv on each webservers and the remote server following the installation instructions above. &lt;br /&gt;
&lt;br /&gt;
Make sure unoconv is started at boot time on the remote server with the &amp;quot;--listener&amp;quot; argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). &lt;br /&gt;
&lt;br /&gt;
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.&lt;br /&gt;
&lt;br /&gt;
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. &lt;br /&gt;
&lt;br /&gt;
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# Wrapper script for unoconv to forward processing.&lt;br /&gt;
# Install to /usr/bin/unoconv-remote with 755 permissions&lt;br /&gt;
/usr/bin/unoconv --server=&amp;lt;ip of remote server&amp;gt; &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.&lt;br /&gt;
&lt;br /&gt;
[[Category:Site administration]]&lt;br /&gt;
{{Installing_Moodle}}&lt;br /&gt;
&lt;br /&gt;
[[es:mod/assign/feedback/editpdf/testunoconv]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Universal_Office_Converter_(unoconv)&amp;diff=123674</id>
		<title>Universal Office Converter (unoconv)</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Universal_Office_Converter_(unoconv)&amp;diff=123674"/>
		<updated>2016-05-19T08:53:01Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Installing unoconv on Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Installing unoconv=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;unoconv&amp;quot; is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. &lt;br /&gt;
&lt;br /&gt;
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. &lt;br /&gt;
&lt;br /&gt;
== Installing unoconv on Linux ==&lt;br /&gt;
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:&lt;br /&gt;
&lt;br /&gt;
(Ubuntu 16.04 LTS)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get install unoconv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.&lt;br /&gt;
&lt;br /&gt;
Potential problems:&lt;br /&gt;
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).&lt;br /&gt;
* If you are still running 14.04LTS then unoconv won&#039;t work as shipped. This might not be the most efficient route but it worked by installing unoconv from the package manager as above. You will need to grab unoconv 0.7 from Github (https://github.com/dagwieers/unoconv), then upgrade to the latest libreoffice using the PPA (https://launchpad.net/~libreoffice/+archive/ubuntu/ppa). Point moodle at the Github version of unoconv. You need to modify the Python unoconv file by changing &#039;python&#039; in the first line to &#039;python3&#039;. You also need to change the permissions on the directory /var/www so that the user www-data can write to it (www-data needs to write to its home directory which it cannot do by default).&lt;br /&gt;
&lt;br /&gt;
== Installing unoconv on OS X ==&lt;br /&gt;
Download and install LibreOffice for Mac. Make sure to run it and verify it is working before continuing.&lt;br /&gt;
&lt;br /&gt;
Get the latest version of the unoconv python script. One way to do this is with [[http://brew.sh/ brew]].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install unoconv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t done it already - install ghostscript. One way to install ghostscript is also with [[http://brew.sh/ brew]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install ghostscript&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the paths to unoconv and ghostscript in Moodle (Site administration ▶︎ Server ▶︎ System paths ). If you used brew, they will both be installed to /usr/local/bin.&lt;br /&gt;
&lt;br /&gt;
== Installing unoconv on Windows ==&lt;br /&gt;
Download and install LibreOffice for windows.&lt;br /&gt;
&lt;br /&gt;
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. &lt;br /&gt;
&lt;br /&gt;
Rename the downloaded script to C:\unoconv\unoconv.py&lt;br /&gt;
&lt;br /&gt;
Create a batch file C:\unoconv\unoconv.bat with these contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@cd &amp;quot;C:\Program Files (x86)\LibreOffice 5\program&amp;quot;&lt;br /&gt;
@&amp;quot;python-core-3.3.0\bin\python.exe&amp;quot; unoconv.py %* &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set paths in Moodle. &lt;br /&gt;
&lt;br /&gt;
Login as admin and go to Site administration ► Server ► System paths&lt;br /&gt;
&lt;br /&gt;
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)&lt;br /&gt;
&lt;br /&gt;
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)&lt;br /&gt;
&lt;br /&gt;
Test ghostscript and unoconv are working correctly in the admin test pages &amp;quot;Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Run a unoconv listener ==&lt;br /&gt;
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it&#039;s request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.&lt;br /&gt;
&lt;br /&gt;
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.&lt;br /&gt;
&lt;br /&gt;
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]&lt;br /&gt;
&lt;br /&gt;
== Offload processing to a different server ==&lt;br /&gt;
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.&lt;br /&gt;
&lt;br /&gt;
How to do this:&lt;br /&gt;
&lt;br /&gt;
Install unoconv on each webservers and the remote server following the installation instructions above. &lt;br /&gt;
&lt;br /&gt;
Make sure unoconv is started at boot time on the remote server with the &amp;quot;--listener&amp;quot; argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). &lt;br /&gt;
&lt;br /&gt;
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.&lt;br /&gt;
&lt;br /&gt;
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. &lt;br /&gt;
&lt;br /&gt;
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# Wrapper script for unoconv to forward processing.&lt;br /&gt;
# Install to /usr/bin/unoconv-remote with 755 permissions&lt;br /&gt;
/usr/bin/unoconv --server=&amp;lt;ip of remote server&amp;gt; &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.&lt;br /&gt;
&lt;br /&gt;
[[Category:Site administration]]&lt;br /&gt;
{{Installing_Moodle}}&lt;br /&gt;
&lt;br /&gt;
[[es:mod/assign/feedback/editpdf/testunoconv]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Cron&amp;diff=119566</id>
		<title>Cron</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Cron&amp;diff=119566"/>
		<updated>2015-08-10T11:57:28Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Working out the Moodle cron command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
The Moodle &#039;cron&#039; process is a PHP script (part of the standard Moodle installation) that must be run regularly in the background.   The Moodle cron script runs different tasks at differently scheduled intervals.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: Do not skip setting up the cron process on your server for your Moodle. Your site will not work properly without it&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A special program (typically called - not surprisingly - &#039;cron&#039;) is used to run the Moodle cron script at a regular interval.  The Moodle cron script runs tasks include sending mail, updating Moodle reports, RSS feeds, activity completions, posting forum messages and other tasks. Since different tasks have different schedules, not every task will run in Moodle when the cron script is triggered. &lt;br /&gt;
&lt;br /&gt;
The cron program (that runs the Moodle script) is a core part of Unix based systems (including Linux and OSX) being used to run all manner of time-dependent services. On Windows the simplest solution is to create a task in the Windows Task Scheduler and set it to run at regular intervals. On shared hosting, you should find the documentation (or ask support) how cron is configured. &lt;br /&gt;
&lt;br /&gt;
Essentially, the task involves adding a single command to the list of cron activities on your system. On Unix based systems this list is a file called a &#039;crontab&#039; which all users have.  &lt;br /&gt;
&lt;br /&gt;
== General discussion ==&lt;br /&gt;
&lt;br /&gt;
See the later sections for your server type; this section contains some general background information. &lt;br /&gt;
&lt;br /&gt;
There are essentially two steps to implementing cron:&lt;br /&gt;
# identifying the correct command to run&lt;br /&gt;
# finding the right place on your system to put the command&lt;br /&gt;
&lt;br /&gt;
=== Working out the Moodle cron command ===&lt;br /&gt;
&lt;br /&gt;
Moodle has two different ways to deploy cron which use different scripts within the Moodle install. These are as follows...&lt;br /&gt;
# The CLI (command line interpreter) script. This will be at the path &amp;lt;pre&amp;gt;/path/to/moodle/admin/cli/cron.php&amp;lt;/pre&amp;gt; If in doubt, this is the correct script to use. This needs to be run by a &#039;PHP CLI&#039; program on your computer. So the final command may look something like &amp;lt;pre&amp;gt;/usr/bin/php /path/to/moodle/admin/cli/cron.php&amp;lt;/pre&amp;gt; You can (and should) try this on your command line to see if it works. &#039;&#039;&#039;WARNING: Check your command-line PHP version is compatible with your chosen version of Moodle. The command-line PHP program is different to the one running your web site and is not always the same version.&#039;&#039;&#039;&lt;br /&gt;
# The web based script. This needs to be run from a web browser and will be accessed via a web url something like &#039;&#039;&#039;http://your.moodle.site/admin/cron.php&#039;&#039;&#039;. You can find command line based web browser (e.g. wget) so the final command may look like &amp;lt;pre&amp;gt;/usr/bin/wget http://your.moodle.site/admin/cron.php&amp;lt;/pre&amp;gt; This has the advantage that it can be run from *anywhere*. If you can&#039;t get cron to work on your machine it can be run somewhere else.&lt;br /&gt;
&lt;br /&gt;
===The web based Moodle cron command===&lt;br /&gt;
* As of Moodle 2.9, the cron job can no longer be run from web by default. You will get an error message:&lt;br /&gt;
 !!! Sorry, internet access to this page has been disabled by the administrator. !!! &lt;br /&gt;
* You can change this in &#039; Dashboard ► Site administration ► Security ► Site policies &#039; by deselecting &#039;Cron execution via command line only&#039;.&lt;br /&gt;
** You will be warned that &#039;Running the cron from a web browser can expose privileged information to anonymous users. Thus it is recommended to only run the cron from the command line or set a cron password for remote access.&#039;&lt;br /&gt;
** You can then write a &#039;Cron password for remote access&#039;. If this field is left empty, no password is required.&lt;br /&gt;
** This means that the cron.php script cannot be run from a web browser without supplying the password using the following form of URL:&lt;br /&gt;
  http://site.example.com/admin/cron.php?password=opensesame&lt;br /&gt;
&lt;br /&gt;
=== Finding the right place to put the command ===&lt;br /&gt;
&lt;br /&gt;
This really does depend on the system you are using and you should find and read the documentation for your platform or hosting. In most cases getting the Moodle cron to run consists of establishing the correct command (above) and then adding it, and the time to run the command, to some sort of file. This might be either through a specific user interface or by editing the file directly.&lt;br /&gt;
&lt;br /&gt;
If using the CLI version you also need to make sure that the cron process is run as the correct user. This is not an issue with the web version. &lt;br /&gt;
&lt;br /&gt;
Example... installing cron on Ubuntu/Debian Linux. Assuming logged in as root..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;use the crontab command to open a crontab editor window for the www-data user. This is the user that Apache (the web server) runs as on Debian based systems&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ crontab -u www-data -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;This will open an editor window. To run the cli cron script every 1 minute, add the line:&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*/1 * * * * /usr/bin/php  /path/to/moodle/admin/cli/cron.php &amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE: the final &#039;&#039;&#039;&amp;gt;/dev/null&#039;&#039;&#039; sends all the output to the &#039;bin&#039; and stops you getting an email every 1 minute.&lt;br /&gt;
&lt;br /&gt;
== Setting up cron on your system ==&lt;br /&gt;
 &lt;br /&gt;
Choose the information for your server type:&lt;br /&gt;
&lt;br /&gt;
*[[Cron with Unix or Linux]]- Cron services on various UNIX and Linux flavored operating systems.&lt;br /&gt;
*[[Cron with Windows OS]] - Cron services in Windows&lt;br /&gt;
*&#039;&#039;Apple OSX&#039;&#039; - use the built-in &#039;crontab&#039; service which is exactly the same as [[Cron with Unix or Linux]]. However, you might want to do it the &#039;Apple way&#039; using launchd - see [[Cron with MAC OS X]]&lt;br /&gt;
*[[Cron with web hosting services]]- Cron services in various web hosting examples.&lt;br /&gt;
&lt;br /&gt;
Here are some more instructions for specific hosts (please check that these are up to date):&lt;br /&gt;
&lt;br /&gt;
*[[Cron on 1and1 shared servers]]&lt;br /&gt;
&lt;br /&gt;
== Using third party cron service ==&lt;br /&gt;
 &lt;br /&gt;
Besides using cron hosted on your own server, you may use third party cron service (usually called webcron):&lt;br /&gt;
&lt;br /&gt;
*[https://cron-job.org/ cron-job.org] is a free service. (1Minute cron is possible)&lt;br /&gt;
&lt;br /&gt;
*[https://www.easycron.com EasyCron] - A webcron service provider that eliminates the need of crontab or other task schedulers to set cron job.&lt;br /&gt;
&lt;br /&gt;
=== Cron settings in Moodle ===&lt;br /&gt;
&lt;br /&gt;
An admin can set cron execution via command line only or a cron password for remote access in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Remote cron===&lt;br /&gt;
Using the &#039;web based&#039; version of cron it is perfectly ok to place the cron process on a different machine to the Moodle server. For example, the cron service on a Unix server can invoke the cron web &#039;page&#039; on a Windows based Moodle server.&lt;br /&gt;
&lt;br /&gt;
==Scheduling tasks==&lt;br /&gt;
An administrator can schedule cron tasks very precisely from Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks, see [[Scheduled tasks]]&lt;br /&gt;
&lt;br /&gt;
==Running cron for several Moodle servers==&lt;br /&gt;
* Tasks can run in parallel and processes use locking to prevent tasks from running at the same time which allows cron to be triggered from multiple web servers that serve the same Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* If you are running different Moodle instances on the same server, then each Moodle instance needs a cron job. (Even a single Apache web server can run different Moodle instances on different domains by using its virtual hosts capability [https://httpd.apache.org/docs/2.2/vhosts/index.html https://httpd.apache.org/docs/2.2/vhosts/index.html].)&lt;br /&gt;
&lt;br /&gt;
== Debugging Scheduled Tasks ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, a particular cron task may not be working correctly. In Moodle versions before 2.7 - any cron task that was throwing exceptions would prevent the rest of cron from running. The only way to monitor if cron was completing each time, was to add some automated checking of the output of running cron (e.g. searching for the string &amp;quot;Cron completed at &amp;quot;).&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.7 and later, a single failing scheduled task will not prevent the remaining tasks from completing. When any single scheduled task fails, it is marked as a failure, and scheduled to be reattempted. If the task keeps failing, the next scheduled time will be backed off until it is attempted at most once every 24 hours. But checking the [[Scheduled tasks]] admin page, you can see if any task is currently failing (it will have a non-zero fail delay - which is the number of seconds to wait before reattempting a failed task). A simple way to debug a failing task, is to run it immediately using the [[Administration via command line#Scheduled_tasks|cli scheduled task runner]] and monitor the output.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [http://www.coursebit.net/moodle-cron-job/ All About the Moodle Cron Job]&lt;br /&gt;
* [https://docs.moodle.org/32/en/Scheduled_tasks Scheduled tasks Moodle docs]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Cron Wikipedia article on cron function]&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=41827 Cron - can someone give me a quick confirmation of function?]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=97684 Cronjob Question]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=97457 Slow cron : avoiding simultaneous cron]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=117168 Visibility of cron.php]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=139263#p609060 How to log the output of a Scheduled Task on Windows] - this discussion explains a nice trick that can be very useful when you are experiencing problems with your Windows Scheduled Task and you need to log the output of the Scheduled Task to a log file.&lt;br /&gt;
&lt;br /&gt;
[[es:Cron]]&lt;br /&gt;
[[fr:Cron]]&lt;br /&gt;
[[ja:Cron]]&lt;br /&gt;
[[de:Cron-Job]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Video&amp;diff=119565</id>
		<title>Video</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Video&amp;diff=119565"/>
		<updated>2015-08-10T10:48:26Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Working with media}}&lt;br /&gt;
*Video is a very powerful tool to use in a Moodle course, allowing students, for example to catch up on lectures they missed, learn from a &amp;quot;how to&amp;quot; screencast, or improve their language skills  by watching native speakers interact.&lt;br /&gt;
*For a discussion on the best type of video file for Moodle, see [http://moodle.org/mod/forum/discuss.php?d=143478| here]&lt;br /&gt;
&#039;&#039;&lt;br /&gt;
*For a discussion of the best programs for creating screencasts, see [http://moodle.org/mod/forum/discuss.php?d=147891| here]&lt;br /&gt;
&lt;br /&gt;
==Where to host the videos==&lt;br /&gt;
&lt;br /&gt;
*Whenever possible, it is preferable to upload your videos to Moodle, storing them on your own server as you retain ultimate control. However, when server space or upload limits are restricted, it is convenient to upload videos to an online site like youtube [http://www.youtube.com] or  Vimeo[http://vimeo.com]. They can easily be embedded inside Moodle from such sites and privacy can still be maintained if you choose their private video sharing option.&lt;br /&gt;
&lt;br /&gt;
===Cross domain video hosting===&lt;br /&gt;
&lt;br /&gt;
Flash video players require permission to play videos hosted on a different URL, e.g. yourmoodle.org needs permission to play video files hosted at yourvideo.org. The permission files are stored on the root domain of where the video files are hosted, e.g. yourvideos.org/crossdomain.xml. If yourvideos.org does not have a cross domain policy file that permits yourmoodle.org to play videos, Flash Player will not permit it. Further details are available here [http://code.google.com/p/moodle-mplayer/wiki/CrossDomainSecurity].&lt;br /&gt;
&lt;br /&gt;
Many public video hosting services, such as YouTube.com, already have catch-all cross domain policy files in place and so videos can be played from them via your Moodle without any cross domain security issues arising.&lt;br /&gt;
&lt;br /&gt;
==Ways of displaying video==&lt;br /&gt;
&lt;br /&gt;
===Linking to a video online elsewhere===&lt;br /&gt;
*If your video is hosted elsewhere online (such as youtube) you can simply link to the relevant page by choosing &#039;&#039;Add a resource&amp;gt;[[URL|URL]]&#039;&#039; and pasting in the relevant link.&lt;br /&gt;
*For more information, see [[URL|URL]]&lt;br /&gt;
*Note that, in an establishment where certain video sharing sites might be banned, your students might not be able to access your video through Moodle.&lt;br /&gt;
&lt;br /&gt;
===Uploading a video for students to download===&lt;br /&gt;
*Choose this option if you wish to upload your video to Moodle and give users the option to download it to their own computers.&lt;br /&gt;
*Choose &#039;&#039;Add an activity or  resource&amp;gt;[[File|File]]&#039;&#039;&lt;br /&gt;
*For more information, see [[File|File]]&lt;br /&gt;
*Note that the way the video will display depends on the software the user has on their own computer. This could mean that some students might be unable to view your video. (See this discussion [http://moodle.org/mod/forum/discuss.php?d=143478| here])&lt;br /&gt;
&lt;br /&gt;
===Embedding a video in its own player===&lt;br /&gt;
*Moodle has an inbuilt video player called Flowplayer. If the [[Multimedia plugins filter|multimedia plugins filter]] is enabled by the administrator, videos embedded into the text editor will play inline in Flowplayer.&lt;br /&gt;
*Anywhere that Moodle&#039;s  text editor is available, it is possible to embed a video, for example in a [[Label|label]] or a [[Page|page]], a course topic summary, a [[Description_question_type| quiz description]] or a [[Lesson|lesson]].&lt;br /&gt;
*One exception seems to be MP4 files.  They don&#039;t seem to play in Flowplayer unless hacked.  See discussion here: http://moodle.org/mod/forum/discuss.php?d=208849&lt;br /&gt;
&lt;br /&gt;
====Using the Moodle media icon====&lt;br /&gt;
*With your editing turned on, click into the HTML editor where you wish to embed your video. &lt;br /&gt;
*Click the Moodle media icon as in the following screenshot:&lt;br /&gt;
[[File:Addmedia.png]]&lt;br /&gt;
*Click &#039;&#039;Browse repositories&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:attomediaupload.png]]&lt;br /&gt;
&lt;br /&gt;
*The file picker will appear:&lt;br /&gt;
[[File:Filepickermedia.png]]&lt;br /&gt;
*Either click &#039;&#039;Upload a file&#039;&#039; to upload from your computer or choose the appropriate repository from which you wish to bring in your video. (What you see will depend on what the Moodle admin has enabled)&lt;br /&gt;
*Note: &#039;&#039;&#039;To search for and embed a video from youtube, [[Youtube_videos|see here]]&#039;&#039;&#039;&lt;br /&gt;
*Change the &#039;&#039;save as/author/license&#039;&#039; settings if desired and click &#039;&#039;upload this file&#039;&#039; or &#039;&#039;select this file&#039;&#039;&lt;br /&gt;
*Your video will appear in a preview player. Click &#039;&#039;Insert&#039;&#039; at the bottom&lt;br /&gt;
*&#039;&#039;&#039;&#039;&#039;Don&#039;t panic&#039;&#039;!&#039;&#039;&#039; You will now only get a blue text link of your video:&lt;br /&gt;
[[File:Moodletvgirlpreview.png]]&lt;br /&gt;
*When you click &#039;&#039;save changes&#039;&#039; to return to the main course page, your video will display:&lt;br /&gt;
[[File:Moodletvgirl2.png]]&lt;br /&gt;
&lt;br /&gt;
====Using a hyperlink====&lt;br /&gt;
(Note - this method has no advantage over using the  media icon, but was popular in older versions of Moodle)&lt;br /&gt;
*With your editing turned on, click into the HTML editor where you wish to embed your video.&lt;br /&gt;
*Type some blank spaces (or some text) and select them.&lt;br /&gt;
*Click the hyperlink icon as in the following screenshot.(The icon will only be clickable if you have selected text or spaces)&lt;br /&gt;
[[File:Hyperlinkicon.png]]&lt;br /&gt;
*Click &#039;Browse repositories&#039;&lt;br /&gt;
*This takes you to the file picker. Follow the instructions for uploading/selecting your video as for using the Moodle media icon.&lt;br /&gt;
*When your video is chosen, it will appear in the link URL box as below. Click &#039;&#039;Insert:&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;&#039;&#039;Don&#039;t panic!&#039;&#039;&#039;&#039;&#039; You will now only get a blue line (if you selected blank spaces) or the actual text underlined in the HTML editor:&lt;br /&gt;
[[File:linklinkatto.png]]&lt;br /&gt;
*When you click &#039;&#039;save changes&#039;&#039; to return to the main course page, your video will display.&lt;br /&gt;
&lt;br /&gt;
====Using embed code to display external videos====&lt;br /&gt;
*Go to your chosen video sharing site and find the embed code of the video you wish to display. Copy this code.&lt;br /&gt;
*With your editing turned on, click into the HTML editor where you wish to embed your video.&lt;br /&gt;
*Click the HTML code icon as in the following screenshot:&lt;br /&gt;
[[File:Htmlcodeicon.png]]&lt;br /&gt;
*Paste your embed code into the box:&lt;br /&gt;
[[File:Embedcode.png]]&lt;br /&gt;
*Scroll down and click &amp;quot;update&amp;quot;.&lt;br /&gt;
*Your video will be previewed in the HTML editor. Click &#039;&#039;save changes&#039;&#039; for it to display on the page&lt;br /&gt;
[[File:Youtubevideo.png]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Video_FAQ|Video FAQ]]&lt;br /&gt;
*[[Multimedia plugins filter]]&lt;br /&gt;
*[http://www.mguhlin.org/2012/01/embedding-videos-in-moodle-22.html Embedding Videos in #Moodle 2.2] blog post from Miguel Guhlin&lt;br /&gt;
*[[Videofile]] plugin with multilanguage captions capability&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=317841 Moodle.org forum discussion about players and encoding]&lt;br /&gt;
&lt;br /&gt;
[[de:Video]]&lt;br /&gt;
[[es:Video]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Upload_courses&amp;diff=114281</id>
		<title>Upload courses</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Upload_courses&amp;diff=114281"/>
		<updated>2014-08-24T09:35:32Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Course information fields */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Courses}}&lt;br /&gt;
An administrator can upload multiple courses via text file in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Courses &amp;gt; Upload courses&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In addition to creating new courses, this functionality may also be used to update or delete courses, or import content from another course. For information on using this functionality to create course templates, see [[Adding a new course]]&lt;br /&gt;
&lt;br /&gt;
==Upload courses==&lt;br /&gt;
&lt;br /&gt;
To upload one or more courses&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Courses &amp;gt; Upload courses&#039;&#039;&lt;br /&gt;
# Either drag and drop the CSV file or click the &#039;Choose a file&#039; button and select the file in the file picker&lt;br /&gt;
# Select appropriate import options carefully, then click the preview button.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:26uploadcourses.png|250px|thumb|Upload courses admin screen]]&lt;br /&gt;
|&lt;br /&gt;
|[[File:uploadcoursesresults.png|250px|thumb|Courses successfully uploaded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: It is also possible to use the command-line tool &#039;&#039;admin/tool/uploadcourse/cli/uploadcourse.php&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
When using the web interface, use the &#039;&#039;Preview&#039;&#039; option to see if any errors were detected in the previewed rows. If you proceed with the upload and there were something wrong detected with a course, it will be ignored.&lt;br /&gt;
&lt;br /&gt;
=== Short file example ===&lt;br /&gt;
uploadcourse.csv:&lt;br /&gt;
&lt;br /&gt;
Note: shortname, fullname, and category are required.&lt;br /&gt;
&lt;br /&gt;
The category field takes the id of the category, with the default category Miscellaneous having id 1. Categories must already exist. If you put a category id that does not exist, you will receive a &amp;quot;Could not resolve category by ID&amp;quot; error during upload preview, and courses in that category will not be created. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
shortname,fullname,category,summary,enrolment_1,enrolment_1_role,enrolment_1_enrolperiod,role_student&lt;br /&gt;
courserestored,Course restored,1,a summary,manual,student,1 month,&lt;br /&gt;
courserestored2,Course restored 2,1,a summary,,,,&lt;br /&gt;
courserestored3,Course restored 3,1,a summary,,,,padawan&lt;br /&gt;
courserestored4,Course restored 4,1,&amp;quot;a summary, with comma&amp;quot;,manual,student,1 month,padawan&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Notice there are no spaces between the items.&lt;br /&gt;
&lt;br /&gt;
==Creating the text file==&lt;br /&gt;
&lt;br /&gt;
The text file to upload courses must be a CSV file. It accepts the following columns which are divided in two categories, the course information, and the course actions.&lt;br /&gt;
&lt;br /&gt;
===Course information fields===&lt;br /&gt;
&lt;br /&gt;
Most of those settings are available on the settings page of a course. Please refer to [[Course settings]] for more information. Field names must be lower-case.&lt;br /&gt;
&lt;br /&gt;
;shortname&lt;br /&gt;
: The shortname&lt;br /&gt;
;fullname&lt;br /&gt;
: The full name&lt;br /&gt;
;idnumber&lt;br /&gt;
: The ID number&lt;br /&gt;
;category&lt;br /&gt;
: The ID of the category to place the course in. This takes precedence over &#039;&#039;category_idnumber&#039;&#039; and &#039;&#039;category_path&#039;&#039;.&lt;br /&gt;
;category_idnumber&lt;br /&gt;
: The ID number of the category to place the course in. This takes precedence over &#039;&#039;category_path&#039;&#039;.&lt;br /&gt;
;category_path&lt;br /&gt;
: The path of the category to place the course in. If you want to place the course in a category named &amp;quot;Science-Fiction&amp;quot; which is located under the category &amp;quot;Movies&amp;quot;, the value to provide is: &amp;lt;code&amp;gt;Movies / Science-Fiction&amp;lt;/code&amp;gt;. Note that the separator must be &amp;lt;code&amp;gt;[space]/[space]&amp;lt;/code&amp;gt;. Also note that the category MUST exist, it will not be created.  If you want to place the course in the top-level category &amp;quot;Movies&amp;quot;, the value to provide is: &amp;lt;code&amp;gt;Movies&amp;lt;/code&amp;gt;&lt;br /&gt;
;visible&lt;br /&gt;
: 1 if the course is visible, 0 if hidden&lt;br /&gt;
;startdate&lt;br /&gt;
: The time at which the course starts. Please note that this value is passed to the PHP function [http://php.net/manual/en/function.strtotime.php strtotime] to generate a timestamp. Example 01.12.2014 (1st December 2014)&lt;br /&gt;
;summary&lt;br /&gt;
: The summary of the course&lt;br /&gt;
;format&lt;br /&gt;
: The course format to use, this must be a valid course format plugin name. E.g. &#039;&#039;weeks&#039;&#039;, &#039;&#039;topics&#039;&#039;.&lt;br /&gt;
;theme&lt;br /&gt;
: The theme to use&lt;br /&gt;
;lang&lt;br /&gt;
: The language to use&lt;br /&gt;
;newsitems&lt;br /&gt;
: The number of news items&lt;br /&gt;
;showgrades&lt;br /&gt;
: 1 to show the gradebook to students, 0 to hide it.&lt;br /&gt;
;showreports&lt;br /&gt;
: 1 to show the activity reports, 0 to hide it.&lt;br /&gt;
;legacyfiles&lt;br /&gt;
: 1 to enable the legacy course files, 0 not to.&lt;br /&gt;
;maxbytes&lt;br /&gt;
: The maximum upload size of the course in bytes. Use 0 for the site limit.&lt;br /&gt;
;groupmode&lt;br /&gt;
: 0 for &#039;&#039;No groups&#039;&#039;, 1 for &#039;&#039;Separate groups&#039;&#039; and 2 for &#039;&#039;Visible groups&#039;&#039;.&lt;br /&gt;
;groupmodeforce&lt;br /&gt;
: 1 to force the group mode, otherwise enter 0.&lt;br /&gt;
;enablecompletion&lt;br /&gt;
: 1 to enable the activity completion, 0 not to.&lt;br /&gt;
&lt;br /&gt;
====Enrolment fields====&lt;br /&gt;
&lt;br /&gt;
Some fields can be constructed to enable and configure enrolment methods. The fields must be named &#039;&#039;enrolment_[number]&#039;&#039; for the enrolment method name, and &#039;&#039;enrolment_[number]_property&#039;&#039; for its properties.&lt;br /&gt;
&lt;br /&gt;
;enrolment_[number]&lt;br /&gt;
: The name of the enrolment method&lt;br /&gt;
;enrolment_[number]_delete&lt;br /&gt;
: 1 to delete this enrolment method from the course, if set to 1 all the other properties will be ignored.&lt;br /&gt;
;enrolment_[number]_disable&lt;br /&gt;
: 1 to disable this enrolment method from the course, if set to 1 all the other properties will be ignored.&lt;br /&gt;
;enrolment_[number]_startdate&lt;br /&gt;
: The enrolment start date. This value is passed to the PHP function strtotime().&lt;br /&gt;
;enrolment_[number]_enddate&lt;br /&gt;
: The enrolment end date. This value is passed to the PHP function strtotime().&lt;br /&gt;
;enrolment_[number]_enrolperiod&lt;br /&gt;
: Number of seconds, or if not a value understood by strtotime() such as &amp;quot;4 days&amp;quot;.&lt;br /&gt;
;enrolment_[number]_role&lt;br /&gt;
: The role short name&lt;br /&gt;
;enrolment_[number]_[property]&lt;br /&gt;
: Where property is understood by the specified enrolment method&lt;br /&gt;
;enrolment_[number]_password&lt;br /&gt;
: The course enrolment key&lt;br /&gt;
&lt;br /&gt;
Note: Upload courses is not yet compatible with all [[Enrolments|enrolment methods]] (MDL-43127).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 enrolment_1: manual&lt;br /&gt;
 enrolment_1_role: student&lt;br /&gt;
 enrolment_1_enrolperiod: 1 month&lt;br /&gt;
 &lt;br /&gt;
 enrolment_2: self&lt;br /&gt;
 enrolment_2_startdate: 2013-01-30&lt;br /&gt;
&lt;br /&gt;
====Role renaming====&lt;br /&gt;
&lt;br /&gt;
To rename some roles, using the following pattern:&lt;br /&gt;
&lt;br /&gt;
;role_[shortname]&lt;br /&gt;
: The new name of the role &#039;&#039;[shortname]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 role_student: Apprentice&lt;br /&gt;
 role_teacher: Master&lt;br /&gt;
 role_mycustomrole: Jedi&lt;br /&gt;
&lt;br /&gt;
It is worth noting that the short name for the teacher role is &#039;&#039;editingteacher&#039;&#039; and the short name for the non-editing teacher is &#039;&#039;teacher&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Course action fields===&lt;br /&gt;
&lt;br /&gt;
Those settings take precedence over the &#039;&#039;Course process&#039;&#039; parameters.&lt;br /&gt;
&lt;br /&gt;
;delete&lt;br /&gt;
: 1 to delete the course &lt;br /&gt;
;rename&lt;br /&gt;
: The shortname to rename the course to&lt;br /&gt;
;backupfile&lt;br /&gt;
: An absolute path to a backup file (.mbz) to import in the course&lt;br /&gt;
;templatecourse&lt;br /&gt;
: The short name of a course to import the content from&lt;br /&gt;
;reset&lt;br /&gt;
: 1 to reset the course&lt;br /&gt;
&lt;br /&gt;
===Mandatory fields===&lt;br /&gt;
&lt;br /&gt;
;shortname&lt;br /&gt;
: This field is mandatory for every operation, with the only exception of creating new courses. See details on the course process parameter &#039;&#039;Shortname template&#039;&#039; for more information.&lt;br /&gt;
;fullname&lt;br /&gt;
: Required when creating a new course.&lt;br /&gt;
;category, category_idnumber, category_path&lt;br /&gt;
: One of these is required when creating a course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Import options===&lt;br /&gt;
&lt;br /&gt;
To prevent unexpected behaviour, you have to specify what you want the tool to be able to do.&lt;br /&gt;
&lt;br /&gt;
;Upload mode&lt;br /&gt;
: This allows you to specify if courses can be created and/or updated.&lt;br /&gt;
;Update mode&lt;br /&gt;
: If you allow courses to be updated, you also have to tell the tool what to update the courses with.&lt;br /&gt;
;Allow deletes&lt;br /&gt;
: Whether the &#039;&#039;delete&#039;&#039; field is accepted or not&lt;br /&gt;
;Allow renames&lt;br /&gt;
: Whether the &#039;&#039;rename&#039;&#039; field is accepted or not&lt;br /&gt;
;Allow resets&lt;br /&gt;
: Whether the &#039;&#039;reset&#039;&#039; field is accepted or not&lt;br /&gt;
&lt;br /&gt;
===Course process===&lt;br /&gt;
&lt;br /&gt;
This allows you to specify actions to be taken for every course uploaded.&lt;br /&gt;
&lt;br /&gt;
;Shortname template&lt;br /&gt;
: If you are creating courses without a shortname, you can use this field to automatically generate a shortname. This field accepts two placeholders: %i for the ID number, %f for the summary.&lt;br /&gt;
;Restore file&lt;br /&gt;
: A backup file (.mbz) to import in the course after create/update.&lt;br /&gt;
;Restore from course&lt;br /&gt;
: The shortname of a course to import content from after create/update.&lt;br /&gt;
;Reset after upload&lt;br /&gt;
: Whether to reset the course after creating/updating it.&lt;br /&gt;
&lt;br /&gt;
===Default course values===&lt;br /&gt;
&lt;br /&gt;
Those are values that can be set in the web interface for all the fields that are not specified in the CSV file. Note that they are always used when creating a course, but only when specified during update (see &#039;&#039;Update mode&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
==Increasing speed==&lt;br /&gt;
&lt;br /&gt;
When importing the content of a backup file, or another course, you are advised to enable the setting &#039;&#039;keeptempdirectoriesonbackup&#039;&#039;. This will considerably speed up the process of the upload if you are importing multiple times from the same source.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* Demo screencast: [http://youtu.be/MzK2jb-9SwE Bulk course creation]&lt;br /&gt;
* [[Upload users]]&lt;br /&gt;
* [http://www.moodleblog.net/2013/11/24/creating-course-templates-in-moodle-2-6/ Creating course templates in Moodle 2.6] blog post by Mary Cooch&lt;br /&gt;
&lt;br /&gt;
[[de:Kurse hochladen]]&lt;br /&gt;
[[es:Subir cursos]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Caching&amp;diff=113033</id>
		<title>Caching</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Caching&amp;diff=113033"/>
		<updated>2014-06-10T08:30:10Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
A cache is a collection of processed data that is kept on hand and re-used in order to avoid costly repeated database queries.&lt;br /&gt;
&lt;br /&gt;
Moodle 2.4 saw the implementation of MUC, the Moodle Universal Cache. This new system allows certain functions of Moodle (eg string fetching) take advantage of different installed cache services (eg files, ram, memcached).&lt;br /&gt;
&lt;br /&gt;
In future versions of Moodle we will continue expanding the number of Moodle functions that use MUC, which will continue improving performance, but you can already start using it to improve your site.&lt;br /&gt;
&lt;br /&gt;
==General approach to performance testing==&lt;br /&gt;
&lt;br /&gt;
Here is the general strategy you should be taking:&lt;br /&gt;
&lt;br /&gt;
# Build a test environment that is as close to your real production instance as possible (eg hardware, software, networking, etc)&lt;br /&gt;
# Make sure to remove as many uncontrolled variables as you can from this environment (eg other services)&lt;br /&gt;
# Use a tool to place a realistic, but simulated and repeatable load upon you server. (eg jmeter or selenium).&lt;br /&gt;
# Decide on a way to measure performance of the server by capturing data (ram, load, time taken, etc)&lt;br /&gt;
# Run your load and measure a baseline performance result.&lt;br /&gt;
# Change one variable at a time, and re-run the load to see if performance gets better or worse.  Repeat as necessary.&lt;br /&gt;
# When you discover settings that result in a consistent performance improvement, apply to your production site.&lt;br /&gt;
&lt;br /&gt;
==Cache configuration in Moodle==&lt;br /&gt;
&lt;br /&gt;
Since Moodle 2.4, Moodle has provided a caching plugin framework to give administrators the ability to control where Moodle stores cached data. For most Moodle sites the default configuration should be sufficient and it is not necessary to change the configuration. For larger Moodle sites with multiple servers, administrators may wish to use memcached, mongodb or other systems to store cache data. The cache plugin screen provides administrators with the ability to configure what cache data is stored where.&amp;lt;br /&amp;gt;&lt;br /&gt;
Caching in Moodle is controlled by what is known as the Moodle Universal Cache. Commonly referred to MUC.&lt;br /&gt;
&lt;br /&gt;
This document explains briefly what MUC is before proceeding into detail about the concepts and configuration options it offers.&lt;br /&gt;
&lt;br /&gt;
==The basic cache concepts in Moodle==&lt;br /&gt;
Caching in Moodle isn&#039;t as complex as it first appears. A little background knowledge will go a long way in understanding how cache configuration works.&lt;br /&gt;
&lt;br /&gt;
===Cache types===&lt;br /&gt;
Lets start with cache types (sometimes referred to as mode). There are three basic types of caches in Moodle.&lt;br /&gt;
&lt;br /&gt;
The first is the application cache. This is by far the most commonly used cache type in code. Its information is shared by all users and its data persists between requests. Information stored here is usually cached for one of two reasons, either it is required information for the majority of requests and saves us a one of more database interactions or it is information that is accessed less frequently but is resource intensive to generate.&amp;lt;br /&amp;gt;&lt;br /&gt;
By default this information is stored in an organised structure within your Moodle data directory.&lt;br /&gt;
&lt;br /&gt;
The second cache type is the session cache. This is just like the PHP session that you will already be familiar with, in fact it uses the PHP session by default. You may be wondering why we have this cache type at all, but the answer is simple. MUC provides a managed means of storing, and removing information that is required between requests. It offers developers a framework to use rather than having to re-invent the wheel and ensures that we have access to a controlled means of managing the cache as required.&amp;lt;br /&amp;gt;&lt;br /&gt;
Its important to note that this isn&#039;t a frequently used cache type as by default session cache data is stored in the PHP session and the PHP session is stored in the database. Uses of the session cache type are limited to small datasets as we don&#039;t want to bloat sessions and thus put strain on the database.&lt;br /&gt;
&lt;br /&gt;
The third and final type is the request cache. Data stored in this cache type only persists for the lifetime of the request. If you&#039;re a PHP developer think of it like a managed static variable.&amp;lt;br /&amp;gt;&lt;br /&gt;
This is by far the least used of the three cache types, uses are often limited to information that will be accessed several times within the same request, usually by more than area of code.&lt;br /&gt;
Cached information is stored in memory by default.&lt;br /&gt;
&lt;br /&gt;
==== Cache types and multiple-server systems ====&lt;br /&gt;
&lt;br /&gt;
If you have a system with multiple front-end web servers, the application cache must be shared between the servers. In other words, you cannot use fast local storage for the application cache, but must use shared storage or some other form of shared cache such as a shared memcache.&lt;br /&gt;
&lt;br /&gt;
The same applies to session cache, unless you use a &#039;sticky sessions&#039; mechanism to ensure that within a session, users always access the same front-end server.&lt;br /&gt;
&lt;br /&gt;
===Cache backends===&lt;br /&gt;
Cache backends are where data actually gets stored. These include things like the file system, php session, Memcached, and memory.&amp;lt;br /&amp;gt;&lt;br /&gt;
By default just file system, php session, and memory are used within Moodle.&amp;lt;br /&amp;gt;&lt;br /&gt;
We don&#039;t require that a site has access to any other systems such a Memcached. Instead that is something you are responsible for installing and configuring yourself.&amp;lt;br /&amp;gt;&lt;br /&gt;
When cache backends are mentioned think of systems outside of Moodle that can be used to store data. The MongoDB server, the Memcache server and similiar &amp;quot;server&amp;quot; applications.&lt;br /&gt;
&lt;br /&gt;
===Cache stores===&lt;br /&gt;
Cache stores are a plugin type within Moodle. They facilitate connecting Moodle to the cache backends discussed above.&amp;lt;br /&amp;gt;&lt;br /&gt;
Moodle ships with the three defaults mentioned above as well as Memcache, Memcached, and MongoDB.&amp;lt;br /&amp;gt;&lt;br /&gt;
You can find other cache store plugins in the [https://moodle.org/plugins/browse.php?list=category&amp;amp;id=48 plugins database].&amp;lt;br /&amp;gt;&lt;br /&gt;
The code for these is located within cache/stores in your Moodle directory root.&lt;br /&gt;
&lt;br /&gt;
Within Moodle you can configure as many cache stores as your architecture requires. If you have several Memcache servers for instance you can create an cache store instance for each.&amp;lt;br /&amp;gt;&lt;br /&gt;
Moodle by default contains three cache store instances that get used when you&#039;ve made no other configuration.&lt;br /&gt;
* A file store instance is created which gets used for all application caches. It stores its data in your moodledata directory.&lt;br /&gt;
* A session store instance is created which gets used for all session caches. It stores its data in the PHP session, which by default is stored if your database.&lt;br /&gt;
* A static memory store instance is created which gets used for all request cache types. Data exists in memory for just the lifetime of a request.&lt;br /&gt;
&lt;br /&gt;
===Caches: what happens in code===&lt;br /&gt;
Caches are created in code and are used by the developer to store data they see a need to cache.&amp;lt;br /&amp;gt;&lt;br /&gt;
Lets keep this section nice and short because perhaps you are not a developer. There is one very important point you must know about.&amp;lt;br /&amp;gt;&lt;br /&gt;
The developer does not get any say in where the data gets cached. They must specify the following information when creating a cache to use.&lt;br /&gt;
# The type of cache they require.&lt;br /&gt;
# The area of code this cache will belong to (the API if you will).&lt;br /&gt;
# The name of the cache, something they make up to describe in one word what the cache stores.&lt;br /&gt;
&lt;br /&gt;
There are several optional requirements and settings they can specify as well, but don&#039;t worry about that at this point.&amp;lt;br /&amp;gt;&lt;br /&gt;
The important point is that they can&#039;t choose which cache backend to use, they can only choose the type of cache they want from the three detailed above.&lt;br /&gt;
&lt;br /&gt;
===How it ties together===&lt;br /&gt;
&lt;br /&gt;
This is best described in relation to roles played in an organisation.&lt;br /&gt;
&lt;br /&gt;
# The system administrator installs the cache backends you wish to use. Memcache, XCache, APC and so on.&amp;lt;br /&amp;gt;Moodle doesn&#039;t know about these, they are outside of Moodle&#039;s scope and purely the responsibility of your system administrator.&lt;br /&gt;
# The Moodle administrator creates a cache store instance in Moodle for each backend the site will make use of.&amp;lt;br /&amp;gt;There can be one or more cache stores instances for each backend. Some backends like Memcached have settings to create separated spaces within one backend.&lt;br /&gt;
# The developer has created caches in code and is using them to store data.&amp;lt;br /&amp;gt;He doesn&#039;t know anything about how you will use your caches, he just creates a &amp;quot;cache&amp;quot; and tells Moodle what type it is best for it.&lt;br /&gt;
# The Moodle administrator creates a mapping between a cache store instance and a cache.&amp;lt;br /&amp;gt;That mapping tells Moodle to use the backend you specify to store the data the developer wants cached.&lt;br /&gt;
&lt;br /&gt;
In addition to that you can take things further still.&lt;br /&gt;
* You can map many caches to a single cache store instance.&lt;br /&gt;
* You can map multiple cache store instances to a single cache with priority (primary ... final)&lt;br /&gt;
* You can map a cache store instance to be the default store used for all caches of a specific type that don&#039;t otherwise have specific mappings.&lt;br /&gt;
&lt;br /&gt;
If this is the first time you are reading about the Moodle Universal Cache this probably sounds pretty complex but don&#039;t worry it will be discussed in better detail as we work through how to configure the caching in Moodle.&lt;br /&gt;
&lt;br /&gt;
==Advanced concepts==&lt;br /&gt;
These concepts are things that most sites will not need to know or concern themselves about.&lt;br /&gt;
&lt;br /&gt;
You should only start looking here if you are looking to maximise performance on large sites running over clustered services with shared cache backends, or on multi-site architecure again where information is being shared between sites.&lt;br /&gt;
&lt;br /&gt;
===Locking===&lt;br /&gt;
&lt;br /&gt;
The idea of locking is nothing new, it is the process of controlling access in order to avoid concurrency issues.&lt;br /&gt;
&lt;br /&gt;
MUC has a second type of plugin, a cache lock plugin that gets used when caches require it. To date no caches have required it. A cache by nature is volatile and any information that is absolutely mission critical should be a more permanent data store likely the database.&lt;br /&gt;
&lt;br /&gt;
Nonetheless there is a locking system that cache definitions can require within their options and that will be applied when interacting with a cache store instance.&lt;br /&gt;
&lt;br /&gt;
===Sharing===&lt;br /&gt;
&lt;br /&gt;
Every bit of data that gets stored within a cache has a calculated unique key associated with it.&amp;lt;br /&amp;gt;&lt;br /&gt;
By default part of that key is the site identifier making any content stored in the cache specific to the site that stored it. For most sites this is exactly what you want.&amp;lt;br /&amp;gt;&lt;br /&gt;
However in some situations its beneficial to allow mutiple sites, or somehow linked sites to share cached data.&amp;lt;br /&amp;gt;&lt;br /&gt;
Of course not all caches can be shared, however some certainly can and by sharing you can further reduce load and increase performance by maximising resource use.&lt;br /&gt;
&lt;br /&gt;
This is an advanced feature, if you choose to configure sharing please do so carefully.&lt;br /&gt;
&lt;br /&gt;
To make use of sharing you need to first configure identical cache store instances in the sites you want to share information, and then on each site set the sharing for the cache to the same value.&lt;br /&gt;
&lt;br /&gt;
; Sites with the same site ID : This is the default, it allows for sites with the same site ID to share cached information. It is the most restrictive but is going to work for all caches. All other options carry an element of risk in that you have to ensure the information in the cache is applicable to all sites that will be accessing it.&lt;br /&gt;
; Sites running the same version : All sites accessing the backend that have the same Moodle version can share the information this cache has stored in the cache store.&lt;br /&gt;
; Custom key : For this you manually enter a key to use for sharing. You must then enter the exact same key into the other sites you want to share information.&lt;br /&gt;
; Everyone : The cached data is accessible to all other sites accessing the data. This option puts the ball entirely in the Moodle administrators court.&lt;br /&gt;
&lt;br /&gt;
As an example if you had several Moodle sites all the same version running on server with APC installed you could decide to map the language cache to the APC store and configure sharing for all sites running the same version.&amp;lt;br /&amp;gt;&lt;br /&gt;
The language cache for sites on the same version is safe to share, it is used on practically every page, and APC is extremely fast. These three points may result in a nice wee performance boost for your sites.&lt;br /&gt;
&lt;br /&gt;
==The cache configuration screen==&lt;br /&gt;
&lt;br /&gt;
The cache configuration screen is your one stop shop for configuring caching in Moodle.&amp;lt;br /&amp;gt;&lt;br /&gt;
It gives you an overview of how caching is currently configured for your site and it provides links to all of the actions you can perform to configure caching to your specific needs.&lt;br /&gt;
&lt;br /&gt;
===Accessing the cache configuration screen===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-01-configuration-screen.png|thumb|500px|The cache configuration screen in Moodle 2.6]]&lt;br /&gt;
&lt;br /&gt;
The cache configuration screen can only be accessed by users with the &#039;&#039;moodle/site:config&#039;&#039; capability. By default this is only admins.&amp;lt;br /&amp;gt;&lt;br /&gt;
Once logged in the configuration screen can be found in the Settings block under &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Installed cache stores===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-02-installed-cache-stores.png|thumb|500px|Installed cache stores screenshot]]&lt;br /&gt;
&lt;br /&gt;
This is showing you a list of cache store plugins that you have installed.&amp;lt;br /&amp;gt;&lt;br /&gt;
For each plugin you can quickly see whether it is ready to be used (any php requirements have been met), how many store instances already exist on this site, the cache types that this store can be used for, what features it supports (advanced) and any actions you can perform relating to this store.&lt;br /&gt;
&lt;br /&gt;
Often the only action available is to create a new store instance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Most stores support having multiple instances, however not all as you will see that that the session cache and static request cache do not. For those two stores it does not make sense to have multiple instances.&lt;br /&gt;
&lt;br /&gt;
===Configured store instances===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-03-configured-store-instances.png|thumb|500px|Configured store instances screenshot]]&lt;br /&gt;
&lt;br /&gt;
Here you get a list of the cache store instances on this site.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Store name&#039;&#039;&#039; : The name given to this cache store instance when it is created so that you can recognise it. It can be anything you want and is only used so that you can identify the store instance.&lt;br /&gt;
; &#039;&#039;&#039;Plugin&#039;&#039;&#039; : The cache store plugin of which this is an instance of.&lt;br /&gt;
; &#039;&#039;&#039;Ready&#039;&#039;&#039; : A tick gets shown when all PHP requirements have been met as well as any connection or set-up requirements have been verified.&lt;br /&gt;
; &#039;&#039;&#039;Store mappings&#039;&#039;&#039; : The number of caches this store instance has been mapped to explicitly. Does not include any uses through default mappings (discussed below).&lt;br /&gt;
; &#039;&#039;&#039;Modes&#039;&#039;&#039; : The modes that this cache store instance can serve.&lt;br /&gt;
; &#039;&#039;&#039;Supports&#039;&#039;&#039; : &#039;&#039;Advanced&#039;&#039;. The features supported by this cache store instance.&lt;br /&gt;
; &#039;&#039;&#039;Locking mechanism&#039;&#039;&#039; : &#039;&#039;Advanced&#039;&#039;. The locking mechanism this cache store instance will make use of. We&#039;ve not discussed this yet, but read on and you&#039;ll find information on it.&lt;br /&gt;
; &#039;&#039;&#039;Actions&#039;&#039;&#039; : Any actions that can be performed against this cache store instance.&lt;br /&gt;
&lt;br /&gt;
===Known cache definitions===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-04-known-cache-definitions.png|thumb|500px|Known cache definitions screenshot]]&lt;br /&gt;
&lt;br /&gt;
The idea of a cache definition hasn&#039;t been discussed here yet. It is something controlled by the developer. When they create a cache they can do so in two ways, the first is by creating a cache definition. This is essentially telling Moodle about the cache they&#039;ve created. The second way is to create an Adhoc cache. Developers are always encouraged to use the first method. Only caches with a definition can be mapped and further configured by the admin. Adhoc caches will make use of default settings only.&amp;lt;br /&amp;gt;&lt;br /&gt;
Typically Adhoc caches are only permitted in situations where the cache is small and configuring it beyond defaults would provide no benefit to administrators. Really its like saying you the administrator doesn&#039;t need to concern yourself with it.&lt;br /&gt;
&lt;br /&gt;
For each cache shown here you get the following information:&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Definition&#039;&#039;&#039; : A concise description of this cache.&lt;br /&gt;
; &#039;&#039;&#039;Mode&#039;&#039;&#039; : The cache type this cache is designed for.&lt;br /&gt;
; &#039;&#039;&#039;Component&#039;&#039;&#039; : The code component the cache is associated with.&lt;br /&gt;
; &#039;&#039;&#039;Area&#039;&#039;&#039; : The area of code this cache is serving within the component.&lt;br /&gt;
; &#039;&#039;&#039;Store mappings&#039;&#039;&#039; : The store or stores that will be used for this cache.&lt;br /&gt;
; &#039;&#039;&#039;Sharing&#039;&#039;&#039; : How is sharing configured for this site.&lt;br /&gt;
; &#039;&#039;&#039;Actions&#039;&#039;&#039; : Any actions that can be performed on the cache. Typically you can edit the cache store instance mappings, edit sharing, and purge the cache.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also find at the bottom of this table a link title &amp;quot;Rescan definitions&amp;quot;. Clicking this link will cause Moodle to go off an check all core components, and installed plugins looking for changes in the cache definitions.&amp;lt;br /&amp;gt;&lt;br /&gt;
This happens by default during upgrade, and if a new cache definition is encountered. However should you find yourself looking for a cache that isn&#039;t there this may be worth a try.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is also handy for developers as it allows them to quickly apply changes when working with caches. It is useful when tweaking cache definitions to find what works best.&lt;br /&gt;
&lt;br /&gt;
Information on specific cache definitions can be found on the [[Cache definitions]] page.&lt;br /&gt;
&lt;br /&gt;
===Summary of cache lock instances===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-05-summary-of-cache-lock-instances.png|thumb|500px|Summary of cache lock instances screenshot]]&lt;br /&gt;
&lt;br /&gt;
As mentioned above cache locking is an advanced concept in MUC.&amp;lt;br /&amp;gt;&lt;br /&gt;
The table here shows information on the configured locking mechanisms available to MUC. By default just a single locking mechanism is available, file locking.&lt;br /&gt;
At present there are no caches that make use of this and as such I won&#039;t discuss it further here.&lt;br /&gt;
&lt;br /&gt;
===Stores used when no mapping is present===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-06-stores-used-when-no-mapping-is-present.png|thumb|500px|Mapping of default stores screenshot]]&lt;br /&gt;
&lt;br /&gt;
This table quickly shows which cache store instances are going to be used for cache types if there are specific mappings in place.&amp;lt;br /&amp;gt;&lt;br /&gt;
Of simply this shows the default cache store instances.&lt;br /&gt;
&lt;br /&gt;
At the bottom you will notice there is a link &amp;quot;Edit mappings&amp;quot; that takes you to a page where you can configure this.&lt;br /&gt;
&lt;br /&gt;
==Adding cache store instances==&lt;br /&gt;
&lt;br /&gt;
The default configuration is going to work for all sites, however you may be able to improve your sites performance by making use of various caching backends and techniques. The first thing you are going to want to do is add cache store instances configured to connect to/use the cache backends you&#039;ve set up.&lt;br /&gt;
&lt;br /&gt;
===File cache===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-07-add-file-cache-store.png|thumb|300px|Adding a file cache store screenshot]]&lt;br /&gt;
&lt;br /&gt;
When on the cache configuration screen within the &#039;&#039;Installed cache stores&#039;&#039; table you should be able to see the File cache plugin, click &#039;&#039;`Add instance`&#039;&#039; to start the process of adding a file cache store instance.&lt;br /&gt;
&lt;br /&gt;
When creating a file cache there is in fact only one required param, the store name. The store name is used to identify the file store instance in the configuration interface and must be unique to the site.&lt;br /&gt;
It can be anything you want, but we would advice making it something that describes you intended use of the file store.&lt;br /&gt;
&lt;br /&gt;
The following properties can also be specified, customising where the file cache will be located, and how it operates.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Cache path&#039;&#039;&#039; : Allows you to specify a directory to use when storing cache data on the file system. Of course the user the webserver is running as must have read/write access to this directory. By default (blank) the Moodledata directory will be used.&lt;br /&gt;
; &#039;&#039;&#039;Auto create directory&#039;&#039;&#039; : If enabled when the cache is initialised if the specified directory does not exist Moodle will create it. If this is specified and the directory does not exist the the cache will be deemed not ready and will not be used.&lt;br /&gt;
; &#039;&#039;&#039;Single directory store&#039;&#039;&#039; : By default the file store will create a subdirectory structure to store data in. The first 3 characters of the data key will be used as a directory. This is useful in avoiding file system limits it the file system has a maximum number of files per directory. By enabling this option the file cache will not use subdirectories for storage of data. This leads to a flat structure but one that is more likely hit file system limits. Use with care.&lt;br /&gt;
; &#039;&#039;&#039;Prescan directory&#039;&#039;&#039; : One of the features the file cache provides is to prescan the storage directory when the cache is first used. This leads to faster checks of files at the expense of an in-depth read.&lt;br /&gt;
&lt;br /&gt;
The file cache store is the default store used for application caches and by default the moodledata directory gets used for the cache.&lt;br /&gt;
File access can be a taxing resource in times of increased load and the following are some ideas about configuring alternative file stores in order to improve performance.&lt;br /&gt;
&lt;br /&gt;
First up is there a faster file system available for use on your server.&amp;lt;br /&amp;gt;&lt;br /&gt;
Perhaps you&#039;ve an SSD installed but are not using it for your moodledata directory because space is a premium.&amp;lt;br /&amp;gt;&lt;br /&gt;
You should consider creating a directory or small partition on your SSD and creating a file store to use that instead of your Moodle data directory.&lt;br /&gt;
&lt;br /&gt;
Next you&#039;ve not got a faster drive available for use, but you do have plenty of free space.&amp;lt;br /&amp;gt;&lt;br /&gt;
Something that may be worth giving a shot would be to create a small partition on the drive you&#039;ve got installed that uses a performance orientated file system.&amp;lt;br /&amp;gt;&lt;br /&gt;
Many linux installations these days for example use EXT4, a nice file system but one that has overheads due to the likes of journalling.&amp;lt;br /&amp;gt;&lt;br /&gt;
Creating a partition and using a file system that has been optimised for performance may give you that little boost you are looking for. Remember caches are designed to be volatile and choosing a file system for a cache is different decision to choosing a file system for your server.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally if you&#039;re ready to go to lengths and have an abundance of memory on your server you could consider creating a ramdisk/tmpfs and pointing a file store at that.&lt;br /&gt;
Purely based in memory, it is volatile exactly like the cache is, and file system performance just isn&#039;t going to get much better than this.&amp;lt;br /&amp;gt;&lt;br /&gt;
Of course you will be limited in space and you are essentially taking that resource away from your server.&lt;br /&gt;
&lt;br /&gt;
Please remember with all of these ideas that they are just ideas.&amp;lt;br /&amp;gt;&lt;br /&gt;
What ever you choose - test, test, test, be sure of the decision you make.&lt;br /&gt;
&lt;br /&gt;
===Memcache===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-08-add-memcache-store.png|thumb|300px|Add Memcache store screenshot]]&lt;br /&gt;
&lt;br /&gt;
Before you can add a Memcache store instance you must first have a Memcached server you can access and have the Memcache php extension installed and enabled on your web server.&lt;br /&gt;
&lt;br /&gt;
Like the file store you must provide a the store name. It is used to identify the store instance in the configuration interface and must be unique to the site.&amp;lt;br /&amp;gt;&lt;br /&gt;
For a Memcache store you must also enter the Memcache server, or servers you wish it to make use of.&lt;br /&gt;
Servers should be added one per line and each line can contain 1 to 3 properties separated by colons.&lt;br /&gt;
# The URL or IP address of the server (required)&lt;br /&gt;
# The port the server is listening on (optional)&lt;br /&gt;
# The weight to give this server (optional)&lt;br /&gt;
&lt;br /&gt;
For example, if you had two Memcached instances running on your server, one configured for the default port, and one configured for 11212 you would use the following:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
127.0.0.1&lt;br /&gt;
127.0.0.1:11212&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optionally you can also specify a key prefix to use. What you enter here will prefixed to all keys before accessing the server and can be used to effectively partition the Memcache space in a recognisable way. This can be handy if you have a management tool for you Memcached server that you use to inspect what is stored there.&lt;br /&gt;
&lt;br /&gt;
===Memcached===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-09-add-memcached-store.png|thumb|300px|Add Memcached store screenshot]]&lt;br /&gt;
&lt;br /&gt;
Like the Memcache store you must first have a Memcached server you can access and have the Memcached php extension installed and enabled on your server.&lt;br /&gt;
&lt;br /&gt;
Also like the Memcache store there are two required parameters in configuring a Memcached store.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Store name&#039;&#039;&#039; : It is used to identify the store instance in the configuration interface and must be unique to the site.&lt;br /&gt;
; &#039;&#039;&#039;Servers&#039;&#039;&#039; : The servers you wish this cache store use. See below for details.&lt;br /&gt;
&lt;br /&gt;
Servers should be added one per line and each line can contain 1 to 3 properties separated by colons.&lt;br /&gt;
# The URL or IP address of the server (required)&lt;br /&gt;
# The port the server is listening on (optional)&lt;br /&gt;
# The weight to give this server (optional)&lt;br /&gt;
&lt;br /&gt;
For example, if you had two Memcached instances running on your server, one configured for the default port, and one configured for 11212 you would use the following:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
127.0.0.1&lt;br /&gt;
127.0.0.1:11212&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are also several optional parameters you can set when creating a Memcached store.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Use compression&#039;&#039;&#039; : Defaults to true, but can be disabled if you wish.&lt;br /&gt;
; &#039;&#039;&#039;Use serialiser&#039;&#039;&#039; : Allows your to select which serialiser gets used when communicating with the Memcache server. By default the Memcached extension and PHP only provide one serialised, however there is a couple of others available for installation if you go looking for them. One for example is the igbinary found at https://github.com/igbinary/igbinary.&lt;br /&gt;
; &#039;&#039;&#039;Prefix key&#039;&#039;&#039; : Allows you to set some characters that will be prefixed to all keys before interacting with the server.&lt;br /&gt;
; &#039;&#039;&#039;Hash method&#039;&#039;&#039; : The hash method provided by the Memcached extension is used by default here. However you can select to use an alternative if you wish. http://www.php.net/manual/en/memcached.constants.php provides a little information on the options available. Please note if you wish to you can also override the default hash function PHP uses within your php.ini.&lt;br /&gt;
; &#039;&#039;&#039;Buffer writes&#039;&#039;&#039; : Disabled by default, and for good reason. Turning on buffered writes will minimise interaction with the Memcached server by buffering io operations. The downside to this is that on a system with any concurrency there is a good chance multiple requests will end up generating the data because no one had pushed it to the Memcached server when they first requested it. Enabling this can be advantageous for caches that are only accessed in capability controlled areas for example where multiple interaction is taking a toll on network resources or such. But that is definitely on the extreme tweaking end of the scale.&lt;br /&gt;
&lt;br /&gt;
===MongoDB===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-10-add-mongodb-store.png|thumb|300px|Add MongoDB store screenshot]]&lt;br /&gt;
&lt;br /&gt;
MongoDB is an open source document orientated NoSQL database. Check out their website www.mongodb.org for more information.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Store name&#039;&#039;&#039; : Used to identify the store instance in the configuration interface and must be unique to the site.&lt;br /&gt;
; &#039;&#039;&#039;Server&#039;&#039;&#039; : This is the connection string for the server you want to use. Multiple servers can be specified using a comma-separated list.&lt;br /&gt;
; &#039;&#039;&#039;Database&#039;&#039;&#039; : The name of the database to make use of.&lt;br /&gt;
; &#039;&#039;&#039;Username&#039;&#039;&#039; : The username to use when making a connection.&lt;br /&gt;
; &#039;&#039;&#039;Password&#039;&#039;&#039; : The password of the user being used for the connection.&lt;br /&gt;
; &#039;&#039;&#039;Replica set&#039;&#039;&#039; : The name of the replica set to connect to. If this is given the master will be determined by using the ismaster database command on the seeds, so the driver may end up connecting to a server that was not even listed.&lt;br /&gt;
; &#039;&#039;&#039;Use&#039;&#039;&#039; : If enabled the usesafe option will be used during insert, get, and remove operations. If you&#039;ve specified a replica set this will be forced on anyway.&lt;br /&gt;
; &#039;&#039;&#039;Use safe value&#039;&#039;&#039; : You can choose to provide a specific value for use safe. This will determine the number of servers that operations must be completed on before they are deemed to have been completed.&lt;br /&gt;
; &#039;&#039;&#039;Use extended keys&#039;&#039;&#039; : If enabled full key sets will be used when working with the plugin. This isn&#039;t used internally yet but would allow you to easily search and investigate the MongoDB plugin manually if you so choose. Turning this on will add an small overhead so should only be done if you require it.&lt;br /&gt;
&lt;br /&gt;
==Mapping a cache to a store instance==&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-11-store-mapping.png|thumb|300px|Cache definition store mapping screenshot]]&lt;br /&gt;
&lt;br /&gt;
Mapping a store instance to a cache tells Moodle to use that store instance when the cache is interacted with. This allows the Moodle administrator to control where information gets stored and to most importantly optimise performance of your site by making the most of the resources available to your site.&lt;br /&gt;
&lt;br /&gt;
To set a mapping first browse to the cache configuration screen.&amp;lt;br /&amp;gt;&lt;br /&gt;
Proceed to find the &#039;&#039;Known cache definitions&#039;&#039; table and within it find the cache you&#039;d like to map.&lt;br /&gt;
In the actions column select the link for &#039;&#039;&#039;Edit mappings&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The screen you are presented allows you to map one or more cache store instances to be used by this cache.&lt;br /&gt;
&lt;br /&gt;
If no stores are mapped for the cache then the default stores are used. Have a look at the section below for information on changing the default stores.&lt;br /&gt;
&lt;br /&gt;
If a single store instance is mapped to the cache the following occurs:&lt;br /&gt;
; &#039;&#039;Getting data from the cache&#039;&#039; : Moodle asks the cache to get the data. The cache attempts to get it from the store. If the store has it it gives it to the cache, and the cache gives it to Moodle so that it can use the data. If the store doesn&#039;t have it the a fail is returned and Moodle will have to generate the data and will most likely then send it to the cache.&lt;br /&gt;
; &#039;&#039;Storing data in the cache&#039;&#039; : Moodle will ask the cache to store some data, and the cache will give it to the cache store.&lt;br /&gt;
&lt;br /&gt;
If multiple store instances are mapped to the cache the following occurs:&lt;br /&gt;
; &#039;&#039;Getting data from a store&#039;&#039; : Moodle asks the cache to get the data. The cache attempts to get it from the first store. If the first store has it then it returns the data to the cache and the cache returns it to Moodle. If the first store doesn&#039;t have the data then it attempts to get the data from the second store. If the second store has it it returns it to the first store that then stores it itself before returning it to the cache. If it doesn&#039;t then the next store is used. This continue until either the data is found or there are no more stores to check.&lt;br /&gt;
; &#039;&#039;Storing data in the cache&#039;&#039; : Moodle will ask the cache to store some data, the cache will give it to every mapped cache store for storage.&lt;br /&gt;
&lt;br /&gt;
The main advantage to assigning multiple stores is that you can introduce cache redundancy. Of course this introduces an overhead so it should only be used when actually required.&lt;br /&gt;
The following is an example of when mapping multiple stores can provide an advantage:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario:&lt;br /&gt;
You have have a web server that has a Moodle site as well as other sites.&lt;br /&gt;
You also have a Memcache server that is used by several sites including Moodle.&lt;br /&gt;
&lt;br /&gt;
Memcache has a limited size cache, that when full and requested to store more information frees space by dropping the least used cache entries.&lt;br /&gt;
&lt;br /&gt;
You want to use Memcache for your Moodle site because it is fast, however you are aware that it may introduce more cache misses because it is a heavily used Memcache server.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
To get around this you map two stores to caches you wish to use Memcache.&lt;br /&gt;
You make Memcache the primary store, and you make the default file store the final cache store.&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
By doing this you&#039;ve created redundancy, when something is requested Moodle first tries to get it from Memcache (the fastest store) and if its not there it proceeds to check the file cache.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just a couple more points of interest:&lt;br /&gt;
&lt;br /&gt;
* Mapping multiple caches will introduce overhead, the more caches mapped the more overhead.&lt;br /&gt;
* Consider the cache stores you are mapping to, if data remains there once set then there is no point mapping any further stores after it. This technique is primarily valuable in situations where data is not guaranteed to remain after being set.&lt;br /&gt;
* Always test your configuration. Enable the display of performance information and then watch which stores get used when interacting with Moodle in such a way as to trigger the cache.&lt;br /&gt;
&lt;br /&gt;
==Setting the stores that get used when no mapping is present==&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-12-default-store-mapping.png|thumb|300px|Setting which stores get used when no mapping is present screenshot]]&lt;br /&gt;
&lt;br /&gt;
This is really setting the default stores that get used for a cache type when there is not a specific mapping that has been made for it.&lt;br /&gt;
&lt;br /&gt;
To set a mapping first browse to the cache configuration screen.&amp;lt;br /&amp;gt;&lt;br /&gt;
Proceed to find the &#039;&#039;Stores used when no mapping is present&#039;&#039; table.&amp;lt;br /&amp;gt;&lt;br /&gt;
After the table you will find a link &#039;&#039;&#039;Edit mappings&#039;&#039;&#039;, click this.&lt;br /&gt;
&lt;br /&gt;
On the screen you are presented with you can select one store for each cache type to use when a cache of the corresponding type gets initialised and there is not an explicit mapping for it.&lt;br /&gt;
&lt;br /&gt;
Note that on this interface the drop downs only contain store instances that are suitable for mapping to the type.&lt;br /&gt;
Not all instances will necessarily be shown. If you have a store instance you don&#039;t see then it is not suitable for &#039;&#039;&#039;ALL&#039;&#039;&#039; the cache definitions that exist.&amp;lt;br /&amp;gt;&lt;br /&gt;
You will not be able to make that store instance the default, you will instead need to map it explicitly to each cache you want/can use it for.&lt;br /&gt;
&lt;br /&gt;
==Configuring caching for your site==&lt;br /&gt;
&lt;br /&gt;
This is where it really gets tricky, and unfortunately there is no step-by-step guide to this.&lt;br /&gt;
&lt;br /&gt;
How caching can be best configured for a site comes down entirely to the site in question and the resources available to it.&lt;br /&gt;
&lt;br /&gt;
What can be offered are some tips and tricks to get you thinking about things and to perhaps introduce ideas that will help you along the way.&lt;br /&gt;
&lt;br /&gt;
If you are reading this document and you&#039;ve learnt a thing or two about configuring caching on your site share your learnings by adding to the points here.&lt;br /&gt;
&lt;br /&gt;
* Plan it. It&#039;s a complex thing. Understand your site, understand your system, and really think how users will be using it all.&lt;br /&gt;
* If you&#039;ve got a small site the gains aren&#039;t likely to be significant, if you&#039;ve got a large site getting this right can lead to a substantial boost in performance.&lt;br /&gt;
* When looking at cache backends really research the advantages and disadvantages of each. Keep your site in mind when thinking about them. Depending upon your site you may find that no one cache backend is going to meet the entire needs of your site and that you will benefit from having a couple of backends at your disposal.&lt;br /&gt;
* Things aren&#039;t usually as simple as installing a cache backend and then using it. Pay attention to configuration and try to optimise it for your system. Test it separately and have an understanding of its performance before tell Moodle about it. The cache allows you to shift load off the database and reduce page request processing.&amp;lt;br /&amp;gt;If for instance you have Memcache installed but your connection has not been optimised for it you may well find yourself in a losing situation before you even tell Moodle about the Memcache server.&lt;br /&gt;
* When considering your default store instances keep in mind that they must operate with data sets of varying sizes and frequency. For a large site really your best bet is to look at each cache definition and map it to a store that is best suited for the data it includes and the frequency of access.&amp;lt;br /&amp;gt;Cache definitions have been documented [[Cache definitions]].&lt;br /&gt;
* Again when mapping store instances to caches really think about the cache you are mapping and make a decision based upon what you understand of your site and what you know about the cache.&amp;lt;br /&amp;gt;Cache definitions have been documented [[Cache definitions]].&lt;br /&gt;
* Test your configuration. If you can stress test it even better! If you turn on performance information Moodle will also print cache access information at the bottom of the screen. You can use this to visually check the cache is being used as you expect, and it will give you an indication of where misses etc are occurring.&lt;br /&gt;
* Keep an eye on your backend. Moodle doesn&#039;t provide a means of monitoring a cache backend and that is certainly something you should keep an eye on. Memcache for instance drops least used data when full to make room for new entries. APC on the other hand stops accepting data when full. Both will impact your performance if full and you&#039;re going to encounter misses. However APC when full is horrible, but it is much faster.&lt;br /&gt;
&lt;br /&gt;
==Other performance testing==&lt;br /&gt;
&lt;br /&gt;
Two links that might be useful to anyone considering testing performance on their own servers:&lt;br /&gt;
&lt;br /&gt;
* [http://www.iteachwithmoodle.com/2012/10/12/moodle-performance-testing-how-much-more-horsepower-do-each-new-versions-of-moodle-require/ Moodle performance testing: how much more horsepower do each new versions of Moodle require?]&lt;br /&gt;
* [http://www.iteachwithmoodle.com/2012/10/11/how-to-stress-test-your-moodle-server-using-loadstorm/ How to load test your Moodle server using Loadstorm]&lt;br /&gt;
&lt;br /&gt;
==Other performance advice for load-balanced web servers==&lt;br /&gt;
&lt;br /&gt;
# In Moodle 2.4 onwards with load-balanced web servers, don&#039;t use the default caching option that stores the data in moodledata on a shared network drive.   Use memcached instead.   See Tim Hunt&#039;s article on http://tjhunt.blogspot.de/2013/05/performance-testing-moodle.html&lt;br /&gt;
# In Moodle 2.6 onwards make sure you set $CFG-&amp;gt;localcachedir to some local directory in config.php (for each node).  This will speed up some of the disk caching that happens outside of MUC, such as themes, javascript, libraries etc.&lt;br /&gt;
&lt;br /&gt;
==More information==&lt;br /&gt;
* [[Cache definitions]] Information on the cache definitions found within Moodle.&lt;br /&gt;
* [[:dev:Cache API|Cache API]] Details of the Cache API.&lt;br /&gt;
* [[:dev:Cache API - Quick reference|Cache API - Quick reference]] A short, code focused page of on the Cache API.&lt;br /&gt;
* [[:dev:The Moodle Universal Cache (MUC)|The Moodle Universal Cache (MUC)]] The original cache specification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Cache related forum discussions that may help in understanding MUC:&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=217195 MUC is here, now what?] &lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=226123 Status of MUC?]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=222250 Putting cachedir on local disks in cluster]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=232122 moodle cachestore_file]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other:&lt;br /&gt;
* [http://jfilip.ca/2013/08/20/moodle-2-4-5-vs-2-5-1-performance-and-muc-apc-cache-store/ Moodle 2.4.5 vs. 2.5.1 performance and MUC APC cache store] blog post by Justin Filip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[de:Caching]]&lt;br /&gt;
[[es:Cacheando]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Using_Database&amp;diff=110789</id>
		<title>Using Database</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Using_Database&amp;diff=110789"/>
		<updated>2014-03-06T13:10:21Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Importing many entries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Database}}&lt;br /&gt;
==Views==&lt;br /&gt;
&lt;br /&gt;
===View list===&lt;br /&gt;
&lt;br /&gt;
The list view shows multiple entries, possibly in a more abbreviated form to ensure all the information fits. You may use the controls at the bottom of the screen to search and sort the contents.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;View single&#039;&#039;: one item at a time&lt;br /&gt;
* &#039;&#039;View list&#039;&#039; : several items at a time (number is user defined)&lt;br /&gt;
* &#039;&#039;Add entry&#039;&#039; : add an item to the database&lt;br /&gt;
* &#039;&#039;Search&#039;&#039;    : search the entries &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:26databaseview.png]]&lt;br /&gt;
&lt;br /&gt;
=== View single ===&lt;br /&gt;
&lt;br /&gt;
Alternatively, you may view only one entry at a time. This might allow you to view more detailed information than the list view.&lt;br /&gt;
&lt;br /&gt;
=== Add comment ===&lt;br /&gt;
&lt;br /&gt;
If comments have been enabled, you may add a comment.&lt;br /&gt;
&lt;br /&gt;
=== Rate entries ===&lt;br /&gt;
&lt;br /&gt;
If ratings have been enabled, and made viewable, by the database editor, you may [[Grades|grade]] other database entries, and view these ratings.&lt;br /&gt;
&lt;br /&gt;
==Adding an entry==&lt;br /&gt;
&lt;br /&gt;
Go to the &amp;quot;Add entry&amp;quot; tab and fill in the form.&lt;br /&gt;
===Deleting multiple entries===&lt;br /&gt;
{{New features}}&lt;br /&gt;
In List view, a checkbox will appear next to each entry. Select the entries you wish to delete and click the &#039;Delete selected&#039; button. Alternatively, click the &#039;Select all&#039; and the &#039;Delete all&#039; buttons to delete all entries. A warning message will appear asking you to verify what you wish to delete.&lt;br /&gt;
&lt;br /&gt;
==Automatically linking database entries==&lt;br /&gt;
&lt;br /&gt;
If the [[Database auto-linking filter]] is enabled, any entries in a database will be automatically linked to where the concept words and/or phrases appear within the same course. This includes forum postings, internal resources, week summaries etc.&lt;br /&gt;
&lt;br /&gt;
Note: If you do not want particular text to be linked (in a forum posting, say) then you should add &amp;lt;nolink&amp;gt; and &amp;lt;/nolink&amp;gt; tags around the text. Alternatively the filter can be disabled for a particular activity.&lt;br /&gt;
==Approving and undoing approval of entries==&lt;br /&gt;
&lt;br /&gt;
If, during database set up, &#039;Approval required&#039; was set to &#039;Yes&#039; then a teacher can approve an entry by clicking on the tick/checkmark icon.&lt;br /&gt;
&lt;br /&gt;
Once an entry has been approved, it is possible to undo the approval by clicking the circle with a line through it icon. {{New features}}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:26databaseapprove.png|thumb|Entry approved]]&lt;br /&gt;
|[[File:26databaseunapprove.png|thumb|Approval undone]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Importing many entries==&lt;br /&gt;
You can import entries via a CSV file if you click the &amp;quot;Import entries&amp;quot; link under &#039;Database activity administration&#039; in the Settings block. CSV means Comma-Separated-Values and is a common format for text interchange.&lt;br /&gt;
&lt;br /&gt;
[[image:Databaseupload.png]]&lt;br /&gt;
&lt;br /&gt;
The easiest way to determine the format of the text file is to manually add an entry to the database and then export it. The resulting export text file may then be edited and used for importing entries. Here&#039;s a sample of what a very simple file will look like.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upload_csv_sample.png]]&lt;br /&gt;
&lt;br /&gt;
The expected file format is a plain text file with a list of field names as the first record. The data then follows, one record per line.&lt;br /&gt;
&lt;br /&gt;
The field delimiter defaults to a comma character and the field enclosure is not set by default (field enclosures are characters that surround each field in each record).&lt;br /&gt;
&lt;br /&gt;
Records should be delimited by new lines (usually generated by pressing RETURN or ENTER in your text editor). Tabs can be specified using \t and newlines by \n.&lt;br /&gt;
&lt;br /&gt;
Sample file:&lt;br /&gt;
&lt;br /&gt;
  name,height,weight&lt;br /&gt;
  Kai,180cm,80kg&lt;br /&gt;
  Kim,170cm,60kg&lt;br /&gt;
  Koo,190cm,20kg&lt;br /&gt;
&lt;br /&gt;
Note: Certain field types may not be supported.&lt;br /&gt;
&lt;br /&gt;
Do not put spaces after your commas or upload will fail!&lt;br /&gt;
&lt;br /&gt;
After upload page import.php comes back blank if it failed. &lt;br /&gt;
If successful you&#039;ll read a message like, &amp;quot;1 entries saved&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Exporting entries==&lt;br /&gt;
&lt;br /&gt;
You can export entries either in CSV (comma separated values) or ODS (OpenOffice Calc) formats by clicking the tab at the top or by clicking the &amp;quot;Export entries&amp;quot; link under &#039;Database activity administration&#039; in the Settings block. (Both CSV and ODS formats can be opened with MS Excel.)&lt;br /&gt;
&lt;br /&gt;
[[File:Databasexport.png]]&lt;br /&gt;
&lt;br /&gt;
When using the CSV format, the user can select either the comma, semicolon, or tab to separate the fields. The selection of the proper character is important. If users select to use a comma to separate the fields and some of the fields contain data with commas then the number of columns is going to be misaligned and likely cause confusion.&lt;br /&gt;
&lt;br /&gt;
Users can select which fields from the database they wish to have exported. By default, all fields are checked to be included. Choose the fields that you wish to have included in the export.&lt;br /&gt;
&lt;br /&gt;
Once the export type and the fields to be exported have been selected, clicking on the Export entries pushbutton will generate the file. The user will usually have the option of either opening or saving the file.&lt;br /&gt;
&lt;br /&gt;
For information on converting the date export (and import) format, see the discussion [https://moodle.org/mod/forum/discuss.php?d=220505 Standard Database Module - Dates].&lt;br /&gt;
&lt;br /&gt;
==Exporting to an external portfolio==&lt;br /&gt;
&lt;br /&gt;
If an external [[Portfolios|portfolio]] such as [[Mahara_portfolio|Mahara]] has been enabled by the administrator then users have the option to export individual entries to that portfolio. They will see at the bottom of a database entry an &amp;quot;export&amp;quot; icon to click on and select the portfolio to export to:&lt;br /&gt;
&lt;br /&gt;
[[File:Exportdatabasentry.png]]&lt;br /&gt;
&lt;br /&gt;
== Example databases ==&lt;br /&gt;
&lt;br /&gt;
Moodle.org has two good examples of the database module in action:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?id=6140 Moodle Buzz], a database of the titles, authors and web links to news articles mentioning Moodle&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?d=26 Themes], a database with screenshots, download links and user comments about Moodle [[Themes|themes]]&lt;br /&gt;
&lt;br /&gt;
== Creative uses ==&lt;br /&gt;
&lt;br /&gt;
You could use the database module to:&lt;br /&gt;
&lt;br /&gt;
* allow collaboration on building a collection of web links/books/journal references related to a particular subject&lt;br /&gt;
* display student created photos/posters/websites/poems for peer comment and review&lt;br /&gt;
* gather comments and votes on a shortlist of potential logos/mascot names/project ideas&lt;br /&gt;
* provide a [http://moodle.org/mod/forum/discuss.php?d=52699 student file storage area]&lt;br /&gt;
* maintain a log of what was done in a face-to-face class each day, so that absent students can get caught up themselves.  [http://moodle.org/mod/forum/discuss.php?d=115047 Example]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
*[http://school.demo.moodle.net/course/view.php?id=127&amp;amp;section=3 Examples of databases in the School demo site] (available for download)&lt;br /&gt;
* [[Dataform module]], which is a major enhancement of the Database module with improved browsing, editing, searching and other features.&lt;br /&gt;
* [[Glossary module]], which performs a similar though more specialised, text-based role&lt;br /&gt;
* [[Using Moodle book]] Chapter 12: Databases&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=3505 Database activity module forum]&lt;br /&gt;
* [http://treadwell.cce.cornell.edu/moodle_doc/database_moodle/index.html Screencast introducing the Database Module and walking through creating a database]&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?rid=2424 Tracking Students&#039; Reading with the Moodle Database Module] presentation&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=72260 Database Module: Each learner Private DB?]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=84487 Database for Dummies please!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=89117 Restricting access to database content by user?]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=139137 How to use the database activity module?]&lt;br /&gt;
&lt;br /&gt;
[[de:Datenbank nutzen]]&lt;br /&gt;
[[es:Usando BasedeDatos]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Using_Database&amp;diff=110788</id>
		<title>Using Database</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Using_Database&amp;diff=110788"/>
		<updated>2014-03-06T13:09:48Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Exporting entries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Database}}&lt;br /&gt;
==Views==&lt;br /&gt;
&lt;br /&gt;
===View list===&lt;br /&gt;
&lt;br /&gt;
The list view shows multiple entries, possibly in a more abbreviated form to ensure all the information fits. You may use the controls at the bottom of the screen to search and sort the contents.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;View single&#039;&#039;: one item at a time&lt;br /&gt;
* &#039;&#039;View list&#039;&#039; : several items at a time (number is user defined)&lt;br /&gt;
* &#039;&#039;Add entry&#039;&#039; : add an item to the database&lt;br /&gt;
* &#039;&#039;Search&#039;&#039;    : search the entries &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:26databaseview.png]]&lt;br /&gt;
&lt;br /&gt;
=== View single ===&lt;br /&gt;
&lt;br /&gt;
Alternatively, you may view only one entry at a time. This might allow you to view more detailed information than the list view.&lt;br /&gt;
&lt;br /&gt;
=== Add comment ===&lt;br /&gt;
&lt;br /&gt;
If comments have been enabled, you may add a comment.&lt;br /&gt;
&lt;br /&gt;
=== Rate entries ===&lt;br /&gt;
&lt;br /&gt;
If ratings have been enabled, and made viewable, by the database editor, you may [[Grades|grade]] other database entries, and view these ratings.&lt;br /&gt;
&lt;br /&gt;
==Adding an entry==&lt;br /&gt;
&lt;br /&gt;
Go to the &amp;quot;Add entry&amp;quot; tab and fill in the form.&lt;br /&gt;
===Deleting multiple entries===&lt;br /&gt;
{{New features}}&lt;br /&gt;
In List view, a checkbox will appear next to each entry. Select the entries you wish to delete and click the &#039;Delete selected&#039; button. Alternatively, click the &#039;Select all&#039; and the &#039;Delete all&#039; buttons to delete all entries. A warning message will appear asking you to verify what you wish to delete.&lt;br /&gt;
&lt;br /&gt;
==Automatically linking database entries==&lt;br /&gt;
&lt;br /&gt;
If the [[Database auto-linking filter]] is enabled, any entries in a database will be automatically linked to where the concept words and/or phrases appear within the same course. This includes forum postings, internal resources, week summaries etc.&lt;br /&gt;
&lt;br /&gt;
Note: If you do not want particular text to be linked (in a forum posting, say) then you should add &amp;lt;nolink&amp;gt; and &amp;lt;/nolink&amp;gt; tags around the text. Alternatively the filter can be disabled for a particular activity.&lt;br /&gt;
==Approving and undoing approval of entries==&lt;br /&gt;
&lt;br /&gt;
If, during database set up, &#039;Approval required&#039; was set to &#039;Yes&#039; then a teacher can approve an entry by clicking on the tick/checkmark icon.&lt;br /&gt;
&lt;br /&gt;
Once an entry has been approved, it is possible to undo the approval by clicking the circle with a line through it icon. {{New features}}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:26databaseapprove.png|thumb|Entry approved]]&lt;br /&gt;
|[[File:26databaseunapprove.png|thumb|Approval undone]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Importing many entries==&lt;br /&gt;
You can import entries via a CSV file if you click the &amp;quot;Import entries&amp;quot; link in the Database activity administration block. CSV means Comma-Separated-Values and is a common format for text interchange.&lt;br /&gt;
&lt;br /&gt;
[[image:Databaseupload.png]]&lt;br /&gt;
&lt;br /&gt;
The easiest way to determine the format of the text file is to manually add an entry to the database and then export it. The resulting export text file may then be edited and used for importing entries. Here&#039;s a sample of what a very simple file will look like.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upload_csv_sample.png]]&lt;br /&gt;
&lt;br /&gt;
The expected file format is a plain text file with a list of field names as the first record. The data then follows, one record per line.&lt;br /&gt;
&lt;br /&gt;
The field delimiter defaults to a comma character and the field enclosure is not set by default (field enclosures are characters that surround each field in each record).&lt;br /&gt;
&lt;br /&gt;
Records should be delimited by new lines (usually generated by pressing RETURN or ENTER in your text editor). Tabs can be specified using \t and newlines by \n.&lt;br /&gt;
&lt;br /&gt;
Sample file:&lt;br /&gt;
&lt;br /&gt;
  name,height,weight&lt;br /&gt;
  Kai,180cm,80kg&lt;br /&gt;
  Kim,170cm,60kg&lt;br /&gt;
  Koo,190cm,20kg&lt;br /&gt;
&lt;br /&gt;
Note: Certain field types may not be supported.&lt;br /&gt;
&lt;br /&gt;
Do not put spaces after your commas or upload will fail!&lt;br /&gt;
&lt;br /&gt;
After upload page import.php comes back blank if it failed. &lt;br /&gt;
If successful you&#039;ll read a message like, &amp;quot;1 entries saved&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Exporting entries==&lt;br /&gt;
&lt;br /&gt;
You can export entries either in CSV (comma separated values) or ODS (OpenOffice Calc) formats by clicking the tab at the top or by clicking the &amp;quot;Export entries&amp;quot; link under &#039;Database activity administration&#039; in the Settings block. (Both CSV and ODS formats can be opened with MS Excel.)&lt;br /&gt;
&lt;br /&gt;
[[File:Databasexport.png]]&lt;br /&gt;
&lt;br /&gt;
When using the CSV format, the user can select either the comma, semicolon, or tab to separate the fields. The selection of the proper character is important. If users select to use a comma to separate the fields and some of the fields contain data with commas then the number of columns is going to be misaligned and likely cause confusion.&lt;br /&gt;
&lt;br /&gt;
Users can select which fields from the database they wish to have exported. By default, all fields are checked to be included. Choose the fields that you wish to have included in the export.&lt;br /&gt;
&lt;br /&gt;
Once the export type and the fields to be exported have been selected, clicking on the Export entries pushbutton will generate the file. The user will usually have the option of either opening or saving the file.&lt;br /&gt;
&lt;br /&gt;
For information on converting the date export (and import) format, see the discussion [https://moodle.org/mod/forum/discuss.php?d=220505 Standard Database Module - Dates].&lt;br /&gt;
&lt;br /&gt;
==Exporting to an external portfolio==&lt;br /&gt;
&lt;br /&gt;
If an external [[Portfolios|portfolio]] such as [[Mahara_portfolio|Mahara]] has been enabled by the administrator then users have the option to export individual entries to that portfolio. They will see at the bottom of a database entry an &amp;quot;export&amp;quot; icon to click on and select the portfolio to export to:&lt;br /&gt;
&lt;br /&gt;
[[File:Exportdatabasentry.png]]&lt;br /&gt;
&lt;br /&gt;
== Example databases ==&lt;br /&gt;
&lt;br /&gt;
Moodle.org has two good examples of the database module in action:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?id=6140 Moodle Buzz], a database of the titles, authors and web links to news articles mentioning Moodle&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?d=26 Themes], a database with screenshots, download links and user comments about Moodle [[Themes|themes]]&lt;br /&gt;
&lt;br /&gt;
== Creative uses ==&lt;br /&gt;
&lt;br /&gt;
You could use the database module to:&lt;br /&gt;
&lt;br /&gt;
* allow collaboration on building a collection of web links/books/journal references related to a particular subject&lt;br /&gt;
* display student created photos/posters/websites/poems for peer comment and review&lt;br /&gt;
* gather comments and votes on a shortlist of potential logos/mascot names/project ideas&lt;br /&gt;
* provide a [http://moodle.org/mod/forum/discuss.php?d=52699 student file storage area]&lt;br /&gt;
* maintain a log of what was done in a face-to-face class each day, so that absent students can get caught up themselves.  [http://moodle.org/mod/forum/discuss.php?d=115047 Example]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
*[http://school.demo.moodle.net/course/view.php?id=127&amp;amp;section=3 Examples of databases in the School demo site] (available for download)&lt;br /&gt;
* [[Dataform module]], which is a major enhancement of the Database module with improved browsing, editing, searching and other features.&lt;br /&gt;
* [[Glossary module]], which performs a similar though more specialised, text-based role&lt;br /&gt;
* [[Using Moodle book]] Chapter 12: Databases&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=3505 Database activity module forum]&lt;br /&gt;
* [http://treadwell.cce.cornell.edu/moodle_doc/database_moodle/index.html Screencast introducing the Database Module and walking through creating a database]&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?rid=2424 Tracking Students&#039; Reading with the Moodle Database Module] presentation&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=72260 Database Module: Each learner Private DB?]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=84487 Database for Dummies please!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=89117 Restricting access to database content by user?]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=139137 How to use the database activity module?]&lt;br /&gt;
&lt;br /&gt;
[[de:Datenbank nutzen]]&lt;br /&gt;
[[es:Usando BasedeDatos]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installation_FAQ&amp;diff=109338</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installation_FAQ&amp;diff=109338"/>
		<updated>2014-01-26T10:01:45Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* When upgrading Moodle claims my MySQL database is not UTF8 when I&amp;#039;m sure it is */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
== System information needed for Installation problems forum ==&lt;br /&gt;
When posting questions to the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum], try to provide as much background information as possible about your Moodle system. Consider providing some or all of the following:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* PHP version (e.g. PHP 5.3.3)&lt;br /&gt;
* Database server type and version (e.g. MySQL 5.5.18)&lt;br /&gt;
* Browser and version (e.g. Firefox, IE8):&lt;br /&gt;
* Moodle version (e.g. 2.6):&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached (please remove passwords):&lt;br /&gt;
* Phpinfo attached?:&lt;br /&gt;
&lt;br /&gt;
Make sure you provide a sensible description (never HELP! or URGENT!) and a full description of what you did and what happened. Copy and paste any error messages accurately in full. &#039;Nothing&#039; is not a symptom, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==PHP - is it installed and what version do I have?==&lt;br /&gt;
&lt;br /&gt;
Make a new file on your web site called &#039;&#039;info.php&#039;&#039;, containing the following text, and call it from your browser:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?PHP phpinfo() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If nothing happens then you don&#039;t have PHP installed or your webserver is not configured to handle .php files properly. See the installation docs for some information about where to download it for your computer. See the [[phpinfo]] page for details about the content of this page.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==I am being told that I need the &#039;&#039;&#039;intl php plugin&#039;&#039;&#039; to continue to install Moodle 2.x==&lt;br /&gt;
The intl.dll from Zend is part of the PHP 5.2.8 release and later. It is aimed at improving the internationalization of php pages and Moodle 2.x uses it as part of this process. If your install is on a local machine or network, then you can download the latest version of PHP and update your PHP. You then have to uncomment all the required dynamic extensions you need, including the php_intl.dll extension. The problem is then solved. If the install is on a host server, then you need to contact your host and ask them to do the same, As an alternative, you can unzip/untar the download file, copy and paste the intl.dll file to your php/ext folder and include the line:&lt;br /&gt;
  extension=php_intl.dll&lt;br /&gt;
in the Dynamic Extensions section of your php.ini file.&lt;br /&gt;
&lt;br /&gt;
You can also set the error level using:&lt;br /&gt;
  intl.error_level = E_WARNING &lt;br /&gt;
but this is not essential&lt;br /&gt;
&lt;br /&gt;
If you are using a Linux install, use your system package manager or specify compilation flag.&lt;br /&gt;
    * Debian 5.0 (&amp;amp; Ubuntu) use: apt-get install php-intl or apt-get install php5-intl &lt;br /&gt;
    * CentOS 5.5 (&amp;amp; RedHat) you should (probably) be using php 5.3 from remi and then use: yum install php-intl&lt;br /&gt;
&lt;br /&gt;
This technique can be applied to any updated dynamic extension from Zend. You may want to use later dll files in your php/ext folder, you can do so by doing the same as above, but be careful, your version may not be able to take full advantage of the extension, or some very new extensions may cause an unexpected instability. The best option is still to update on a regular basis, perhaps once a year or so for the PHP.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
===What Dynamic Extensions do I really need uncommented in my php.ini file? What else do I need to change?===&lt;br /&gt;
This assumes you have complete control over the installation and running of your server, if your Moodle is hosted, you need to do something different, which is also discussed below. In the php.ini you need to delete the semi-colon, the ;, from the start of any line to uncomment it. For Moodle, you really should only need to change some values, and make sure the extensions you require are available. These are:&lt;br /&gt;
&lt;br /&gt;
Resource Limits&lt;br /&gt;
  memory_limit = 128M     //This is the maximum it requires and on a shared server you may get much less. &lt;br /&gt;
&lt;br /&gt;
Data Handling &lt;br /&gt;
  post_max_size = 512M    //This allows postings of up to 512MB, but set it to suit yourself and your circumstances&lt;br /&gt;
&lt;br /&gt;
Paths and Directories&lt;br /&gt;
  doc_root =&amp;quot;driveletter:\path\to\server\active\web\directory&amp;quot;  (e.g. d:\Apache\htdocs or e:\iis\wwwroot )&lt;br /&gt;
  and&lt;br /&gt;
  extension_dir = &amp;quot;driveletter:\path\to\php\ext&amp;quot; (e.g. d:\php\ext or e:\iis\php\ext)&lt;br /&gt;
&lt;br /&gt;
File Uploads&lt;br /&gt;
  upload_max_filesize = 512M    (This is different from the post_max_size this is for file uploads.)&lt;br /&gt;
&lt;br /&gt;
Dynamic Extensions (&#039;&#039;&#039;Windows Only&#039;&#039;&#039;)&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP 5.3.x&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  extension=php_curl.dll&lt;br /&gt;
  extension=php_gd2.dll&lt;br /&gt;
  extension=php_gettext.dll&lt;br /&gt;
  extension=php_intl.dll&lt;br /&gt;
  extension=php_imap.dll&lt;br /&gt;
  extension=php_ldap.dll&lt;br /&gt;
  extension=php_mbstring.dll&lt;br /&gt;
  extension=php_exif.dll      ; Must be after mbstring as it depends on it&lt;br /&gt;
  extension=php_mysql.dll&lt;br /&gt;
  extension=php_mysqli.dll&lt;br /&gt;
  extension=php_openssl.dll&lt;br /&gt;
  extension=php_pdo_mssql.dll&lt;br /&gt;
  extension=php_pdo_mysql.dll&lt;br /&gt;
  extension=php_soap.dll&lt;br /&gt;
  extension=php_sockets.dll&lt;br /&gt;
  extension=php_sqlite.dll&lt;br /&gt;
  extension=php_xmlrpc.dll&lt;br /&gt;
  extension=php_zip.dll&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These edits and Dynamic extensions cover a range of options here, there are a number of other possibilities, but these listed are the most common ones. Unless you have a specific need, there may not be any reason to deviate from these settings, but if you do, make sure you know what is going to happen. These extensions will also allow you to successfully install and run many other PHP applications. &lt;br /&gt;
&lt;br /&gt;
One example is the Oracle extensions are not shown here, but Oracle can be used for the Moodle database. Another area people often get themselves into trouble is using &amp;quot;Magic quotes&amp;quot;. Magic quotes really should be set to off, they were only introduced early in the use of PHP to allow for some inexperienced scripting practices, (read poor, shoddy or dodgy here). If someone is still writing poor scripts, then they deserve to draw attention to themselves and their scripts deleted.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==What &amp;amp; where are Moodle&#039;s configuration settings stored?==&lt;br /&gt;
Configuration settings are stored in the config.php file stored in your moodle folder. This file is created during the installation process. If there is a problem and the installation cannot create the file, you can try creating it manually from the [[Configuration file]] docs. &lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
It is possible to download previous versions of Moodle that are not found on the  [http://download.moodle.org Standard Moodle Download page].  There are zip and tgz compressed located at &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]&amp;lt;/nowiki&amp;gt; (see links below). &lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:75%; height:75px&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
| 2.0 Versions || [http://download.moodle.org/stable19 1.9 Versions]  || [http://download.moodle.org/stable18 1.8 Versions] &lt;br /&gt;
|- &lt;br /&gt;
|[http://download.moodle.org/stable17 1.7 Versions] || [http://download.moodle.org/stable16 1.6 Versions] || [http://download.moodle.org/stable15/ 1.5 Versions] &lt;br /&gt;
|-&lt;br /&gt;
| [http://download.moodle.org/stable14 1.4 Versions] || [http://download.moodle.org/stable13 1.3 Versions]  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You can download previous releases by using wget, lynx or curl with this URL:&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]&amp;lt;/nowiki&amp;gt;. &lt;br /&gt;
:For example: to download Moodle version 1.5, use &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable15&amp;lt;/nowiki&amp;gt;. You&#039;ll see a directory tree with the files displayed. Click on the one you want and download as normal - if you require the latest update of the version, scroll to the end of the list and download the &amp;quot;moodle-latest&amp;quot; file.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download other releases not found in [http://download.moodle.org/windows/ Moodle packages for Windows], use this URL:&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/windows/MoodleWindowsInstaller-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Mac Packages&#039;&#039;&#039;: To download other releases not found in [http://download.moodle.org/macosx/ Mac packages], use either of these URLs (depending on whether you need the Intel or PPC package):&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/macosx/Moodle4Mac-Intel-[version_number].dmg&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/macosx/Moodle4Mac-PPC-[version_number}.dmg&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== How to enable and check PHP error logs==&lt;br /&gt;
PHP can be set up to log errors in a variety of different ways: two of these involve the use of the php.ini file and the ini_set command.  See [[PHP error logs]].&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Could not find a top level course&amp;quot; ==&lt;br /&gt;
If this appears immediately after you have attempted to install Moodle it almost certainly means that the installation did not complete. A complete installation will ask you for the administrator profile and to name the site just before it completes. Check your logs for errors. Then drop the database and start again. If you used the web-based installer try the command line one. Does your computer definitely have sufficient resource to run Moodle?&lt;br /&gt;
&lt;br /&gt;
==Email copies are not being sent from my forums==&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;must&#039;&#039; set up cron properly if you want Moodle to send out automatic email from forums, assignments etc. This same process also performs a number of clean-up tasks such as deleting old unconfirmed users, unenrolling old students and so on. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Try the default settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. This generally works. Except...&lt;br /&gt;
* On a Windows server you *must* supply the address of an SMTP server (Windows, unlike Unix, does not have a build in mail server) in the above settings page&lt;br /&gt;
* Make sure that &#039;&#039;allowuseremailcharset&#039;&#039; in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039; is set to No unless you really know what you are doing. Setting this to Yes can cause a problem in some versions of Moodle.&lt;br /&gt;
* Check your firewall or ask your network administrator. Many mail servers are heavily locked down and you may need permission to send mail through them.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t log in - I just stay stuck on the login screen==&lt;br /&gt;
&lt;br /&gt;
This may also apply if you are seeing  “Your session has timed out. Please login again” or &amp;quot;A server error that affects your login session was detected. Please login again or restart your browser&amp;quot; and cannot log in.&lt;br /&gt;
&lt;br /&gt;
The following are possible causes and actions you can take (in no particular order):&lt;br /&gt;
&lt;br /&gt;
* Check first that your main admin account (which will be a manual account) is also a problem. If your users are using an external authentication method (e.g. LDAP) that could be the problem. Isolate the fault and make sure it really is Moodle before going any further.&lt;br /&gt;
* Check that your hard disk is not full or if your server is on shared hosting check that you have not reached your disk space quota. This will prevent new sessions being created and nobody will be able to log in. &lt;br /&gt;
* Carefully check the permissions in your &#039;moodledata&#039; area. The web server needs to be able to write to the &#039;sessions&#039; subdirectory. &lt;br /&gt;
* Your own computer (not your Moodle server) may have a firewall that is stripping referrer information from the browser. Here are some instructions for fixing [http://service1.symantec.com/SUPPORT/nip.nsf/46f26a2d6dafb0a788256bc7005c3fa3/b9b47ad7eddd343b88256c6b006a85a8?OpenDocument&amp;amp;src=bar_sch_nam Norton firewall products].&lt;br /&gt;
* Try deleting the &#039;&#039;sessions&#039;&#039; folder in your moodledata directory (anybody currently logged in will be thrown out)&lt;br /&gt;
* Try deleting cookies on your computer and/or try another browser or another client computer&lt;br /&gt;
* In &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; Session Handling&#039;&#039;, try setting a value for &#039;Cookie prefix&#039;. You can also do this by setting &amp;lt;code&amp;gt;$CFG-&amp;gt;sessioncookie=&#039;something&#039;;&amp;lt;/code&amp;gt; in config.php. This is especially true if you are using multiple Moodles on the same browser. &lt;br /&gt;
* Make sure you have not removed or changed the [[Password salting|Password Salt]] value(s) in config.php. If passwords were created using a salt the correct salt must be in config.php for those passwords to continue to work. This is easily done if you recreate config.php while performing an upgrade and forget to transfer the salt values. &lt;br /&gt;
* Do you have a .htaccess file in your Moodle folder (or its parent directories). If so, is there anything in there that might be causing trouble (strange redirects, access restrictions etc.)?&lt;br /&gt;
* Check the value of &#039;&#039;&#039;mnet_localhost_id&#039;&#039;&#039; in the mdl_config database table. It&#039;s normally 1 but must match the &#039;&#039;&#039;mnet_hostid&#039;&#039;&#039; field in your user records in the mdl_user table for the user to be recognised. It can sometimes get changed spuriously during upgrades or site migrations. &lt;br /&gt;
* Check config.php - it should NOT have any spaces/new lines at the end of code.&lt;br /&gt;
* You are using the correct username and password, yes?&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page. You &#039;&#039;&#039;could&#039;&#039;&#039; also try changing the admin password. Proceed as if you have lost it - see [[Administration FAQ]].&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==I log in but the login link doesn&#039;t change. I am logged in and can navigate freely.==&lt;br /&gt;
&lt;br /&gt;
Make sure the URL in your &amp;lt;code&amp;gt;$CFG-&amp;gt;wwwroot&amp;lt;/code&amp;gt; setting is exactly the same as the one you are actually using to access the site.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Uploaded files give &amp;quot;File not found&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
For example: Not Found: The requested URL /moodle/file.php/2/myfile.jpg was not found on this server.&lt;br /&gt;
&lt;br /&gt;
Your web server needs to be configured to allow the part of the URL after a script name to be passed directly to the script. This is usually enabled in Apache 1, but is usually disabled by default in Apache 2. To turn it on, add this line to your &#039;&#039;httpd.conf&#039;&#039;, or to a &#039;&#039;.htaccess&#039;&#039; file in your local directory (see [[Installing Moodle]] for more details):&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
Note, this will ONLY work for Apache versions 2.x.&lt;br /&gt;
&lt;br /&gt;
IIS 7 Server needs special configuration, IIS 6 is not supported any more. See [[Internet Information Services]] for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are unable to configure your server properly then you can switch Moodle to use an alternative method. The major disadvantages is that you will not be able to use SCORM packages at all and some Adobe Flash and Java applets will not work either.&lt;br /&gt;
&lt;br /&gt;
To use this alternative method, you should change the &#039;&#039;slasharguments&#039;&#039; variable. For moodle versions &amp;lt; 1.7, this is located in the Operating System section of &#039;&#039;Administration &amp;gt; Configuration &amp;gt; [[admin/config|Variables]]&#039;&#039;. In later versions, this option is located in &#039;&#039;Site Administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;. You should now be able to access your uploaded files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=145422 Troubleshooting Guide - 404 Errors] forum discussion.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Why are all my pages blank?==&lt;br /&gt;
&lt;br /&gt;
Check the dirroot variable in &#039;&#039;config.php&#039;&#039;. You must use complete, absolute pathnames (e.g.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dirroot = &amp;quot;/var/www/moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL (or whatever other database you are using). This is common on RedHat and OpenBSD installations. In this case, an error is generated, but since error displays are often disabled by default, all that is seen on the browser is a blank screen. To enable PHP error displays see [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | How to enable and check PHP error logs]].&lt;br /&gt;
&lt;br /&gt;
To determine if database support is your problem, insert this as the second line in your &#039;&#039;config.php&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
phpinfo();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if you chosen database is supported. If not, look for a package you are missing.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== Why is a particular page blank or incomplete? ==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your web server log files!!&#039;&#039;&#039; &lt;br /&gt;
:If a particular page is blank or incomplete (it doesn&#039;t display the footer), before you do anything else switch on [[Debugging]] and  [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your PHP error logs]]. Having established that PHP error logging is working, reproduce the error. Immediately check the error log file right at the end. Hopefully you will see a PHP error message at or very near the end of the file. This may solve your problem directly or makes it a lot easier to diagnose the problem in the Moodle forums.&lt;br /&gt;
&lt;br /&gt;
*If you are &#039;&#039;&#039;upgrading to a new version of Moodle&#039;&#039;&#039;, check that you do not have an old version of a non-standard block or module installed. Remove any such blocks or modules installed using the admin settings page and start the install process again. However, do also make sure that you have included all optional plugins that were required by your courses. This is particularly common with &amp;quot;editing on&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*If you &#039;&#039;&#039;do not see any blocks listed&#039;&#039;&#039;, turn editing on and remove any blocks that you have added to that page and try reloading.&lt;br /&gt;
&lt;br /&gt;
*You may get this error immediately after &#039;&#039;&#039;selecting a language&#039;&#039;&#039;. At this stage of the installation process your Moodle computer may need to connect to the Internet and download a language pack, so check that the computer can access the Internet by using a browser. Check also that your PHP settings are as given in the Moodle [[Installing_Moodle#Requirements | Moodle Requirements]] page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=97734 PHP configuration error] forum discussion&lt;br /&gt;
&lt;br /&gt;
==Installation hangs when setting-up database tables==&lt;br /&gt;
Sometimes the installation will hang when setting up tables, where only half the page displayed in the browser and/or other outputs are removed.  You may see truncated MySQL statements, or the “Scroll to continue” link is displayed but no “Continue” button is there. &lt;br /&gt;
&lt;br /&gt;
See [[Unexpected installation halts]] for more about solutions that involve:&lt;br /&gt;
*Checking for MySQL limits&lt;br /&gt;
*Checking the .htaccess files &lt;br /&gt;
*Code customizations issues&lt;br /&gt;
*Checking memory limit &lt;br /&gt;
*Upgrade incrementally&lt;br /&gt;
*Fix fopen function&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Why can&#039;t I upload a new image into my profile?==&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see anything on your user profile pages to let you upload user images then it&#039;s usually one of the following:&lt;br /&gt;
*The permissions associated with the role you are using are preventing you from changing your profile picture.&lt;br /&gt;
* GD is not installed, or is not enabled on your server. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going to &#039;&#039;Site Administration &amp;gt; Server &amp;gt; PHP info&#039;&#039; and looking for the gdversion setting. This setting is chosen automatically every time you visit that page. If it shows GD version 1 or version 2 then everything should be fine. Save that configuration page and go back to your user profile.&lt;br /&gt;
* GD is installed, but is in some way corrupt. For instance, [http://moodle.org/mod/forum/discuss.php?d=44271#p386194 see this discussion on empty lines or white spaces in config files.]&lt;br /&gt;
GD is a library that allows image processing. For example, when all is well with your system, and you upload a new profile image, GD compresses the image and produces two thumbnails, one is 100x100 pixels, and the other is 35x35 pixels.&lt;br /&gt;
&lt;br /&gt;
If Moodle thinks GD is not installed, then you will need to &#039;&#039;&#039;install the GD library&#039;&#039;&#039;. &lt;br /&gt;
*On Unix you may need to re-compile PHP with arguments something like this:&lt;br /&gt;
&lt;br /&gt;
 ./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --with-gd &lt;br /&gt;
 --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-ttf --enable-gd-native-ttf &lt;br /&gt;
 --enable-magic-quotes --with-mysql --enable-sockets --enable-track-vars &lt;br /&gt;
 --enable-versioning --with-zlib&lt;br /&gt;
&lt;br /&gt;
* On Windows this is usually a matter of &amp;quot;turning on&amp;quot; the extension in PHP by editing your php.ini file. To do this remove the semicolon for the php_gd2.dll extension - check that this file is actually present in your php extensions  folder first (search your php.ini for extension_dir to determine where this points to on your hard disk). You should then have a line that looks like this:&lt;br /&gt;
 extension=php_gd2.dll&lt;br /&gt;
&lt;br /&gt;
:Windows users should see the [[Installing AMP|installation instructions]] for further help. &lt;br /&gt;
&lt;br /&gt;
3. Remember to &#039;&#039;&#039;restart your webserver&#039;&#039;&#039; (if possible) and re-visit the Moodle configuration page after making any changes to PHP so it can pick up the correct version of GD.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;: Using Moodle forum discussion [http://moodle.org/mod/forum/discuss.php?d=44271 Profile pictures] for additional information.&lt;br /&gt;
&lt;br /&gt;
== Why doesn&#039;t my Moodle site display the time and date correctly? ==&lt;br /&gt;
&lt;br /&gt;
Each language requires a specific language code (called a &#039;&#039;&#039;locale&#039;&#039;&#039; code) to allow dates to be displayed correctly. The language packs contain default standard codes, but sometimes these don&#039;t work on Windows servers.&lt;br /&gt;
&lt;br /&gt;
You can find the correct locale codes for Windows on these two pages: [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp Language codes] and [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_country_strings.asp Country/region] codes (e.g. &amp;quot;esp_esp&amp;quot; for spanish)&lt;br /&gt;
&lt;br /&gt;
These new locale codes can be entered on the Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]] page, where they override the ones in the currently chosen language pack.&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
== How do I uninstall Moodle?==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Webhost/manual installation&#039;&#039;&#039;: If you have installed Moodle manually or have installed onto a webhost, follow these steps:&lt;br /&gt;
*Delete the moodle database using this mysql command (or delete using your mysql client, e.g. PHPMyAdmin):&lt;br /&gt;
&amp;lt;pre&amp;gt;sql&amp;gt;DROP DATABASE moodle;&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above example replace &#039;moodle&#039; with the name of the moodle database you created when installing.&lt;br /&gt;
*Delete the moodledata directory. If you, or your users, have uploaded materials into this directory take a copy of these before deleting this directory.&lt;br /&gt;
*Delete the moodle directory itself. This will delete all of the moodle PHP script files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XAMPP windows installation&#039;&#039;&#039;: If you have installed Moodle on windows through the XAMPP package, follow these steps:&lt;br /&gt;
*Open cmd.exe and navigate to this directory within your installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;server/mysql/bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Run this command, replacing USERNAME with your database username (the default is &amp;quot;root&amp;quot;) and DATABASE with your database name (the default is &amp;quot;moodle&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;mysqladmin.exe -u USERNAME -p drop DATABASE&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Enter your database password at the prompt (the default is &amp;quot;&amp;quot; [blank]).&lt;br /&gt;
*Enter &amp;quot;y&amp;quot; to confirm the database drop.&lt;br /&gt;
*Delete the moodledata directory. If you, or your users, have uploaded materials into this directory take a copy of these before deleting this directory.&lt;br /&gt;
*Delete the moodle directory itself. This will delete all of the moodle PHP script files.&lt;br /&gt;
&lt;br /&gt;
==Migrating Moodle to a new site or server==&lt;br /&gt;
Migrating Moodle means that you have to move the current installation to a new server, and so may have to change IP addresses or DNS entries. To do this you will need to change the $CFG-&amp;gt;wwwroot value in the config.php on the new server. You will also have to change any absolute links stored in the database backup file (before restoring the file on the new server) either using the admin/replace.php script, your text editor or another &amp;quot;search and replace&amp;quot; tool, e.g. sed. For more details see the [[Moodle_migration | Moodle Migration]] page.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Why does my new installation display correctly on the server, but when I view it from a different machine, styles and images are missing?==&lt;br /&gt;
In the installation instructions, one of the suggested settings for &#039;webroot&#039; is &#039;localhost&#039;. This is fine if all you want to do is some local testing of your new Moodle installation. If, however, you want to view your new installation from another machine on the same local area network, or view your site on the internet, you will have to change this setting:&lt;br /&gt;
*For local testing, &#039;localhost&#039; is fine for the webroot ($CFG-&amp;gt;wwwroot in config.php). &lt;br /&gt;
*If you want to test your site from other machines on the same local area network (LAN), then you will have to use the private ip address of the serving machine, (e.g. 192.168.1.2/moodle) or the network name of the serving computer (e.g. network_name_of_serving_machine/moodle) as the web root. Depending on your LAN setup, it may be better to use the network name of the computer rather than its (private) ip address, because the ip address can and will change from time to time. If you don&#039;t want to use the network name, then you will have to speak to your network administrator and have them assign a permanent ip address to the serving machine.&lt;br /&gt;
*Finally, if you want to test your new installation across the internet, you will have to use either a domain name or a permanent (public) ip address/moodle as your web root. To handle both types of access, see [https://docs.moodle.org/en/masquerading masquerading].&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Maximum upload file size - how to change it?==&lt;br /&gt;
There are several places to change the maximum file upload size. The first place to check is the Administration block.   Security -&amp;gt; Site Policies -&amp;gt; and look for &amp;quot;Maximum Uploaded File Size&amp;quot;.  This is the &amp;quot;maxbyte&amp;quot; variable found in older versions of Moodle (under Admin &amp;gt; Variables). Teachers may also set the maximum file size by the [[Course_settings#Maximum_upload_size|course administration block]].&lt;br /&gt;
&lt;br /&gt;
If the above does not provide a large enough figure you will need to make changes in your server settings. The usual place is in your php.ini file (go to Site administration &amp;gt; Server &amp;gt; PHPinfo and check a few lines down for its location). Look for settings &#039;&#039;&#039;upload_max_filesize&#039;&#039;&#039; and &#039;&#039;&#039;post_max_size&#039;&#039;&#039;, setting them both to your desired new value (e.g. &#039;64MB&#039;). You will need to restart the web server for these changes to take effect - e.g. on Linux, &#039;&#039;&#039;/etc/init.d/apache2 force-reload&#039;&#039;&#039;. Check your documentation or just reboot the server. &lt;br /&gt;
&lt;br /&gt;
For more help see:&lt;br /&gt;
*[[Administration_FAQ#How_do_the_limits_on_uploaded_files_work.3F]]&lt;br /&gt;
*[[Installing_Moodle#Recheck_PHP_settings]]&lt;br /&gt;
*[[Installing_Moodle#Using_a_.htaccess_file_for_webserver_and_PHP_settings]]&lt;br /&gt;
*[[Site_policies#Maximum_uploaded_file_size]]&lt;br /&gt;
*These forum posts: http://moodle.org/mod/forum/discuss.php?d=63840#287960 and http://moodle.org/mod/forum/discuss.php?d=93882#p414650&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Moodle claims PHP float handling is not compatible==&lt;br /&gt;
&lt;br /&gt;
The symptom is that when you try to install or upgrade your Moodle, you get a message &amp;quot;Detected unexpected problem in handling of PHP float numbers&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[http://moodle.org/mod/forum/discuss.php?d=114945 This forum thread] and MDL-18253 have more information. In short, this problem should not happen, you can help us by telling posting information about exactly which version of PHP, and OS you are using. That may let us find a way to work around this problem.&lt;br /&gt;
&lt;br /&gt;
You may be able to solve this issue by installing a more recent PHP versions. If you compile PHP yourself from source, changing the compilation options may help. However, since we don&#039;t understand the cause, we don&#039;t really know. If you do find a solution that works for you, please do tell us about it.&lt;br /&gt;
&lt;br /&gt;
Update: we have a guess that the problem may be the [http://au2.php.net/manual/en/ini.core.php#ini.precision &#039;precision&#039; setting in your php.ini file]. In a default PHP install this is set of 14. On at least one server that exhibited this problem it had been changed to a smaller value. So, if you see this problem, please try adding &lt;br /&gt;
 ini_set(&#039;precision&#039;, 14);&lt;br /&gt;
to your config.php file, and report your success in MDL-18253.&lt;br /&gt;
&lt;br /&gt;
==When upgrading Moodle claims my MySQL database is not UTF8 when I&#039;m sure it is==&lt;br /&gt;
&lt;br /&gt;
The UTF-8 detection for MySQL databases was finally fixed in Moodle 2.5, some incorrectly configured databases were previously reported as compatible. &lt;br /&gt;
&lt;br /&gt;
Please note it is not enough to alter the charset and collation of the database, you must fix each text column in each database table!&lt;br /&gt;
&lt;br /&gt;
Before going any further make sure you understand the difference between character encoding (how text is stored) and collations (the rules for comparing text strings). Collation problems will never cause this error but have a bunch of problems of their own.&lt;br /&gt;
&lt;br /&gt;
See [[Converting your MySQL database to UTF8]]&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== How do I run multiple instances of Moodle without duplicating base code? ==&lt;br /&gt;
&lt;br /&gt;
See [http://moodle.org/mod/forum/discuss.php?d=13211 this thread] for a detailed explanation by [[User:Martin_Langhoff| Martin Langhoff]].&lt;br /&gt;
&lt;br /&gt;
== What is FreeTDS and how can I use it in my installation? ==&lt;br /&gt;
[[Installing MSSQL for PHP|FreeTDS]] is an open source implementation of the Tabular Data Stream protocol used by Microsoft SQL Server and Sybase for their databases. Unfortunately, Microsoft servers don&#039;t usually accept TDS 5.0 connections. FreeTDS allows your Unix/Linux applications to talk to these other database products and import and export data between different systems successfully.&lt;br /&gt;
&lt;br /&gt;
== How do I install a plugin? ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Installing plugins]].&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t enable a plugin on the Plugins overview page because the icon is not clickable==&lt;br /&gt;
The open and closed eye icon on the Plugins overview page is simply there to show whether or not a plugin is enabled. You can&#039;t edit plugins from this screen. If you wish to enable a plugin, to to the appropriate page for managing the type of plugin you need, for instance &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Repositories&amp;gt;Manage repositories&#039;&#039; or &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Activity modules&amp;gt;Manage activities.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* [[Beginning_Moodle_2.0_Administration|Beginning Moodle 2.0 Administration FAQ]]&lt;br /&gt;
&lt;br /&gt;
Installing Moodle in a shared web hosting environment:&lt;br /&gt;
* [[Finding_and_Selecting_A_Web_Host|Finding and Selecting a web host]]&lt;br /&gt;
* [[Installing_Moodle_on_SmarterASP.NET|Installing Moodle on SmarterASP.NET web hosting]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[de:Installation FAQ]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installation_FAQ&amp;diff=109337</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installation_FAQ&amp;diff=109337"/>
		<updated>2014-01-26T09:55:55Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* What Dynamic Extensions do I really need uncommented in my php.ini file? What else do I need to change? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
== System information needed for Installation problems forum ==&lt;br /&gt;
When posting questions to the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum], try to provide as much background information as possible about your Moodle system. Consider providing some or all of the following:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* PHP version (e.g. PHP 5.3.3)&lt;br /&gt;
* Database server type and version (e.g. MySQL 5.5.18)&lt;br /&gt;
* Browser and version (e.g. Firefox, IE8):&lt;br /&gt;
* Moodle version (e.g. 2.6):&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached (please remove passwords):&lt;br /&gt;
* Phpinfo attached?:&lt;br /&gt;
&lt;br /&gt;
Make sure you provide a sensible description (never HELP! or URGENT!) and a full description of what you did and what happened. Copy and paste any error messages accurately in full. &#039;Nothing&#039; is not a symptom, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==PHP - is it installed and what version do I have?==&lt;br /&gt;
&lt;br /&gt;
Make a new file on your web site called &#039;&#039;info.php&#039;&#039;, containing the following text, and call it from your browser:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?PHP phpinfo() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If nothing happens then you don&#039;t have PHP installed or your webserver is not configured to handle .php files properly. See the installation docs for some information about where to download it for your computer. See the [[phpinfo]] page for details about the content of this page.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==I am being told that I need the &#039;&#039;&#039;intl php plugin&#039;&#039;&#039; to continue to install Moodle 2.x==&lt;br /&gt;
The intl.dll from Zend is part of the PHP 5.2.8 release and later. It is aimed at improving the internationalization of php pages and Moodle 2.x uses it as part of this process. If your install is on a local machine or network, then you can download the latest version of PHP and update your PHP. You then have to uncomment all the required dynamic extensions you need, including the php_intl.dll extension. The problem is then solved. If the install is on a host server, then you need to contact your host and ask them to do the same, As an alternative, you can unzip/untar the download file, copy and paste the intl.dll file to your php/ext folder and include the line:&lt;br /&gt;
  extension=php_intl.dll&lt;br /&gt;
in the Dynamic Extensions section of your php.ini file.&lt;br /&gt;
&lt;br /&gt;
You can also set the error level using:&lt;br /&gt;
  intl.error_level = E_WARNING &lt;br /&gt;
but this is not essential&lt;br /&gt;
&lt;br /&gt;
If you are using a Linux install, use your system package manager or specify compilation flag.&lt;br /&gt;
    * Debian 5.0 (&amp;amp; Ubuntu) use: apt-get install php-intl or apt-get install php5-intl &lt;br /&gt;
    * CentOS 5.5 (&amp;amp; RedHat) you should (probably) be using php 5.3 from remi and then use: yum install php-intl&lt;br /&gt;
&lt;br /&gt;
This technique can be applied to any updated dynamic extension from Zend. You may want to use later dll files in your php/ext folder, you can do so by doing the same as above, but be careful, your version may not be able to take full advantage of the extension, or some very new extensions may cause an unexpected instability. The best option is still to update on a regular basis, perhaps once a year or so for the PHP.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
===What Dynamic Extensions do I really need uncommented in my php.ini file? What else do I need to change?===&lt;br /&gt;
This assumes you have complete control over the installation and running of your server, if your Moodle is hosted, you need to do something different, which is also discussed below. In the php.ini you need to delete the semi-colon, the ;, from the start of any line to uncomment it. For Moodle, you really should only need to change some values, and make sure the extensions you require are available. These are:&lt;br /&gt;
&lt;br /&gt;
Resource Limits&lt;br /&gt;
  memory_limit = 128M     //This is the maximum it requires and on a shared server you may get much less. &lt;br /&gt;
&lt;br /&gt;
Data Handling &lt;br /&gt;
  post_max_size = 512M    //This allows postings of up to 512MB, but set it to suit yourself and your circumstances&lt;br /&gt;
&lt;br /&gt;
Paths and Directories&lt;br /&gt;
  doc_root =&amp;quot;driveletter:\path\to\server\active\web\directory&amp;quot;  (e.g. d:\Apache\htdocs or e:\iis\wwwroot )&lt;br /&gt;
  and&lt;br /&gt;
  extension_dir = &amp;quot;driveletter:\path\to\php\ext&amp;quot; (e.g. d:\php\ext or e:\iis\php\ext)&lt;br /&gt;
&lt;br /&gt;
File Uploads&lt;br /&gt;
  upload_max_filesize = 512M    (This is different from the post_max_size this is for file uploads.)&lt;br /&gt;
&lt;br /&gt;
Dynamic Extensions (&#039;&#039;&#039;Windows Only&#039;&#039;&#039;)&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP 5.3.x&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  extension=php_curl.dll&lt;br /&gt;
  extension=php_gd2.dll&lt;br /&gt;
  extension=php_gettext.dll&lt;br /&gt;
  extension=php_intl.dll&lt;br /&gt;
  extension=php_imap.dll&lt;br /&gt;
  extension=php_ldap.dll&lt;br /&gt;
  extension=php_mbstring.dll&lt;br /&gt;
  extension=php_exif.dll      ; Must be after mbstring as it depends on it&lt;br /&gt;
  extension=php_mysql.dll&lt;br /&gt;
  extension=php_mysqli.dll&lt;br /&gt;
  extension=php_openssl.dll&lt;br /&gt;
  extension=php_pdo_mssql.dll&lt;br /&gt;
  extension=php_pdo_mysql.dll&lt;br /&gt;
  extension=php_soap.dll&lt;br /&gt;
  extension=php_sockets.dll&lt;br /&gt;
  extension=php_sqlite.dll&lt;br /&gt;
  extension=php_xmlrpc.dll&lt;br /&gt;
  extension=php_zip.dll&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These edits and Dynamic extensions cover a range of options here, there are a number of other possibilities, but these listed are the most common ones. Unless you have a specific need, there may not be any reason to deviate from these settings, but if you do, make sure you know what is going to happen. These extensions will also allow you to successfully install and run many other PHP applications. &lt;br /&gt;
&lt;br /&gt;
One example is the Oracle extensions are not shown here, but Oracle can be used for the Moodle database. Another area people often get themselves into trouble is using &amp;quot;Magic quotes&amp;quot;. Magic quotes really should be set to off, they were only introduced early in the use of PHP to allow for some inexperienced scripting practices, (read poor, shoddy or dodgy here). If someone is still writing poor scripts, then they deserve to draw attention to themselves and their scripts deleted.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==What &amp;amp; where are Moodle&#039;s configuration settings stored?==&lt;br /&gt;
Configuration settings are stored in the config.php file stored in your moodle folder. This file is created during the installation process. If there is a problem and the installation cannot create the file, you can try creating it manually from the [[Configuration file]] docs. &lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
It is possible to download previous versions of Moodle that are not found on the  [http://download.moodle.org Standard Moodle Download page].  There are zip and tgz compressed located at &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]&amp;lt;/nowiki&amp;gt; (see links below). &lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:75%; height:75px&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
| 2.0 Versions || [http://download.moodle.org/stable19 1.9 Versions]  || [http://download.moodle.org/stable18 1.8 Versions] &lt;br /&gt;
|- &lt;br /&gt;
|[http://download.moodle.org/stable17 1.7 Versions] || [http://download.moodle.org/stable16 1.6 Versions] || [http://download.moodle.org/stable15/ 1.5 Versions] &lt;br /&gt;
|-&lt;br /&gt;
| [http://download.moodle.org/stable14 1.4 Versions] || [http://download.moodle.org/stable13 1.3 Versions]  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You can download previous releases by using wget, lynx or curl with this URL:&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]&amp;lt;/nowiki&amp;gt;. &lt;br /&gt;
:For example: to download Moodle version 1.5, use &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable15&amp;lt;/nowiki&amp;gt;. You&#039;ll see a directory tree with the files displayed. Click on the one you want and download as normal - if you require the latest update of the version, scroll to the end of the list and download the &amp;quot;moodle-latest&amp;quot; file.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download other releases not found in [http://download.moodle.org/windows/ Moodle packages for Windows], use this URL:&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/windows/MoodleWindowsInstaller-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Mac Packages&#039;&#039;&#039;: To download other releases not found in [http://download.moodle.org/macosx/ Mac packages], use either of these URLs (depending on whether you need the Intel or PPC package):&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/macosx/Moodle4Mac-Intel-[version_number].dmg&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/macosx/Moodle4Mac-PPC-[version_number}.dmg&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== How to enable and check PHP error logs==&lt;br /&gt;
PHP can be set up to log errors in a variety of different ways: two of these involve the use of the php.ini file and the ini_set command.  See [[PHP error logs]].&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Could not find a top level course&amp;quot; ==&lt;br /&gt;
If this appears immediately after you have attempted to install Moodle it almost certainly means that the installation did not complete. A complete installation will ask you for the administrator profile and to name the site just before it completes. Check your logs for errors. Then drop the database and start again. If you used the web-based installer try the command line one. Does your computer definitely have sufficient resource to run Moodle?&lt;br /&gt;
&lt;br /&gt;
==Email copies are not being sent from my forums==&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;must&#039;&#039; set up cron properly if you want Moodle to send out automatic email from forums, assignments etc. This same process also performs a number of clean-up tasks such as deleting old unconfirmed users, unenrolling old students and so on. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Try the default settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. This generally works. Except...&lt;br /&gt;
* On a Windows server you *must* supply the address of an SMTP server (Windows, unlike Unix, does not have a build in mail server) in the above settings page&lt;br /&gt;
* Make sure that &#039;&#039;allowuseremailcharset&#039;&#039; in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039; is set to No unless you really know what you are doing. Setting this to Yes can cause a problem in some versions of Moodle.&lt;br /&gt;
* Check your firewall or ask your network administrator. Many mail servers are heavily locked down and you may need permission to send mail through them.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t log in - I just stay stuck on the login screen==&lt;br /&gt;
&lt;br /&gt;
This may also apply if you are seeing  “Your session has timed out. Please login again” or &amp;quot;A server error that affects your login session was detected. Please login again or restart your browser&amp;quot; and cannot log in.&lt;br /&gt;
&lt;br /&gt;
The following are possible causes and actions you can take (in no particular order):&lt;br /&gt;
&lt;br /&gt;
* Check first that your main admin account (which will be a manual account) is also a problem. If your users are using an external authentication method (e.g. LDAP) that could be the problem. Isolate the fault and make sure it really is Moodle before going any further.&lt;br /&gt;
* Check that your hard disk is not full or if your server is on shared hosting check that you have not reached your disk space quota. This will prevent new sessions being created and nobody will be able to log in. &lt;br /&gt;
* Carefully check the permissions in your &#039;moodledata&#039; area. The web server needs to be able to write to the &#039;sessions&#039; subdirectory. &lt;br /&gt;
* Your own computer (not your Moodle server) may have a firewall that is stripping referrer information from the browser. Here are some instructions for fixing [http://service1.symantec.com/SUPPORT/nip.nsf/46f26a2d6dafb0a788256bc7005c3fa3/b9b47ad7eddd343b88256c6b006a85a8?OpenDocument&amp;amp;src=bar_sch_nam Norton firewall products].&lt;br /&gt;
* Try deleting the &#039;&#039;sessions&#039;&#039; folder in your moodledata directory (anybody currently logged in will be thrown out)&lt;br /&gt;
* Try deleting cookies on your computer and/or try another browser or another client computer&lt;br /&gt;
* In &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; Session Handling&#039;&#039;, try setting a value for &#039;Cookie prefix&#039;. You can also do this by setting &amp;lt;code&amp;gt;$CFG-&amp;gt;sessioncookie=&#039;something&#039;;&amp;lt;/code&amp;gt; in config.php. This is especially true if you are using multiple Moodles on the same browser. &lt;br /&gt;
* Make sure you have not removed or changed the [[Password salting|Password Salt]] value(s) in config.php. If passwords were created using a salt the correct salt must be in config.php for those passwords to continue to work. This is easily done if you recreate config.php while performing an upgrade and forget to transfer the salt values. &lt;br /&gt;
* Do you have a .htaccess file in your Moodle folder (or its parent directories). If so, is there anything in there that might be causing trouble (strange redirects, access restrictions etc.)?&lt;br /&gt;
* Check the value of &#039;&#039;&#039;mnet_localhost_id&#039;&#039;&#039; in the mdl_config database table. It&#039;s normally 1 but must match the &#039;&#039;&#039;mnet_hostid&#039;&#039;&#039; field in your user records in the mdl_user table for the user to be recognised. It can sometimes get changed spuriously during upgrades or site migrations. &lt;br /&gt;
* Check config.php - it should NOT have any spaces/new lines at the end of code.&lt;br /&gt;
* You are using the correct username and password, yes?&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page. You &#039;&#039;&#039;could&#039;&#039;&#039; also try changing the admin password. Proceed as if you have lost it - see [[Administration FAQ]].&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==I log in but the login link doesn&#039;t change. I am logged in and can navigate freely.==&lt;br /&gt;
&lt;br /&gt;
Make sure the URL in your &amp;lt;code&amp;gt;$CFG-&amp;gt;wwwroot&amp;lt;/code&amp;gt; setting is exactly the same as the one you are actually using to access the site.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Uploaded files give &amp;quot;File not found&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
For example: Not Found: The requested URL /moodle/file.php/2/myfile.jpg was not found on this server.&lt;br /&gt;
&lt;br /&gt;
Your web server needs to be configured to allow the part of the URL after a script name to be passed directly to the script. This is usually enabled in Apache 1, but is usually disabled by default in Apache 2. To turn it on, add this line to your &#039;&#039;httpd.conf&#039;&#039;, or to a &#039;&#039;.htaccess&#039;&#039; file in your local directory (see [[Installing Moodle]] for more details):&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
Note, this will ONLY work for Apache versions 2.x.&lt;br /&gt;
&lt;br /&gt;
IIS 7 Server needs special configuration, IIS 6 is not supported any more. See [[Internet Information Services]] for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are unable to configure your server properly then you can switch Moodle to use an alternative method. The major disadvantages is that you will not be able to use SCORM packages at all and some Adobe Flash and Java applets will not work either.&lt;br /&gt;
&lt;br /&gt;
To use this alternative method, you should change the &#039;&#039;slasharguments&#039;&#039; variable. For moodle versions &amp;lt; 1.7, this is located in the Operating System section of &#039;&#039;Administration &amp;gt; Configuration &amp;gt; [[admin/config|Variables]]&#039;&#039;. In later versions, this option is located in &#039;&#039;Site Administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;. You should now be able to access your uploaded files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=145422 Troubleshooting Guide - 404 Errors] forum discussion.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Why are all my pages blank?==&lt;br /&gt;
&lt;br /&gt;
Check the dirroot variable in &#039;&#039;config.php&#039;&#039;. You must use complete, absolute pathnames (e.g.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dirroot = &amp;quot;/var/www/moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL (or whatever other database you are using). This is common on RedHat and OpenBSD installations. In this case, an error is generated, but since error displays are often disabled by default, all that is seen on the browser is a blank screen. To enable PHP error displays see [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | How to enable and check PHP error logs]].&lt;br /&gt;
&lt;br /&gt;
To determine if database support is your problem, insert this as the second line in your &#039;&#039;config.php&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
phpinfo();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if you chosen database is supported. If not, look for a package you are missing.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== Why is a particular page blank or incomplete? ==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your web server log files!!&#039;&#039;&#039; &lt;br /&gt;
:If a particular page is blank or incomplete (it doesn&#039;t display the footer), before you do anything else switch on [[Debugging]] and  [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your PHP error logs]]. Having established that PHP error logging is working, reproduce the error. Immediately check the error log file right at the end. Hopefully you will see a PHP error message at or very near the end of the file. This may solve your problem directly or makes it a lot easier to diagnose the problem in the Moodle forums.&lt;br /&gt;
&lt;br /&gt;
*If you are &#039;&#039;&#039;upgrading to a new version of Moodle&#039;&#039;&#039;, check that you do not have an old version of a non-standard block or module installed. Remove any such blocks or modules installed using the admin settings page and start the install process again. However, do also make sure that you have included all optional plugins that were required by your courses. This is particularly common with &amp;quot;editing on&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*If you &#039;&#039;&#039;do not see any blocks listed&#039;&#039;&#039;, turn editing on and remove any blocks that you have added to that page and try reloading.&lt;br /&gt;
&lt;br /&gt;
*You may get this error immediately after &#039;&#039;&#039;selecting a language&#039;&#039;&#039;. At this stage of the installation process your Moodle computer may need to connect to the Internet and download a language pack, so check that the computer can access the Internet by using a browser. Check also that your PHP settings are as given in the Moodle [[Installing_Moodle#Requirements | Moodle Requirements]] page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=97734 PHP configuration error] forum discussion&lt;br /&gt;
&lt;br /&gt;
==Installation hangs when setting-up database tables==&lt;br /&gt;
Sometimes the installation will hang when setting up tables, where only half the page displayed in the browser and/or other outputs are removed.  You may see truncated MySQL statements, or the “Scroll to continue” link is displayed but no “Continue” button is there. &lt;br /&gt;
&lt;br /&gt;
See [[Unexpected installation halts]] for more about solutions that involve:&lt;br /&gt;
*Checking for MySQL limits&lt;br /&gt;
*Checking the .htaccess files &lt;br /&gt;
*Code customizations issues&lt;br /&gt;
*Checking memory limit &lt;br /&gt;
*Upgrade incrementally&lt;br /&gt;
*Fix fopen function&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Why can&#039;t I upload a new image into my profile?==&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see anything on your user profile pages to let you upload user images then it&#039;s usually one of the following:&lt;br /&gt;
*The permissions associated with the role you are using are preventing you from changing your profile picture.&lt;br /&gt;
* GD is not installed, or is not enabled on your server. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going to &#039;&#039;Site Administration &amp;gt; Server &amp;gt; PHP info&#039;&#039; and looking for the gdversion setting. This setting is chosen automatically every time you visit that page. If it shows GD version 1 or version 2 then everything should be fine. Save that configuration page and go back to your user profile.&lt;br /&gt;
* GD is installed, but is in some way corrupt. For instance, [http://moodle.org/mod/forum/discuss.php?d=44271#p386194 see this discussion on empty lines or white spaces in config files.]&lt;br /&gt;
GD is a library that allows image processing. For example, when all is well with your system, and you upload a new profile image, GD compresses the image and produces two thumbnails, one is 100x100 pixels, and the other is 35x35 pixels.&lt;br /&gt;
&lt;br /&gt;
If Moodle thinks GD is not installed, then you will need to &#039;&#039;&#039;install the GD library&#039;&#039;&#039;. &lt;br /&gt;
*On Unix you may need to re-compile PHP with arguments something like this:&lt;br /&gt;
&lt;br /&gt;
 ./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --with-gd &lt;br /&gt;
 --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-ttf --enable-gd-native-ttf &lt;br /&gt;
 --enable-magic-quotes --with-mysql --enable-sockets --enable-track-vars &lt;br /&gt;
 --enable-versioning --with-zlib&lt;br /&gt;
&lt;br /&gt;
* On Windows this is usually a matter of &amp;quot;turning on&amp;quot; the extension in PHP by editing your php.ini file. To do this remove the semicolon for the php_gd2.dll extension - check that this file is actually present in your php extensions  folder first (search your php.ini for extension_dir to determine where this points to on your hard disk). You should then have a line that looks like this:&lt;br /&gt;
 extension=php_gd2.dll&lt;br /&gt;
&lt;br /&gt;
:Windows users should see the [[Installing AMP|installation instructions]] for further help. &lt;br /&gt;
&lt;br /&gt;
3. Remember to &#039;&#039;&#039;restart your webserver&#039;&#039;&#039; (if possible) and re-visit the Moodle configuration page after making any changes to PHP so it can pick up the correct version of GD.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;: Using Moodle forum discussion [http://moodle.org/mod/forum/discuss.php?d=44271 Profile pictures] for additional information.&lt;br /&gt;
&lt;br /&gt;
== Why doesn&#039;t my Moodle site display the time and date correctly? ==&lt;br /&gt;
&lt;br /&gt;
Each language requires a specific language code (called a &#039;&#039;&#039;locale&#039;&#039;&#039; code) to allow dates to be displayed correctly. The language packs contain default standard codes, but sometimes these don&#039;t work on Windows servers.&lt;br /&gt;
&lt;br /&gt;
You can find the correct locale codes for Windows on these two pages: [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp Language codes] and [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_country_strings.asp Country/region] codes (e.g. &amp;quot;esp_esp&amp;quot; for spanish)&lt;br /&gt;
&lt;br /&gt;
These new locale codes can be entered on the Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]] page, where they override the ones in the currently chosen language pack.&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
== How do I uninstall Moodle?==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Webhost/manual installation&#039;&#039;&#039;: If you have installed Moodle manually or have installed onto a webhost, follow these steps:&lt;br /&gt;
*Delete the moodle database using this mysql command (or delete using your mysql client, e.g. PHPMyAdmin):&lt;br /&gt;
&amp;lt;pre&amp;gt;sql&amp;gt;DROP DATABASE moodle;&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above example replace &#039;moodle&#039; with the name of the moodle database you created when installing.&lt;br /&gt;
*Delete the moodledata directory. If you, or your users, have uploaded materials into this directory take a copy of these before deleting this directory.&lt;br /&gt;
*Delete the moodle directory itself. This will delete all of the moodle PHP script files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XAMPP windows installation&#039;&#039;&#039;: If you have installed Moodle on windows through the XAMPP package, follow these steps:&lt;br /&gt;
*Open cmd.exe and navigate to this directory within your installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;server/mysql/bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Run this command, replacing USERNAME with your database username (the default is &amp;quot;root&amp;quot;) and DATABASE with your database name (the default is &amp;quot;moodle&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;mysqladmin.exe -u USERNAME -p drop DATABASE&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Enter your database password at the prompt (the default is &amp;quot;&amp;quot; [blank]).&lt;br /&gt;
*Enter &amp;quot;y&amp;quot; to confirm the database drop.&lt;br /&gt;
*Delete the moodledata directory. If you, or your users, have uploaded materials into this directory take a copy of these before deleting this directory.&lt;br /&gt;
*Delete the moodle directory itself. This will delete all of the moodle PHP script files.&lt;br /&gt;
&lt;br /&gt;
==Migrating Moodle to a new site or server==&lt;br /&gt;
Migrating Moodle means that you have to move the current installation to a new server, and so may have to change IP addresses or DNS entries. To do this you will need to change the $CFG-&amp;gt;wwwroot value in the config.php on the new server. You will also have to change any absolute links stored in the database backup file (before restoring the file on the new server) either using the admin/replace.php script, your text editor or another &amp;quot;search and replace&amp;quot; tool, e.g. sed. For more details see the [[Moodle_migration | Moodle Migration]] page.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Why does my new installation display correctly on the server, but when I view it from a different machine, styles and images are missing?==&lt;br /&gt;
In the installation instructions, one of the suggested settings for &#039;webroot&#039; is &#039;localhost&#039;. This is fine if all you want to do is some local testing of your new Moodle installation. If, however, you want to view your new installation from another machine on the same local area network, or view your site on the internet, you will have to change this setting:&lt;br /&gt;
*For local testing, &#039;localhost&#039; is fine for the webroot ($CFG-&amp;gt;wwwroot in config.php). &lt;br /&gt;
*If you want to test your site from other machines on the same local area network (LAN), then you will have to use the private ip address of the serving machine, (e.g. 192.168.1.2/moodle) or the network name of the serving computer (e.g. network_name_of_serving_machine/moodle) as the web root. Depending on your LAN setup, it may be better to use the network name of the computer rather than its (private) ip address, because the ip address can and will change from time to time. If you don&#039;t want to use the network name, then you will have to speak to your network administrator and have them assign a permanent ip address to the serving machine.&lt;br /&gt;
*Finally, if you want to test your new installation across the internet, you will have to use either a domain name or a permanent (public) ip address/moodle as your web root. To handle both types of access, see [https://docs.moodle.org/en/masquerading masquerading].&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Maximum upload file size - how to change it?==&lt;br /&gt;
There are several places to change the maximum file upload size. The first place to check is the Administration block.   Security -&amp;gt; Site Policies -&amp;gt; and look for &amp;quot;Maximum Uploaded File Size&amp;quot;.  This is the &amp;quot;maxbyte&amp;quot; variable found in older versions of Moodle (under Admin &amp;gt; Variables). Teachers may also set the maximum file size by the [[Course_settings#Maximum_upload_size|course administration block]].&lt;br /&gt;
&lt;br /&gt;
If the above does not provide a large enough figure you will need to make changes in your server settings. The usual place is in your php.ini file (go to Site administration &amp;gt; Server &amp;gt; PHPinfo and check a few lines down for its location). Look for settings &#039;&#039;&#039;upload_max_filesize&#039;&#039;&#039; and &#039;&#039;&#039;post_max_size&#039;&#039;&#039;, setting them both to your desired new value (e.g. &#039;64MB&#039;). You will need to restart the web server for these changes to take effect - e.g. on Linux, &#039;&#039;&#039;/etc/init.d/apache2 force-reload&#039;&#039;&#039;. Check your documentation or just reboot the server. &lt;br /&gt;
&lt;br /&gt;
For more help see:&lt;br /&gt;
*[[Administration_FAQ#How_do_the_limits_on_uploaded_files_work.3F]]&lt;br /&gt;
*[[Installing_Moodle#Recheck_PHP_settings]]&lt;br /&gt;
*[[Installing_Moodle#Using_a_.htaccess_file_for_webserver_and_PHP_settings]]&lt;br /&gt;
*[[Site_policies#Maximum_uploaded_file_size]]&lt;br /&gt;
*These forum posts: http://moodle.org/mod/forum/discuss.php?d=63840#287960 and http://moodle.org/mod/forum/discuss.php?d=93882#p414650&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Moodle claims PHP float handling is not compatible==&lt;br /&gt;
&lt;br /&gt;
The symptom is that when you try to install or upgrade your Moodle, you get a message &amp;quot;Detected unexpected problem in handling of PHP float numbers&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[http://moodle.org/mod/forum/discuss.php?d=114945 This forum thread] and MDL-18253 have more information. In short, this problem should not happen, you can help us by telling posting information about exactly which version of PHP, and OS you are using. That may let us find a way to work around this problem.&lt;br /&gt;
&lt;br /&gt;
You may be able to solve this issue by installing a more recent PHP versions. If you compile PHP yourself from source, changing the compilation options may help. However, since we don&#039;t understand the cause, we don&#039;t really know. If you do find a solution that works for you, please do tell us about it.&lt;br /&gt;
&lt;br /&gt;
Update: we have a guess that the problem may be the [http://au2.php.net/manual/en/ini.core.php#ini.precision &#039;precision&#039; setting in your php.ini file]. In a default PHP install this is set of 14. On at least one server that exhibited this problem it had been changed to a smaller value. So, if you see this problem, please try adding &lt;br /&gt;
 ini_set(&#039;precision&#039;, 14);&lt;br /&gt;
to your config.php file, and report your success in MDL-18253.&lt;br /&gt;
&lt;br /&gt;
==When upgrading Moodle claims my MySQL database is not UTF8 when I&#039;m sure it is==&lt;br /&gt;
&lt;br /&gt;
The UTF-8 detection for MySQL databases was finally fixed in Moodle 2.5, some incorrectly configured databases were previously reported as compatible. &lt;br /&gt;
&lt;br /&gt;
Please note it is not enough to alter the charset and collation of the database, you must fix each text column in each database table!&lt;br /&gt;
&lt;br /&gt;
See [[Converting your MySQL database to UTF8]]&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== How do I run multiple instances of Moodle without duplicating base code? ==&lt;br /&gt;
&lt;br /&gt;
See [http://moodle.org/mod/forum/discuss.php?d=13211 this thread] for a detailed explanation by [[User:Martin_Langhoff| Martin Langhoff]].&lt;br /&gt;
&lt;br /&gt;
== What is FreeTDS and how can I use it in my installation? ==&lt;br /&gt;
[[Installing MSSQL for PHP|FreeTDS]] is an open source implementation of the Tabular Data Stream protocol used by Microsoft SQL Server and Sybase for their databases. Unfortunately, Microsoft servers don&#039;t usually accept TDS 5.0 connections. FreeTDS allows your Unix/Linux applications to talk to these other database products and import and export data between different systems successfully.&lt;br /&gt;
&lt;br /&gt;
== How do I install a plugin? ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Installing plugins]].&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t enable a plugin on the Plugins overview page because the icon is not clickable==&lt;br /&gt;
The open and closed eye icon on the Plugins overview page is simply there to show whether or not a plugin is enabled. You can&#039;t edit plugins from this screen. If you wish to enable a plugin, to to the appropriate page for managing the type of plugin you need, for instance &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Repositories&amp;gt;Manage repositories&#039;&#039; or &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Activity modules&amp;gt;Manage activities.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* [[Beginning_Moodle_2.0_Administration|Beginning Moodle 2.0 Administration FAQ]]&lt;br /&gt;
&lt;br /&gt;
Installing Moodle in a shared web hosting environment:&lt;br /&gt;
* [[Finding_and_Selecting_A_Web_Host|Finding and Selecting a web host]]&lt;br /&gt;
* [[Installing_Moodle_on_SmarterASP.NET|Installing Moodle on SmarterASP.NET web hosting]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[de:Installation FAQ]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=108758</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=108758"/>
		<updated>2014-01-06T14:45:00Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* If something goes wrong... */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]). These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (also sometimes known as the LAMP platform). If in doubt, this is the safest combination (if for no other reason than being the most common). There are other options - see the Software section that follows:&lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 160MB free (min) plus as much as you need to store your materials. 5GB is probably a realistic minimum. &lt;br /&gt;
* Backups: at least the same again (at a remote location preferably) as above to keep backups of your site&lt;br /&gt;
* Memory: 256MB (min), 1GB or more is strongly recommended. The general rule of thumb is that Moodle can support 10 to 20 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination and the type of use. &#039;Concurrent&#039; really means web server processes in memory at the same time (i.e. users interacting with the system within a window of a few seconds). It does NOT mean people &#039;logged in&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
* An operating system (!). Anything that runs the following software; although the choice will most likely depend on the performance you need and the skills you have available. Linux and Windows are the most common choices (and good support is available). If you have a free choice, Linux is generally regarded to be the optimal platform. Moodle is regularly tested with Debian, Ubuntu, CentOS, RedHat, Windows 7/2012 and Mac OS X.&lt;br /&gt;
* Web server, primarily [[Apache]]. Not fully tested (or supported) but should work are [[IIS]], [http://www.lighttpd.net/ lightttpd], [http://nginx.org/ nginx], [http://www.cherokee-project.com/ cherokee], zeus and [http://litespeedtech.com/ LiteSpeed]. Moodle will refuse to install on any other web server. Your web server needs to be correctly configured to serve PHP files.The version is not critical but try to use the newest web server build available to you. &lt;br /&gt;
* [[PHP]] - The minimum version is currently 5.3.3. A number of extensions are required; see the [[PHP]] page for full details. Installation will halt at the environment check if any of the required extensions are missing. If available, PHP 5.5 and newer contain [[OPcache]] which is recommended (you can ignore the environment check for this if not available).&lt;br /&gt;
* A database. MySQL and PostgreSQL are the primary development database, the most comprehensively tested and have extensive documentation and support. MSSQL is fully supported (note that optional plugins may be untested with these databases) but documentation and online help are not as comprehensive as MySQL/PostgreSQL. Oracle database is not fully supported and is not recommended. If in doubt use MySQL (more documentation) or PostgreSQL (better stability/performance). You will need the appropriate PHP extension (configured if need be) for your chosen database.&lt;br /&gt;
** [[MySQL]] - minimum version 5.1.33&lt;br /&gt;
** [[MariaDB]] - minimum version 5.3.5 (drop-in replacement for Oracle&#039;s MySQL)&lt;br /&gt;
** [[PostgreSQL]] - minimum version 8.3&lt;br /&gt;
** [[MSSQL]] - minimum version 9.0&lt;br /&gt;
** [[Oracle]] - minimum version 10.2 (not recommended)&lt;br /&gt;
* Minimum browser for accessing Moodle: recent Firefox, Internet Explorer 9, Safari 6, recent Google Chrome 11 (lower versions may work but are not fully supported)&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
...or desktop computer, if you are just evaluating Moodle. There are lots of possibilities for installing the basic server software depending on your particular choices. Some links and pointers are at [[Installing AMP]]&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted server all this should be done for you. However, (especially on shared hosting) make sure you understand or find out how to change PHP settings (e.g. file upload maximums). This can vary a huge amount from host to host.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone -b MOODLE_26_STABLE git://git.moodle.org/moodle.git &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
...this fetches a complete copy of the Moodle repository and then switches to the 2.6 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in add-on installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]]&lt;br /&gt;
* [[MySQL]]&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions. &lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Settings&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date.&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Talk:Step-by-step_Installation_Guide_for_Ubuntu&amp;diff=108660</id>
		<title>Talk:Step-by-step Installation Guide for Ubuntu</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Talk:Step-by-step_Installation_Guide_for_Ubuntu&amp;diff=108660"/>
		<updated>2014-01-02T14:48:15Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Are you sure you going to leave the permissions at these:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo chmod 777 /var/moodledata&lt;br /&gt;
sudo chmod 777 /var/www/moodle&amp;lt;/pre&amp;gt;&lt;br /&gt;
???&lt;br /&gt;
[[User:Visvanath Ratnaweera|Visvanath Ratnaweera]] 04:44, 1 April 2013 (WST)&lt;br /&gt;
&lt;br /&gt;
...and Step 4 won&#039;t work as it sits. You only have &#039;sudo&#039; for the original clone. You&#039;re missing lots of additional &#039;sudo&#039;s or a &#039;chown&#039;. &lt;br /&gt;
--[[User:Howard Miller|Howard Miller]] ([[User talk:Howard Miller|talk]]) 22:48, 2 January 2014 (WST)&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Errors_FAQ&amp;diff=108623</id>
		<title>Errors FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Errors_FAQ&amp;diff=108623"/>
		<updated>2014-01-02T08:21:32Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Fatal error allowed memory size exhausted. How do I increase my php memory limit? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Managing a Moodle site}}==Error: database connection failed==&lt;br /&gt;
&lt;br /&gt;
If you get errors like &amp;quot;database connection failed&amp;quot; or &amp;quot;could not connect to the database you specified&amp;quot;, here are some possible reasons and some possible solutions.&lt;br /&gt;
&lt;br /&gt;
* Your &#039;&#039;&#039;database server&#039;&#039;&#039; isn&#039;t installed or running. To check this for MySQL try typing the following command line&lt;br /&gt;
 $telnet database_host_name 3306&lt;br /&gt;
:You should get a cryptic response which includes the version number of the MySQL server. &lt;br /&gt;
* If you are attempting to run &#039;&#039;&#039;two instances of Moodle on different ports&#039;&#039;&#039;, use the ip address of the host (not localhost) in the $CFG-&amp;gt;dbhost setting, e.g. $CFG-&amp;gt;dbhost = 127.0.0.1:3308.&lt;br /&gt;
* You don&#039;t have the &#039;&#039;&#039;PHP mysql or postgresql extensions&#039;&#039;&#039; installed (please refer to FAQ re. whether PHP is installed).&lt;br /&gt;
* You haven&#039;t created a &#039;&#039;&#039;Moodle database and assigned a user&#039;&#039;&#039; with the correct privileges to access it. &lt;br /&gt;
* The &#039;&#039;&#039;Moodle database settings&#039;&#039;&#039; are incorrect. The database name, database user or database user password in your Moodle configuration file &#039;&#039;config.php&#039;&#039; are incorrect. Use phpMyAdmin to set up and check your MySQL installation.&lt;br /&gt;
* Check that there are &#039;&#039;&#039;no apostrophes or non-alphabetic letters&#039;&#039;&#039; in your MySQL username or password.&lt;br /&gt;
* You are using MySQL version 4.1 or higher but the PHP MySQL extension is pre-4.1 (check in your phpinfo output). In this case the &#039;&#039;&#039;default password hashing algorithm&#039;&#039;&#039; is incompatible with that available in the PHP mysql extension versions 4.x.x. Use these MySQL commands to change the passwords to the old format:&lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt;SET PASSWORD FOR &#039;root&#039;@&#039;localhost&#039; = OLD_PASSWORD(&#039;password&#039;);&lt;br /&gt;
 mysql&amp;gt;SET PASSWORD FOR &#039;moodleuser&#039;@&#039;localhost&#039; = OLD_PASSWORD(&#039;password&#039;);&lt;br /&gt;
&lt;br /&gt;
:Also, consider upgrading your PHP MySQL extension. See [http://dev.mysql.com/doc/mysql/en/old-client.html this MySQL document] for further information on how to deal with this problem.&lt;br /&gt;
* You are using Fedora core 3 or some other Linux system with &#039;&#039;&#039;SELinux installed&#039;&#039;&#039; and enabled. See the following URL for information on how to disable SELinux: http://fedora.redhat.com/projects/selinux/ If you don&#039;t want to disable SELinux, you have to allow httpd process to create network connections:&lt;br /&gt;
&lt;br /&gt;
 setsebool httpd_can_network_connect true&lt;br /&gt;
 &lt;br /&gt;
* Mac OSX users -- if you are running MySQL on a Mac OSX, try changing &#039;&#039;&#039;$CFG-&amp;gt;dbhost&#039;&#039;&#039; from &#039;localhost&#039; to &#039;127.0.0.1&#039;&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;: MySQL page on [http://dev.mysql.com/doc/refman/5.0/en/common-errors.html common errors] which lists several possible scenarios for connection failure, with advice on how to fix the problems.&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t log in with message &amp;quot;Please verify that the current setting of session.save_path is correct&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
This error occurs when PHP is having problems saving its session files. You may also see these other error messages displayed on the screen or in your log files:&lt;br /&gt;
&lt;br /&gt;
 Warning: Unknown: open(some-path/sessions/sess_acbf942a7399db3489ffa910e35d5242, O_RDWR)&lt;br /&gt;
 failed: Permission denied (13) in Unknown on line 0&lt;br /&gt;
&lt;br /&gt;
 Warning: Unknown(): open(some-path/sessions/sess_acbf942a7399db3489ffa910e35d5242, O_RDWR) &lt;br /&gt;
 failed: No space left on device (28) in Unknown on line 0&lt;br /&gt;
&lt;br /&gt;
 Warning: Unknown: Failed to write session data (files). Please verify that the current &lt;br /&gt;
 setting of session.save_path is correct (some-path/sessions) in Unknown on line 0 &lt;br /&gt;
&lt;br /&gt;
To temporarily bypass these errors, &#039;&#039;&#039;use database sessions&#039;&#039;&#039; by editing your [[Configuration_file | moodle configuration file]] and adding this line:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dbsessions = true;&lt;br /&gt;
&lt;br /&gt;
Database sessions may overload your mysql database and are not ideal in a shared hosting environment, so if this solves the problem, you can start fixing the problem as follows:&lt;br /&gt;
* Check &#039;&#039;&#039;access rights&#039;&#039;&#039;. The session.save_path should be accessible by the apache user. Try this command:&lt;br /&gt;
&lt;br /&gt;
 chown -R apache:apache some-path/sessions&lt;br /&gt;
&lt;br /&gt;
:This assumes that &#039;apache&#039; is the name of the user your webserver runs under - it could also be &#039;nobody&#039;.&lt;br /&gt;
* Check the &#039;&#039;&#039;permissions&#039;&#039;&#039; to the directory that PHP is trying to save to (session.save_path = some-path/sessions). Set the permissions initially to 0777 (everyone read, write, execute) with this command:&lt;br /&gt;
&lt;br /&gt;
 chmod -R 0777 some-path/sessions&lt;br /&gt;
&lt;br /&gt;
:If this fixes the problem, reduce the permissions (700 is recommended).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;: Session problems can be specific to your server environment. As an example, see [http://moodle.org/mod/forum/discuss.php?d=55925#254596 this forum discussion] about session problems with Lycos hosting.&lt;br /&gt;
&lt;br /&gt;
==Error: A server error that affects your login session was detected==&lt;br /&gt;
If restarting your browser and logging in again to your Moodle site does not work, see the Using Moodle [http://moodle.org/mod/forum/discuss.php?d=73716 forum discussion about this error message].&lt;br /&gt;
&lt;br /&gt;
If this was received at a Moodle.org site, the site could be in the process of updating.  Please try the suggestion and/or wait and try it again. Or report it in [[Tracker]].&lt;br /&gt;
&lt;br /&gt;
==Error: Failed opening required &#039;/web/moodle/lib/setup.php&#039;==&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;config.php&#039;&#039;, the setting that you use for the dirroot variable must be the complete path from the root of your server&#039;s hard drive.&lt;br /&gt;
&lt;br /&gt;
Sometimes people only use the path from their home directory, or relative to the root of the web server directory.&lt;br /&gt;
&lt;br /&gt;
==My pages show fatal errors such as : Parse error, call to undefined function: get_string()==&lt;br /&gt;
&lt;br /&gt;
If you see errors like:&lt;br /&gt;
&lt;br /&gt;
 Parse error: parse error, unexpected T_VARIABLE in /path/to/moodle/config.php on line 94 &lt;br /&gt;
 Fatal error: Call to undefined function: get_string() in /path/to/moodle/mod/resource/lib.php&lt;br /&gt;
 on line 11&lt;br /&gt;
&lt;br /&gt;
then you have probably left out a semi-colon or closing quote from a line in &#039;&#039;config.php&#039;&#039; (previous to line 94).&lt;br /&gt;
&lt;br /&gt;
Another possibility is that you edited &#039;&#039;config.php&#039;&#039; in a program like Word and saved it as a HTML web page, instead of using a plain text editor like Notepad.&lt;br /&gt;
&lt;br /&gt;
Another thing to check, particularly if you are using 3rd party modules or plugins, is whether any of the php scripts use short open tags (&amp;lt;? ?&amp;gt;) instead of proper ones (&amp;lt;?php ?&amp;gt;). Short tags are bad for various reasons, so first contact the author of that extension to tell them about the problem. Then either replace short tags with conventional ones, or set this line in php.ini:&lt;br /&gt;
&lt;br /&gt;
 short_open_tag = On&lt;br /&gt;
&lt;br /&gt;
You should never find short tags in core moodle code. If you do, please file a bug in the bug tracker.&lt;br /&gt;
&lt;br /&gt;
==Serious Error! Could not set up the site!==&lt;br /&gt;
&lt;br /&gt;
Please refer to the Using Moodle forum discussion [http://moodle.org/mod/forum/discuss.php?d=32071 Serious Error! Could not set up the site!].&lt;br /&gt;
&lt;br /&gt;
==When I go to the admin page, I get told to make dirroot blank!==&lt;br /&gt;
&lt;br /&gt;
If you see errors like this:&lt;br /&gt;
&lt;br /&gt;
 Please fix your settings in config.php: &lt;br /&gt;
 You have: $CFG-&amp;gt;dirroot = &amp;quot;/home/users/fred/public_html/moodle&amp;quot;; &lt;br /&gt;
 but it should be: $CFG-&amp;gt;dirroot = &amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
then you have encountered a small bug that occurs on some servers. The problem is with the error-checking mechanism, not with your actual path. To fix it, find this line (line 66) in the file &#039;&#039;admin/index.php&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 if ($dirroot != $CFG-&amp;gt;dirroot) {&lt;br /&gt;
&lt;br /&gt;
and change it to this:&lt;br /&gt;
&lt;br /&gt;
 if (!empty($dirroot) and $dirroot != $CFG-&amp;gt;dirroot) {&lt;br /&gt;
&lt;br /&gt;
==When trying to add a resource I receive error messages==&lt;br /&gt;
&lt;br /&gt;
Assuming you are using Apache, then it&#039;s quite likely that your setting in &#039;&#039;config.php&#039;&#039; for &amp;lt;code&amp;gt;$CFG-&amp;gt;wwwroot&amp;lt;/code&amp;gt; is different from the actual URL you are using to access the site. Also try turning off the &#039;&#039;secureforms&#039;&#039; variable in the security section of Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]].&lt;br /&gt;
&lt;br /&gt;
==Why do I keep getting error messages about &amp;quot;headers already sent&amp;quot;?==&lt;br /&gt;
&lt;br /&gt;
If you see errors like this:&lt;br /&gt;
&lt;br /&gt;
 Warning: Cannot add header information - headers already sent by &lt;br /&gt;
 (output started at /webs/moodle/config.php:87) in /webs/moodle/lib/moodlelib.php &lt;br /&gt;
 on line 1322 &lt;br /&gt;
&lt;br /&gt;
 Warning: Cannot add header information - headers already sent by &lt;br /&gt;
 (output started at /webs/moodle/config.php:87) in /webs/moodle/lib/moodlelib.php &lt;br /&gt;
 on line 1323 &lt;br /&gt;
&lt;br /&gt;
 Warning: Cannot add header information - headers already sent by &lt;br /&gt;
 (output started at /webs/moodle/config.php:87) in /webs/moodle/login/index.php &lt;br /&gt;
 on line 54&lt;br /&gt;
&lt;br /&gt;
you have blank lines or spaces after the final &amp;lt;code&amp;gt;?&amp;gt;&amp;lt;/code&amp;gt; in your &#039;&#039;config.php&#039;&#039; file. Sometimes text editors add these - for example Notepad on Windows - so you may have to try a different text editor to remove these spaces or blank lines completely.&lt;br /&gt;
&lt;br /&gt;
==Error: &amp;quot;500:Internal Server Error&amp;quot;==&lt;br /&gt;
There are several possible causes for this error. It is a good idea to start by checking your web server error log which should have a more comprehensive explanation. However, here are some known possibilities....&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Syntax error&#039;&#039;&#039;: There is a syntax error in your .htaccess or httpd.conf files. The way in which directives are written [http://httpd.apache.org/docs/1.3/howto/htaccess.html#when differs] depending on which file you are using. You can test for configuration errors in your Apache files using the command:&lt;br /&gt;
 #apachectl configtest&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;PHPsuexec&#039;&#039;&#039;: Your server does not support .htaccess files, especially if it is running PHPsuexec, which is an Apache module used for increasing the security of a site on a hosted system. In this situation:&lt;br /&gt;
&lt;br /&gt;
- you may also see a 403: Forbidden error.&lt;br /&gt;
&lt;br /&gt;
- the webserver executes under your own username and all files have a maximum permissions level of 755. Check that this is set for your Moodle directory in your control panel or (if you have access to the shell) use this command:&lt;br /&gt;
 #chmod -R 755 moodle&lt;br /&gt;
&lt;br /&gt;
- use a PHP.INI file instead of a .htaccess in the directory where the Moodle PHP script is being executed. For example: if you are receiving a memory exhausted error when your server is executing the file moodle/admin/cron.php, use a PHP.INI file to change your memory_limit and copy it to the moodle/admin directory. Remember that for PHP4, PHP.INI files are per-directory, so you&#039;ll need to copy it to each sub-directory. If you are using PHP5 or higher on a shared host, check with your host on whether they support custom PHP.INI files, and how to create them. The syntax used in a PHP.INI file is different from a .htaccess file and you need to take out php_value/php_flag at the beginning of the line and use an equals sign to assign a value, e.g.&lt;br /&gt;
 php_value memory_limit 128M &amp;lt;-- .htaccess&lt;br /&gt;
 memory_limit = 128M         &amp;lt;-- php.ini equivalent &lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Incompatible directive&#039;&#039;&#039;: You may have a directive in your .htaccess or httpd.conf files which are not compatible with your web server version. Check your webserver documentation.&lt;br /&gt;
&lt;br /&gt;
==Error &amp;quot;403: Forbidden&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
Check your webserver configuration. See also the section above &amp;quot;500:Internal Server Error&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Fatal error allowed memory size exhausted. How do I increase my php memory limit?==&lt;br /&gt;
You will sometimes see an error message something like this:&lt;br /&gt;
 Fatal error: Allowed memory size of 67108864 bytes exhausted &lt;br /&gt;
 (tried to allocate xx bytes) in /var/www/moodle/yyyy.php&lt;br /&gt;
This error means that the php memory_limit value is not enough for the php script. The memory_limit value is the &amp;quot;allowed memory size&amp;quot; - 64M in the example above (67108864 bytes / 1024 = 65536 KB. 65536 KB / 1024 = 64 MB). You will need to increase the php memory_limit value until this message is not shown anymore. There are two methods of doing this.&lt;br /&gt;
*On a hosted installation you should ask your host&#039;s support how to do this. However, many allow .htaccess files. If yours does, add the following line to your .htaccess file (or create one in the moodle directory if it does not already exist):&lt;br /&gt;
 php_value memory_limit &amp;lt;value&amp;gt;M&lt;br /&gt;
 Example: php_value memory_limit 40M&lt;br /&gt;
*If you have your own server with shell access, edit your php.ini file (make sure it&#039;s the correct one by checking in your phpinfo output) as follows:&lt;br /&gt;
 memory_limit &amp;lt;value&amp;gt;M&lt;br /&gt;
 Example: memory_limit 40M&lt;br /&gt;
* For later versions of Moodle you could be looking at figures in the region of 512M for all functions to work properly (backup and restore are particularly memory hungry). It is sensible to monitor the memory usage on your server if using these large settings.&lt;br /&gt;
Remember that you need to restart your web server to make changes to php.ini effective. An alternative is to disable the memory_limit by using the command &#039;&#039;memory_limit 0&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Error: &amp;quot;Your session has timed out. Please login again.&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
Please do one/all of the following:&lt;br /&gt;
* Try deleting cookies manually from your browser and close it down, then access your site again. Sometimes this clears up the problem.&lt;br /&gt;
* Check that your &#039;&#039;moodledata/sessions&#039;&#039; directory has write permissions. When you access Moodle a new file should be created there.&lt;br /&gt;
* If you are running two versions of Moodle on the same computer, set a cookie prefix in &#039;&#039;Administration &amp;gt; Server &amp;gt; [[Session handling]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The discussion [http://moodle.org/mod/forum/discuss.php?d=46580 Your session has timed out. Please login again] has further suggested solutions.&lt;br /&gt;
&lt;br /&gt;
==How can I fix just one bug, without upgrading my whole site?==&lt;br /&gt;
&lt;br /&gt;
Suppose:&lt;br /&gt;
* You are running an older Moodle version.&lt;br /&gt;
* You are experiencing a particular bug.&lt;br /&gt;
* You have searched in the [http://tracker.moodle.org/ tracker], and found that your problem is MDL-abc, and that it has been fixed in the latest version.&lt;br /&gt;
* For some reason, you cannot upgrade your whole site, even though the latest version probably has security fixes.&lt;br /&gt;
&lt;br /&gt;
Then, how can you get the fix for just this one bug, without upgrading your whole site? Well, if you are prepared to manually patch the code, you can probably get this information from the tracker. Please see [[How to fix just one bug without upgrading|this guide]].&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Error]] for a list of Moodle error pages. &lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Error]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Debugging&amp;diff=108588</id>
		<title>Debugging</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Debugging&amp;diff=108588"/>
		<updated>2013-12-31T10:34:36Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* In config.php */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Developer tools}}&lt;br /&gt;
Debugging messages can be enabled by an administrator in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Development &amp;gt; Debugging&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Debugging messages are intended to help diagnose problems and/or help Moodle developers. If you have a problem with your Moodle site and ask for help in a Moodle.org forum, a developer may ask you to turn debug messages on, in order to locate the cause of the problem. By default Moodle does not show any error messages at all. If you are having problems (e.g. blank screens or incomplete screens) turning on debugging is usually the first thing to try. &lt;br /&gt;
&lt;br /&gt;
==Debugging settings==&lt;br /&gt;
Here are the settings on the Debugging page:&lt;br /&gt;
&lt;br /&gt;
===Debug messages===&lt;br /&gt;
The default is none, your choices are:&lt;br /&gt;
&lt;br /&gt;
;NONE : Do not show any errors or warnings (Default) &lt;br /&gt;
;ALL : Show all reasonable PHP debug messages&lt;br /&gt;
;MINIMAL : Show only fatal errors&lt;br /&gt;
;NORMAL : Show warnings, errors and notices&lt;br /&gt;
;DEVELOPER : extra Moodle debug messages for developers&lt;br /&gt;
&lt;br /&gt;
There is rarely any advantage in going to Developer level, unless you are a developer, in which case it is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Once you have got the error message, and copied and pasted it somewhere.  HIGHLY RECOMMENDED to turn Debug back to NONE. Debug messages can give clues to a hacker as to the setup of your site.&lt;br /&gt;
&lt;br /&gt;
===Display debug messages===&lt;br /&gt;
&lt;br /&gt;
There is an option to choose whether to display error messages or simply record them in the server logs.&lt;br /&gt;
&lt;br /&gt;
===Debug email sending===&lt;br /&gt;
&lt;br /&gt;
Determines whether or not to enable verbose debug information during sending of email messages to SMTP server.&lt;br /&gt;
&lt;br /&gt;
===Performance info===&lt;br /&gt;
&lt;br /&gt;
The Performance info option determines whether performance info will be included in the footer of the standard theme (and some other themes). Performance info includes the time for the page to load, the amount of memory used to generate the page, cpu usage, load, and the record cache hit/miss ration.&lt;br /&gt;
&lt;br /&gt;
If you add&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
define(&#039;MDL_PERF&#039;, true);&lt;br /&gt;
define(&#039;MDL_PERFDB&#039;, true);&lt;br /&gt;
define(&#039;MDL_PERFTOLOG&#039;, true);&lt;br /&gt;
define(&#039;MDL_PERFTOFOOT&#039;, true);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to your config.php file, then it will also count database queries. (This has to be in config.php, because Moodle starts doing DB queries before it loads the config information in the database!&lt;br /&gt;
&lt;br /&gt;
===Show origin of language strings===&lt;br /&gt;
Helps translators.&lt;br /&gt;
&lt;br /&gt;
===Show validator links===&lt;br /&gt;
Be careful, read the warning.&lt;br /&gt;
&lt;br /&gt;
===Show page information===&lt;br /&gt;
To show page information printed in the page footer.&lt;br /&gt;
&lt;br /&gt;
==What to do if you cannot get to the admin screens==&lt;br /&gt;
&lt;br /&gt;
If the error is stopping you even getting to the admin screens to turn on debugging, then you can set the debugging setting manually.&lt;br /&gt;
&lt;br /&gt;
===Try typing the URL directly===&lt;br /&gt;
&lt;br /&gt;
The debug settings are at the URL &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://.../admin/settings.php?section=debugging&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; on your server. Sometimes that URL will work, even though the pages you need to go to to get there (for example the site front page) do not. So it is worth trying to enter that URL directly.&lt;br /&gt;
&lt;br /&gt;
===In config.php===&lt;br /&gt;
&lt;br /&gt;
In [[Configuration file|config.php]] you can add the lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
@error_reporting(E_ALL | E_STRICT);&lt;br /&gt;
@ini_set(&#039;display_errors&#039;, &#039;1&#039;);&lt;br /&gt;
$CFG-&amp;gt;debug = (E_ALL | E_STRICT); &lt;br /&gt;
$CFG-&amp;gt;debugdisplay = 1;&lt;br /&gt;
&lt;br /&gt;
// You can specify a comma separated list of user ids that that always see&lt;br /&gt;
// debug messages, this overrides the debug flag in $CFG-&amp;gt;debug and $CFG-&amp;gt;debugdisplay&lt;br /&gt;
// for these users only.&lt;br /&gt;
$CFG-&amp;gt;debugusers = &#039;2&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; Add these lines immediately before the line...&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
require_once(dirname(__FILE__) . &#039;/lib/setup.php&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember to remove those lines again when you have finished diagnosing your problem.&lt;br /&gt;
&lt;br /&gt;
NOTE: do not try to modify the config database table directly, it will not work because the values are cached in MUC.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* Developers can also use [http://xdebug.org/ XDEBUG] (Installed as a module on the Apache server) to further dig into the code, step by step using an [http://xdebug.org/docs/remote XDEBUG client application]. Probably, as part of their favorite IDE. For example: [http://php.netbeans.org/ NetBeans], [http://www.jetbrains.com/phpstorm/ phpStorm] or...&lt;br /&gt;
&lt;br /&gt;
[[es:Depuración]]&lt;br /&gt;
[[fr:Débogage]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installation_on_Ubuntu_using_Git&amp;diff=108360</id>
		<title>Installation on Ubuntu using Git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installation_on_Ubuntu_using_Git&amp;diff=108360"/>
		<updated>2013-12-13T13:31:06Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Install Moodle code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
This page gives the basic steps to install Moodle on Ubuntu using Moodle code from Git. This is generally a better idea than using the Ubuntu &#039;.deb&#039; package.&lt;br /&gt;
&lt;br /&gt;
There was no intention to provide a fully secured production server. This just gets basic Moodle working on &#039;localhost&#039;.&lt;br /&gt;
&lt;br /&gt;
This should work on either Ubuntu Desktop or Server edition.&lt;br /&gt;
&lt;br /&gt;
==Install Ubuntu==&lt;br /&gt;
&lt;br /&gt;
* Install [http://ubuntu.org/ Ubuntu Desktop] or [http://www.ubuntu.com/download/server/download Ubuntu Server] using (if in doubt) default settings&lt;br /&gt;
&lt;br /&gt;
==Basic Setup==&lt;br /&gt;
&lt;br /&gt;
* Open a terminal window (from Applications&amp;gt;Accessories) on Desktop or log into the terminal on Server.&lt;br /&gt;
* become root (and stay there right through this), install some additional software (git and php extras Moodle needs):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su  (you will need to enter your password)&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install git git-core git-doc&lt;br /&gt;
apt-get install php5-gd php5-curl php5-intl php5-xmlrpc&lt;br /&gt;
apt-get install php5 mysql-server mysql-client apache2  php5-mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* (on Desktop) open a web browser and go to http://localhost/ and make sure you see &#039;It works!&#039;. &lt;br /&gt;
* (on Server) open a web browser on a remote machine and go to http://name.or.ip.of.server/ and make sure you see &#039;It works!&#039;.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle code==&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to use Git to pull the latest code. You could just download it, but this is more fun! The checkout switches to the latest (weekly) of the 2.6 branch. The chmod (temporarily) allows the installation script to write the config file.  Still as superuser (&#039;sudo su&#039; from before):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /var/www&lt;br /&gt;
git clone https://github.com/moodle/moodle.git&lt;br /&gt;
cd moodle&lt;br /&gt;
git checkout -t origin/MOODLE_26_STABLE&lt;br /&gt;
chmod 0777 /var/www/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The moodle code location (for installation) is /var/www/moodle&lt;br /&gt;
&lt;br /&gt;
==Create the data area==&lt;br /&gt;
&lt;br /&gt;
You can create this where you like (more or less) but I will do (assuming you are still superuser)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /var/moodledata&lt;br /&gt;
chmod 0777 /var/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The moodle data location (for installation) is /var/moodledata&lt;br /&gt;
&lt;br /&gt;
==Create the database==&lt;br /&gt;
&lt;br /&gt;
You will need the root database password. Unless you have changed it, this is same as your login password (or whatever you set up when you installed MySQL above). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql -u root -p&lt;br /&gt;
(asks for password here)&lt;br /&gt;
mysql&amp;gt; create database moodle default character set utf8;&lt;br /&gt;
mysql&amp;gt; grant all on moodle.* to moodleuser@localhost identified by &#039;mypassword&#039;;&lt;br /&gt;
mysql&amp;gt; exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* don&#039;t type &#039;mysql&amp;gt;&#039;, that&#039;s just the prompt from the mysql client.&lt;br /&gt;
* The &#039;&#039;grant&#039;&#039; command creates the MySQL account &#039;moodleuser&#039; with the supplied password and gives it rights to the moodle database all in one command. &lt;br /&gt;
* Set &#039;mypassword&#039; to something you make up. This is the password for your moodle database&lt;br /&gt;
* When you install moodle the database is called &#039;moodle&#039;, the database user &#039;moodleuser&#039; and the password as above&lt;br /&gt;
&lt;br /&gt;
==Configure apache==&lt;br /&gt;
&lt;br /&gt;
The standard configuration of Apache on Ubuntu should work fine and will give you a Moodle URL of http://name.or.ip.of.server/moodle (or http://localhost/moodle). &lt;br /&gt;
&lt;br /&gt;
If you need other configurations or a different form of URL, now is the time to configure this. However, this is not covered here. There is lots of information online, although do note that the Ubuntu Apache configuration is rather different to the standard layout.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle==&lt;br /&gt;
&lt;br /&gt;
Open Firefox and go to address http://localhost/moodle&lt;br /&gt;
You should be able to install Moodle using the information indicated above&lt;br /&gt;
&lt;br /&gt;
==and finally==&lt;br /&gt;
&lt;br /&gt;
Don&#039;t skip this step. This secures the Moodle code, preventing it being overwritten by hackers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chmod 0755 /var/www/moodle&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Don&#039;t forget==&lt;br /&gt;
&lt;br /&gt;
* Set up [[Cron]]&lt;br /&gt;
* Check the [[Email settings]]&lt;br /&gt;
&lt;br /&gt;
==a quick note on updating==&lt;br /&gt;
&lt;br /&gt;
Because we installed using Git, updating Moodle (on the same stable branch) becomes surprisingly simple. Using the repository we did gives you the latest weekly at any time. If it matters, do a backup first then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su&lt;br /&gt;
chmod /var/www/moodle&lt;br /&gt;
git pull&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then go to the Site administration &amp;gt; Notifications page in Moodle to complete the upgrade.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
* If something goes wrong in the actual Moodle installation - switch on [[Debugging]]. You can create Moodle&#039;s config.php file by copying config-dist.php to config.php and editing it. It is very well documented by comments. Well down in the file you will find the options to turn on debugging. See [[Configuration file]]. If you create the file by hand, the installation will pick up from the correct place automatically. &lt;br /&gt;
* Most errors will turn up in the web server logs. Always check there first - /var/log/apache2/errors.log&lt;br /&gt;
* If you need to change things like file upload sizes you need to edit /etc/php5/apache2/php.ini and then restart the web server with &#039;sudo /etc/init.d/apache2 restart&#039;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [https://help.ubuntu.com/community/Installation Installing Ubuntu]&lt;br /&gt;
* [https://help.ubuntu.com/community/ApacheMySQLPHP Ubuntu LAMP/Apache documentation]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installation_on_Ubuntu_using_Git&amp;diff=108355</id>
		<title>Installation on Ubuntu using Git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installation_on_Ubuntu_using_Git&amp;diff=108355"/>
		<updated>2013-12-13T11:26:24Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Create the data area */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
This page gives the basic steps to install Moodle on Ubuntu using Moodle code from Git. This is generally a better idea than using the Ubuntu &#039;.deb&#039; package.&lt;br /&gt;
&lt;br /&gt;
There was no intention to provide a fully secured production server. This just gets basic Moodle working on &#039;localhost&#039;.&lt;br /&gt;
&lt;br /&gt;
This should work on either Ubuntu Desktop or Server edition.&lt;br /&gt;
&lt;br /&gt;
==Install Ubuntu==&lt;br /&gt;
&lt;br /&gt;
* Install [http://ubuntu.org/ Ubuntu Desktop] or [http://www.ubuntu.com/download/server/download Ubuntu Server] using (if in doubt) default settings&lt;br /&gt;
&lt;br /&gt;
==Basic Setup==&lt;br /&gt;
&lt;br /&gt;
* Open a terminal window (from Applications&amp;gt;Accessories) on Desktop or log into the terminal on Server.&lt;br /&gt;
* become root (and stay there right through this), install some additional software (git and php extras Moodle needs):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su  (you will need to enter your password)&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install git git-core git-doc&lt;br /&gt;
apt-get install php5-gd php5-curl php5-intl php5-xmlrpc&lt;br /&gt;
apt-get install php5 mysql-server mysql-client apache2  php5-mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* (on Desktop) open a web browser and go to http://localhost/ and make sure you see &#039;It works!&#039;. &lt;br /&gt;
* (on Server) open a web browser on a remote machine and go to http://name.or.ip.of.server/ and make sure you see &#039;It works!&#039;.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle code==&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to use Git to pull the latest code. You could just download it, but this is more fun! The checkout switches to the latest (weekly) of the 2.6 branch. The chmod (temporarily) allows the installation script to write the config file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su&lt;br /&gt;
cd /var/www&lt;br /&gt;
git clone https://github.com/moodle/moodle.git&lt;br /&gt;
cd moodle&lt;br /&gt;
git checkout -t origin/MOODLE_26_STABLE&lt;br /&gt;
chmod 0777 /var/www/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The moodle code location (for installation) is /var/www/moodle&lt;br /&gt;
&lt;br /&gt;
==Create the data area==&lt;br /&gt;
&lt;br /&gt;
You can create this where you like (more or less) but I will do (assuming you are still superuser)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /var/moodledata&lt;br /&gt;
chmod 0777 /var/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The moodle data location (for installation) is /var/moodledata&lt;br /&gt;
&lt;br /&gt;
==Create the database==&lt;br /&gt;
&lt;br /&gt;
You will need the root database password. Unless you have changed it, this is same as your login password (or whatever you set up when you installed MySQL above). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql -u root -p&lt;br /&gt;
(asks for password here)&lt;br /&gt;
mysql&amp;gt; create database moodle default character set utf8;&lt;br /&gt;
mysql&amp;gt; grant all on moodle.* to moodleuser@localhost identified by &#039;mypassword&#039;;&lt;br /&gt;
mysql&amp;gt; exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* don&#039;t type &#039;mysql&amp;gt;&#039;, that&#039;s just the prompt from the mysql client.&lt;br /&gt;
* The &#039;&#039;grant&#039;&#039; command creates the MySQL account &#039;moodleuser&#039; with the supplied password and gives it rights to the moodle database all in one command. &lt;br /&gt;
* Set &#039;mypassword&#039; to something you make up. This is the password for your moodle database&lt;br /&gt;
* When you install moodle the database is called &#039;moodle&#039;, the database user &#039;moodleuser&#039; and the password as above&lt;br /&gt;
&lt;br /&gt;
==Configure apache==&lt;br /&gt;
&lt;br /&gt;
The standard configuration of Apache on Ubuntu should work fine and will give you a Moodle URL of http://name.or.ip.of.server/moodle (or http://localhost/moodle). &lt;br /&gt;
&lt;br /&gt;
If you need other configurations or a different form of URL, now is the time to configure this. However, this is not covered here. There is lots of information online, although do note that the Ubuntu Apache configuration is rather different to the standard layout.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle==&lt;br /&gt;
&lt;br /&gt;
Open Firefox and go to address http://localhost/moodle&lt;br /&gt;
You should be able to install Moodle using the information indicated above&lt;br /&gt;
&lt;br /&gt;
==and finally==&lt;br /&gt;
&lt;br /&gt;
Don&#039;t skip this step. This secures the Moodle code, preventing it being overwritten by hackers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chmod 0755 /var/www/moodle&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Don&#039;t forget==&lt;br /&gt;
&lt;br /&gt;
* Set up [[Cron]]&lt;br /&gt;
* Check the [[Email settings]]&lt;br /&gt;
&lt;br /&gt;
==a quick note on updating==&lt;br /&gt;
&lt;br /&gt;
Because we installed using Git, updating Moodle (on the same stable branch) becomes surprisingly simple. Using the repository we did gives you the latest weekly at any time. If it matters, do a backup first then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su&lt;br /&gt;
chmod /var/www/moodle&lt;br /&gt;
git pull&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then go to the Site administration &amp;gt; Notifications page in Moodle to complete the upgrade.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
* If something goes wrong in the actual Moodle installation - switch on [[Debugging]]. You can create Moodle&#039;s config.php file by copying config-dist.php to config.php and editing it. It is very well documented by comments. Well down in the file you will find the options to turn on debugging. See [[Configuration file]]. If you create the file by hand, the installation will pick up from the correct place automatically. &lt;br /&gt;
* Most errors will turn up in the web server logs. Always check there first - /var/log/apache2/errors.log&lt;br /&gt;
* If you need to change things like file upload sizes you need to edit /etc/php5/apache2/php.ini and then restart the web server with &#039;sudo /etc/init.d/apache2 restart&#039;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [https://help.ubuntu.com/community/Installation Installing Ubuntu]&lt;br /&gt;
* [https://help.ubuntu.com/community/ApacheMySQLPHP Ubuntu LAMP/Apache documentation]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installation_on_Ubuntu_using_Git&amp;diff=108354</id>
		<title>Installation on Ubuntu using Git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installation_on_Ubuntu_using_Git&amp;diff=108354"/>
		<updated>2013-12-13T11:25:42Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Install Moodle code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
This page gives the basic steps to install Moodle on Ubuntu using Moodle code from Git. This is generally a better idea than using the Ubuntu &#039;.deb&#039; package.&lt;br /&gt;
&lt;br /&gt;
There was no intention to provide a fully secured production server. This just gets basic Moodle working on &#039;localhost&#039;.&lt;br /&gt;
&lt;br /&gt;
This should work on either Ubuntu Desktop or Server edition.&lt;br /&gt;
&lt;br /&gt;
==Install Ubuntu==&lt;br /&gt;
&lt;br /&gt;
* Install [http://ubuntu.org/ Ubuntu Desktop] or [http://www.ubuntu.com/download/server/download Ubuntu Server] using (if in doubt) default settings&lt;br /&gt;
&lt;br /&gt;
==Basic Setup==&lt;br /&gt;
&lt;br /&gt;
* Open a terminal window (from Applications&amp;gt;Accessories) on Desktop or log into the terminal on Server.&lt;br /&gt;
* become root (and stay there right through this), install some additional software (git and php extras Moodle needs):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su  (you will need to enter your password)&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install git git-core git-doc&lt;br /&gt;
apt-get install php5-gd php5-curl php5-intl php5-xmlrpc&lt;br /&gt;
apt-get install php5 mysql-server mysql-client apache2  php5-mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* (on Desktop) open a web browser and go to http://localhost/ and make sure you see &#039;It works!&#039;. &lt;br /&gt;
* (on Server) open a web browser on a remote machine and go to http://name.or.ip.of.server/ and make sure you see &#039;It works!&#039;.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle code==&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to use Git to pull the latest code. You could just download it, but this is more fun! The checkout switches to the latest (weekly) of the 2.6 branch. The chmod (temporarily) allows the installation script to write the config file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su&lt;br /&gt;
cd /var/www&lt;br /&gt;
git clone https://github.com/moodle/moodle.git&lt;br /&gt;
cd moodle&lt;br /&gt;
git checkout -t origin/MOODLE_26_STABLE&lt;br /&gt;
chmod 0777 /var/www/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The moodle code location (for installation) is /var/www/moodle&lt;br /&gt;
&lt;br /&gt;
==Create the data area==&lt;br /&gt;
&lt;br /&gt;
You can create this where you like (more or less) but I will do...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /var/moodledata&lt;br /&gt;
chmod 0777 /var/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The moodle data location (for installation) is /var/moodledata&lt;br /&gt;
&lt;br /&gt;
==Create the database==&lt;br /&gt;
&lt;br /&gt;
You will need the root database password. Unless you have changed it, this is same as your login password (or whatever you set up when you installed MySQL above). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql -u root -p&lt;br /&gt;
(asks for password here)&lt;br /&gt;
mysql&amp;gt; create database moodle default character set utf8;&lt;br /&gt;
mysql&amp;gt; grant all on moodle.* to moodleuser@localhost identified by &#039;mypassword&#039;;&lt;br /&gt;
mysql&amp;gt; exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* don&#039;t type &#039;mysql&amp;gt;&#039;, that&#039;s just the prompt from the mysql client.&lt;br /&gt;
* The &#039;&#039;grant&#039;&#039; command creates the MySQL account &#039;moodleuser&#039; with the supplied password and gives it rights to the moodle database all in one command. &lt;br /&gt;
* Set &#039;mypassword&#039; to something you make up. This is the password for your moodle database&lt;br /&gt;
* When you install moodle the database is called &#039;moodle&#039;, the database user &#039;moodleuser&#039; and the password as above&lt;br /&gt;
&lt;br /&gt;
==Configure apache==&lt;br /&gt;
&lt;br /&gt;
The standard configuration of Apache on Ubuntu should work fine and will give you a Moodle URL of http://name.or.ip.of.server/moodle (or http://localhost/moodle). &lt;br /&gt;
&lt;br /&gt;
If you need other configurations or a different form of URL, now is the time to configure this. However, this is not covered here. There is lots of information online, although do note that the Ubuntu Apache configuration is rather different to the standard layout.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle==&lt;br /&gt;
&lt;br /&gt;
Open Firefox and go to address http://localhost/moodle&lt;br /&gt;
You should be able to install Moodle using the information indicated above&lt;br /&gt;
&lt;br /&gt;
==and finally==&lt;br /&gt;
&lt;br /&gt;
Don&#039;t skip this step. This secures the Moodle code, preventing it being overwritten by hackers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chmod 0755 /var/www/moodle&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Don&#039;t forget==&lt;br /&gt;
&lt;br /&gt;
* Set up [[Cron]]&lt;br /&gt;
* Check the [[Email settings]]&lt;br /&gt;
&lt;br /&gt;
==a quick note on updating==&lt;br /&gt;
&lt;br /&gt;
Because we installed using Git, updating Moodle (on the same stable branch) becomes surprisingly simple. Using the repository we did gives you the latest weekly at any time. If it matters, do a backup first then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su&lt;br /&gt;
chmod /var/www/moodle&lt;br /&gt;
git pull&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then go to the Site administration &amp;gt; Notifications page in Moodle to complete the upgrade.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
* If something goes wrong in the actual Moodle installation - switch on [[Debugging]]. You can create Moodle&#039;s config.php file by copying config-dist.php to config.php and editing it. It is very well documented by comments. Well down in the file you will find the options to turn on debugging. See [[Configuration file]]. If you create the file by hand, the installation will pick up from the correct place automatically. &lt;br /&gt;
* Most errors will turn up in the web server logs. Always check there first - /var/log/apache2/errors.log&lt;br /&gt;
* If you need to change things like file upload sizes you need to edit /etc/php5/apache2/php.ini and then restart the web server with &#039;sudo /etc/init.d/apache2 restart&#039;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [https://help.ubuntu.com/community/Installation Installing Ubuntu]&lt;br /&gt;
* [https://help.ubuntu.com/community/ApacheMySQLPHP Ubuntu LAMP/Apache documentation]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installation_on_Ubuntu_using_Git&amp;diff=108353</id>
		<title>Installation on Ubuntu using Git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installation_on_Ubuntu_using_Git&amp;diff=108353"/>
		<updated>2013-12-13T11:20:25Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Troubleshooting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
This page gives the basic steps to install Moodle on Ubuntu using Moodle code from Git. This is generally a better idea than using the Ubuntu &#039;.deb&#039; package.&lt;br /&gt;
&lt;br /&gt;
There was no intention to provide a fully secured production server. This just gets basic Moodle working on &#039;localhost&#039;.&lt;br /&gt;
&lt;br /&gt;
This should work on either Ubuntu Desktop or Server edition.&lt;br /&gt;
&lt;br /&gt;
==Install Ubuntu==&lt;br /&gt;
&lt;br /&gt;
* Install [http://ubuntu.org/ Ubuntu Desktop] or [http://www.ubuntu.com/download/server/download Ubuntu Server] using (if in doubt) default settings&lt;br /&gt;
&lt;br /&gt;
==Basic Setup==&lt;br /&gt;
&lt;br /&gt;
* Open a terminal window (from Applications&amp;gt;Accessories) on Desktop or log into the terminal on Server.&lt;br /&gt;
* become root (and stay there right through this), install some additional software (git and php extras Moodle needs):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su  (you will need to enter your password)&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install git git-core git-doc&lt;br /&gt;
apt-get install php5-gd php5-curl php5-intl php5-xmlrpc&lt;br /&gt;
apt-get install php5 mysql-server mysql-client apache2  php5-mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* (on Desktop) open a web browser and go to http://localhost/ and make sure you see &#039;It works!&#039;. &lt;br /&gt;
* (on Server) open a web browser on a remote machine and go to http://name.or.ip.of.server/ and make sure you see &#039;It works!&#039;.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle code==&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to use Git to pull the latest code. You could just download it, but this is more fun! The checkout switches to the latest (weekly) of the 2.2 branch. The chmod (temporarily) allows the installation script to write the config file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /var/www&lt;br /&gt;
git clone git://git.moodle.org/moodle.git&lt;br /&gt;
cd moodle&lt;br /&gt;
git checkout -t origin/MOODLE_26_STABLE&lt;br /&gt;
chmod 0777 /var/www/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The moodle code location (for installation) is /var/www/moodle&lt;br /&gt;
&lt;br /&gt;
==Create the data area==&lt;br /&gt;
&lt;br /&gt;
You can create this where you like (more or less) but I will do...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /var/moodledata&lt;br /&gt;
chmod 0777 /var/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The moodle data location (for installation) is /var/moodledata&lt;br /&gt;
&lt;br /&gt;
==Create the database==&lt;br /&gt;
&lt;br /&gt;
You will need the root database password. Unless you have changed it, this is same as your login password (or whatever you set up when you installed MySQL above). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql -u root -p&lt;br /&gt;
(asks for password here)&lt;br /&gt;
mysql&amp;gt; create database moodle default character set utf8;&lt;br /&gt;
mysql&amp;gt; grant all on moodle.* to moodleuser@localhost identified by &#039;mypassword&#039;;&lt;br /&gt;
mysql&amp;gt; exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* don&#039;t type &#039;mysql&amp;gt;&#039;, that&#039;s just the prompt from the mysql client.&lt;br /&gt;
* The &#039;&#039;grant&#039;&#039; command creates the MySQL account &#039;moodleuser&#039; with the supplied password and gives it rights to the moodle database all in one command. &lt;br /&gt;
* Set &#039;mypassword&#039; to something you make up. This is the password for your moodle database&lt;br /&gt;
* When you install moodle the database is called &#039;moodle&#039;, the database user &#039;moodleuser&#039; and the password as above&lt;br /&gt;
&lt;br /&gt;
==Configure apache==&lt;br /&gt;
&lt;br /&gt;
The standard configuration of Apache on Ubuntu should work fine and will give you a Moodle URL of http://name.or.ip.of.server/moodle (or http://localhost/moodle). &lt;br /&gt;
&lt;br /&gt;
If you need other configurations or a different form of URL, now is the time to configure this. However, this is not covered here. There is lots of information online, although do note that the Ubuntu Apache configuration is rather different to the standard layout.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle==&lt;br /&gt;
&lt;br /&gt;
Open Firefox and go to address http://localhost/moodle&lt;br /&gt;
You should be able to install Moodle using the information indicated above&lt;br /&gt;
&lt;br /&gt;
==and finally==&lt;br /&gt;
&lt;br /&gt;
Don&#039;t skip this step. This secures the Moodle code, preventing it being overwritten by hackers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chmod 0755 /var/www/moodle&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Don&#039;t forget==&lt;br /&gt;
&lt;br /&gt;
* Set up [[Cron]]&lt;br /&gt;
* Check the [[Email settings]]&lt;br /&gt;
&lt;br /&gt;
==a quick note on updating==&lt;br /&gt;
&lt;br /&gt;
Because we installed using Git, updating Moodle (on the same stable branch) becomes surprisingly simple. Using the repository we did gives you the latest weekly at any time. If it matters, do a backup first then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su&lt;br /&gt;
chmod /var/www/moodle&lt;br /&gt;
git pull&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then go to the Site administration &amp;gt; Notifications page in Moodle to complete the upgrade.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
* If something goes wrong in the actual Moodle installation - switch on [[Debugging]]. You can create Moodle&#039;s config.php file by copying config-dist.php to config.php and editing it. It is very well documented by comments. Well down in the file you will find the options to turn on debugging. See [[Configuration file]]. If you create the file by hand, the installation will pick up from the correct place automatically. &lt;br /&gt;
* Most errors will turn up in the web server logs. Always check there first - /var/log/apache2/errors.log&lt;br /&gt;
* If you need to change things like file upload sizes you need to edit /etc/php5/apache2/php.ini and then restart the web server with &#039;sudo /etc/init.d/apache2 restart&#039;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [https://help.ubuntu.com/community/Installation Installing Ubuntu]&lt;br /&gt;
* [https://help.ubuntu.com/community/ApacheMySQLPHP Ubuntu LAMP/Apache documentation]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installation_on_Ubuntu_using_Git&amp;diff=108352</id>
		<title>Installation on Ubuntu using Git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installation_on_Ubuntu_using_Git&amp;diff=108352"/>
		<updated>2013-12-13T11:19:27Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* and finally */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
This page gives the basic steps to install Moodle on Ubuntu using Moodle code from Git. This is generally a better idea than using the Ubuntu &#039;.deb&#039; package.&lt;br /&gt;
&lt;br /&gt;
There was no intention to provide a fully secured production server. This just gets basic Moodle working on &#039;localhost&#039;.&lt;br /&gt;
&lt;br /&gt;
This should work on either Ubuntu Desktop or Server edition.&lt;br /&gt;
&lt;br /&gt;
==Install Ubuntu==&lt;br /&gt;
&lt;br /&gt;
* Install [http://ubuntu.org/ Ubuntu Desktop] or [http://www.ubuntu.com/download/server/download Ubuntu Server] using (if in doubt) default settings&lt;br /&gt;
&lt;br /&gt;
==Basic Setup==&lt;br /&gt;
&lt;br /&gt;
* Open a terminal window (from Applications&amp;gt;Accessories) on Desktop or log into the terminal on Server.&lt;br /&gt;
* become root (and stay there right through this), install some additional software (git and php extras Moodle needs):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su  (you will need to enter your password)&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install git git-core git-doc&lt;br /&gt;
apt-get install php5-gd php5-curl php5-intl php5-xmlrpc&lt;br /&gt;
apt-get install php5 mysql-server mysql-client apache2  php5-mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* (on Desktop) open a web browser and go to http://localhost/ and make sure you see &#039;It works!&#039;. &lt;br /&gt;
* (on Server) open a web browser on a remote machine and go to http://name.or.ip.of.server/ and make sure you see &#039;It works!&#039;.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle code==&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to use Git to pull the latest code. You could just download it, but this is more fun! The checkout switches to the latest (weekly) of the 2.2 branch. The chmod (temporarily) allows the installation script to write the config file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /var/www&lt;br /&gt;
git clone git://git.moodle.org/moodle.git&lt;br /&gt;
cd moodle&lt;br /&gt;
git checkout -t origin/MOODLE_26_STABLE&lt;br /&gt;
chmod 0777 /var/www/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The moodle code location (for installation) is /var/www/moodle&lt;br /&gt;
&lt;br /&gt;
==Create the data area==&lt;br /&gt;
&lt;br /&gt;
You can create this where you like (more or less) but I will do...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /var/moodledata&lt;br /&gt;
chmod 0777 /var/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The moodle data location (for installation) is /var/moodledata&lt;br /&gt;
&lt;br /&gt;
==Create the database==&lt;br /&gt;
&lt;br /&gt;
You will need the root database password. Unless you have changed it, this is same as your login password (or whatever you set up when you installed MySQL above). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql -u root -p&lt;br /&gt;
(asks for password here)&lt;br /&gt;
mysql&amp;gt; create database moodle default character set utf8;&lt;br /&gt;
mysql&amp;gt; grant all on moodle.* to moodleuser@localhost identified by &#039;mypassword&#039;;&lt;br /&gt;
mysql&amp;gt; exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* don&#039;t type &#039;mysql&amp;gt;&#039;, that&#039;s just the prompt from the mysql client.&lt;br /&gt;
* The &#039;&#039;grant&#039;&#039; command creates the MySQL account &#039;moodleuser&#039; with the supplied password and gives it rights to the moodle database all in one command. &lt;br /&gt;
* Set &#039;mypassword&#039; to something you make up. This is the password for your moodle database&lt;br /&gt;
* When you install moodle the database is called &#039;moodle&#039;, the database user &#039;moodleuser&#039; and the password as above&lt;br /&gt;
&lt;br /&gt;
==Configure apache==&lt;br /&gt;
&lt;br /&gt;
The standard configuration of Apache on Ubuntu should work fine and will give you a Moodle URL of http://name.or.ip.of.server/moodle (or http://localhost/moodle). &lt;br /&gt;
&lt;br /&gt;
If you need other configurations or a different form of URL, now is the time to configure this. However, this is not covered here. There is lots of information online, although do note that the Ubuntu Apache configuration is rather different to the standard layout.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle==&lt;br /&gt;
&lt;br /&gt;
Open Firefox and go to address http://localhost/moodle&lt;br /&gt;
You should be able to install Moodle using the information indicated above&lt;br /&gt;
&lt;br /&gt;
==and finally==&lt;br /&gt;
&lt;br /&gt;
Don&#039;t skip this step. This secures the Moodle code, preventing it being overwritten by hackers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chmod 0755 /var/www/moodle&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Don&#039;t forget==&lt;br /&gt;
&lt;br /&gt;
* Set up [[Cron]]&lt;br /&gt;
* Check the [[Email settings]]&lt;br /&gt;
&lt;br /&gt;
==a quick note on updating==&lt;br /&gt;
&lt;br /&gt;
Because we installed using Git, updating Moodle (on the same stable branch) becomes surprisingly simple. Using the repository we did gives you the latest weekly at any time. If it matters, do a backup first then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su&lt;br /&gt;
chmod /var/www/moodle&lt;br /&gt;
git pull&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then go to the Site administration &amp;gt; Notifications page in Moodle to complete the upgrade.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
* If something goes wrong in the actual Moodle installation - switch on [[Debugging]]. You can create Moodle&#039;s config.php file by copying config-dist.php to config.php and editing it. It is very well documented by comments. Well down in the file you will find the options to turn on debugging. See [[Configuration file]]&lt;br /&gt;
* Most errors will turn up in the web server logs. Always check there first - /var/log/apache2/errors.log&lt;br /&gt;
* If you need to change things like file upload sizes you need to edit /etc/php5/apache2/php.ini and then restart the web server with &#039;sudo /etc/init.d/apache2 restart&#039;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [https://help.ubuntu.com/community/Installation Installing Ubuntu]&lt;br /&gt;
* [https://help.ubuntu.com/community/ApacheMySQLPHP Ubuntu LAMP/Apache documentation]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installation_on_Ubuntu_using_Git&amp;diff=108350</id>
		<title>Installation on Ubuntu using Git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installation_on_Ubuntu_using_Git&amp;diff=108350"/>
		<updated>2013-12-13T11:16:41Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Troubleshooting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
This page gives the basic steps to install Moodle on Ubuntu using Moodle code from Git. This is generally a better idea than using the Ubuntu &#039;.deb&#039; package.&lt;br /&gt;
&lt;br /&gt;
There was no intention to provide a fully secured production server. This just gets basic Moodle working on &#039;localhost&#039;.&lt;br /&gt;
&lt;br /&gt;
This should work on either Ubuntu Desktop or Server edition.&lt;br /&gt;
&lt;br /&gt;
==Install Ubuntu==&lt;br /&gt;
&lt;br /&gt;
* Install [http://ubuntu.org/ Ubuntu Desktop] or [http://www.ubuntu.com/download/server/download Ubuntu Server] using (if in doubt) default settings&lt;br /&gt;
&lt;br /&gt;
==Basic Setup==&lt;br /&gt;
&lt;br /&gt;
* Open a terminal window (from Applications&amp;gt;Accessories) on Desktop or log into the terminal on Server.&lt;br /&gt;
* become root (and stay there right through this), install some additional software (git and php extras Moodle needs):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su  (you will need to enter your password)&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install git git-core git-doc&lt;br /&gt;
apt-get install php5-gd php5-curl php5-intl php5-xmlrpc&lt;br /&gt;
apt-get install php5 mysql-server mysql-client apache2  php5-mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* (on Desktop) open a web browser and go to http://localhost/ and make sure you see &#039;It works!&#039;. &lt;br /&gt;
* (on Server) open a web browser on a remote machine and go to http://name.or.ip.of.server/ and make sure you see &#039;It works!&#039;.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle code==&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to use Git to pull the latest code. You could just download it, but this is more fun! The checkout switches to the latest (weekly) of the 2.2 branch. The chmod (temporarily) allows the installation script to write the config file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /var/www&lt;br /&gt;
git clone git://git.moodle.org/moodle.git&lt;br /&gt;
cd moodle&lt;br /&gt;
git checkout -t origin/MOODLE_26_STABLE&lt;br /&gt;
chmod 0777 /var/www/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The moodle code location (for installation) is /var/www/moodle&lt;br /&gt;
&lt;br /&gt;
==Create the data area==&lt;br /&gt;
&lt;br /&gt;
You can create this where you like (more or less) but I will do...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /var/moodledata&lt;br /&gt;
chmod 0777 /var/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The moodle data location (for installation) is /var/moodledata&lt;br /&gt;
&lt;br /&gt;
==Create the database==&lt;br /&gt;
&lt;br /&gt;
You will need the root database password. Unless you have changed it, this is same as your login password (or whatever you set up when you installed MySQL above). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql -u root -p&lt;br /&gt;
(asks for password here)&lt;br /&gt;
mysql&amp;gt; create database moodle default character set utf8;&lt;br /&gt;
mysql&amp;gt; grant all on moodle.* to moodleuser@localhost identified by &#039;mypassword&#039;;&lt;br /&gt;
mysql&amp;gt; exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* don&#039;t type &#039;mysql&amp;gt;&#039;, that&#039;s just the prompt from the mysql client.&lt;br /&gt;
* The &#039;&#039;grant&#039;&#039; command creates the MySQL account &#039;moodleuser&#039; with the supplied password and gives it rights to the moodle database all in one command. &lt;br /&gt;
* Set &#039;mypassword&#039; to something you make up. This is the password for your moodle database&lt;br /&gt;
* When you install moodle the database is called &#039;moodle&#039;, the database user &#039;moodleuser&#039; and the password as above&lt;br /&gt;
&lt;br /&gt;
==Configure apache==&lt;br /&gt;
&lt;br /&gt;
The standard configuration of Apache on Ubuntu should work fine and will give you a Moodle URL of http://name.or.ip.of.server/moodle (or http://localhost/moodle). &lt;br /&gt;
&lt;br /&gt;
If you need other configurations or a different form of URL, now is the time to configure this. However, this is not covered here. There is lots of information online, although do note that the Ubuntu Apache configuration is rather different to the standard layout.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle==&lt;br /&gt;
&lt;br /&gt;
Open Firefox and go to address http://localhost/moodle&lt;br /&gt;
You should be able to install Moodle using the information indicated above&lt;br /&gt;
&lt;br /&gt;
==and finally==&lt;br /&gt;
&lt;br /&gt;
Don&#039;t skip this step. This secures the Moodle code, preventing it being overwritten by hackers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chmod 0755 /var/www/moodle&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==a quick note on updating==&lt;br /&gt;
&lt;br /&gt;
Because we installed using Git, updating Moodle (on the same stable branch) becomes surprisingly simple. Using the repository we did gives you the latest weekly at any time. If it matters, do a backup first then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su&lt;br /&gt;
chmod /var/www/moodle&lt;br /&gt;
git pull&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then go to the Site administration &amp;gt; Notifications page in Moodle to complete the upgrade.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
* If something goes wrong in the actual Moodle installation - switch on [[Debugging]]. You can create Moodle&#039;s config.php file by copying config-dist.php to config.php and editing it. It is very well documented by comments. Well down in the file you will find the options to turn on debugging. See [[Configuration file]]&lt;br /&gt;
* Most errors will turn up in the web server logs. Always check there first - /var/log/apache2/errors.log&lt;br /&gt;
* If you need to change things like file upload sizes you need to edit /etc/php5/apache2/php.ini and then restart the web server with &#039;sudo /etc/init.d/apache2 restart&#039;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [https://help.ubuntu.com/community/Installation Installing Ubuntu]&lt;br /&gt;
* [https://help.ubuntu.com/community/ApacheMySQLPHP Ubuntu LAMP/Apache documentation]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=OPcache&amp;diff=108257</id>
		<title>OPcache</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=OPcache&amp;diff=108257"/>
		<updated>2013-12-09T17:04:17Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Environment}}&lt;br /&gt;
{{New features}}&lt;br /&gt;
The standard OPcache extension is strongly recommended; since Moodle 2.6, it is the only solution officially supported by PHP developers. The benefits are increased performance and significantly lower memory usage.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
The OPcache extension is distributed as part of PHP 5.5.0 and later. It is available also for older stable PHP releases from PECL under the original name ZendOPcache.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: If you are running PHP 5.3 or 5.4 you can safely ignore the Environment Check message about OpCache&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
PHP.ini settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[opcache]&lt;br /&gt;
opcache.enable = 1&lt;br /&gt;
opcache.memory_consumption = 128&lt;br /&gt;
opcache.max_accelerated_files = 4000&lt;br /&gt;
opcache.revalidate_freq = 60&lt;br /&gt;
&lt;br /&gt;
; Required for Moodle&lt;br /&gt;
opcache.use_cwd = 1&lt;br /&gt;
opcache.validate_timestamps = 1&lt;br /&gt;
opcache.save_comments = 1&lt;br /&gt;
opcache.enable_file_override = 0&lt;br /&gt;
&lt;br /&gt;
; If something does not work in Moodle&lt;br /&gt;
;opcache.revalidate_path = 1 ; May fix problems with include paths&lt;br /&gt;
&lt;br /&gt;
; Experimental for Moodle 2.6 and later&lt;br /&gt;
;opcache.fast_shutdown = 1&lt;br /&gt;
;opcache.enable_cli = 1 ; Speeds up CLI cron&lt;br /&gt;
;opcache.load_comments = 0 ; May lower memory use, might not be compatible with add-ons and other apps.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When using IIS you will need PHP 5.5 and you will need to add the extension for opcache under the &#039;&#039;ExtensionList&#039;&#039; section of the php.ini file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[ExtensionList]&lt;br /&gt;
...&lt;br /&gt;
zend_extension=php_opcache.dll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [http://pecl.php.net/package/ZendOpcache PECL ZendOPcache]&lt;br /&gt;
* Using Moodle [https://moodle.org/mod/forum/discuss.php?d=244133 OPcache: Memory Usage = 100% (is this good or bad?)] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
&lt;br /&gt;
[[es:OPcache]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Performance_recommendations&amp;diff=108105</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Performance_recommendations&amp;diff=108105"/>
		<updated>2013-12-01T13:17:35Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* PHP performance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
Moodle can be made to perform very well, at small usage levels or scaling up to many thousands of users. The factors involved in performance are basically the same as for any PHP-based database-driven system. When trying to optimize your server, try to focus on the factor which will make the most difference to the user. For example, if you have relatively more users browsing than accessing the database, look to improve the webserver performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Obtain a baseline benchmark==&lt;br /&gt;
&lt;br /&gt;
Before attempting any optimization, you should obtain a baseline benchmark of the component of the system you are trying to improve. For Linux try [http://lbs.sourceforge.net/ LBS] and for Windows use the Performance Monitor. Once you have quantitative data about how your system is performing currently, you&#039;ll be able to determine if the change you have made has had any real impact.&lt;br /&gt;
&lt;br /&gt;
The overall aim of adjustments to improve performance is to use RAM (cacheing) and to reduce disk-based activity. It is especially important to try to eliminate swap file usage as much as you can. If your system starts swapping, this is a sign that you need more RAM. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;optimization order preference&#039;&#039;&#039; is usually: primary storage (more RAM), secondary storage (faster hard disks/improved hard disk configuration), processor (more and faster).&lt;br /&gt;
&lt;br /&gt;
==Scalability==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s design (with clear separation of application layers) allows for strongly scalable setups. (Please check the list of [[Large installations|large Moodle installations]].)&lt;br /&gt;
&lt;br /&gt;
Large sites usually separate the web server and database onto separate servers, although for smaller installations this is typically not necessary.&lt;br /&gt;
&lt;br /&gt;
It is possible to load-balance a Moodle installation, for example by using more than one webserver. The separate webservers should query the same database and refer to the same filestore and cache areas (see [[Caching]]), but otherwise the separation of the application layers is complete enough to make this kind of clustering feasible. Similarly, the database could be a cluster of servers (e.g. a MySQL cluster), but this is not an easy task and you should seek expert support, e.g. from a Moodle Partner.&lt;br /&gt;
&lt;br /&gt;
===Server cluster===&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88214 Installation for 3000 simultaneous users]&lt;br /&gt;
&lt;br /&gt;
==Hardware configuration==&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The fastest and most effective change that you can make to improve performance is to &#039;&#039;&#039;increase the amount of RAM on your web server&#039;&#039;&#039; - get as much as possible (e.g. 4GB or more). Increasing primary memory will reduce the need for processes to swap to disk and will enable your server to handle more users.&lt;br /&gt;
* Better performance is gained by obtaining the best &#039;&#039;&#039;processor capability&#039;&#039;&#039; you can, i.e. dual or dual core processors. A modern BIOS should allow you to enable hyperthreading, but check if this makes a difference to the overall performance of the processors by using a [http://en.wikipedia.org/wiki/Super_PI CPU benchmarking tool].&lt;br /&gt;
* If you can afford them, use &#039;&#039;&#039;SCSI hard disks&#039;&#039;&#039; instead of SATA drives. SATA drives will increase your system&#039;s CPU utilization, whereas SCSI drives have their own integrated processors and come into their own when you have multiple drives. If you must have SATA drives, check that your motherboard and the drives themselves support NCQ (Native Command Queuing).&lt;br /&gt;
* Purchase hard disks with a &#039;&#039;&#039;low seek time&#039;&#039;&#039;. This will improve the overall speed of your system, especially when accessing Moodle&#039;s reports.&lt;br /&gt;
* Size your &#039;&#039;&#039;swap file&#039;&#039;&#039; correctly. The general advice is to set it to 4 x physical RAM.&lt;br /&gt;
* Use a &#039;&#039;&#039;RAID disk system&#039;&#039;&#039;. Although there are many different RAID configurations you can create, the following generally works best:&lt;br /&gt;
** install a hardware RAID controller (if you can)&lt;br /&gt;
** the operating system and swap drive on one set of disks configured as RAID-1.&lt;br /&gt;
** Moodle, Web server and Database server on another set of disks configured as RAID-5.&lt;br /&gt;
* If your &#039;moodledata&#039; area is going to be on relatively slow storage (e.g. NFS, SAN) you will probably have performance issues with the default cache configuration (which writes to this storage). See the page on [[Caching]] and consider an alternative. &lt;br /&gt;
* Use &#039;&#039;&#039;gigabit ethernet&#039;&#039;&#039; for improved latency and throughput. This is especially important when you have your webserver and database server separated out on different hosts.&lt;br /&gt;
* Check the settings on your &#039;&#039;&#039;network card&#039;&#039;&#039;. You may get an improvement in performance by increasing the use of buffers and transmit/receive descriptors (balance this with processor and memory overheads) and off-loading TCP checksum calculation onto the card instead of the OS.&lt;br /&gt;
*  Read this [http://moodle.org/mod/forum/discuss.php?d=68579 Case Study] on a server stress test with 300 users.  &lt;br /&gt;
* See this [http://elearning.sgu.ac.jp/doc/PT/ accompanying report] on network traffic and server loads.&lt;br /&gt;
* See the [[Moodle.org configuration]]&lt;br /&gt;
* Also see this SFSU presentation at Educause (using VMWare): [http://www.educause.edu/Resources/AnOpenSourceLMSforaMissionCrit/162843]&lt;br /&gt;
&lt;br /&gt;
==Operating System==&lt;br /&gt;
* You can use [http://en.wikipedia.org/wiki/Linux Linux](recommended), Unix-based, Windows or Mac OS X for the server &#039;&#039;&#039;operating system&#039;&#039;&#039;. *nix operating systems generally require less memory than Mac OS X or Windows servers for doing the same task as the server is configured with just a shell interface. Additionally Linux does not have licensing fees attached, but can have a big learning curve if you&#039;re used to another operating system. If you have a large number of processors running SMP, you may also want to consider using a highly tuned OS such as [http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris].&lt;br /&gt;
* Check your own OS and &#039;&#039;&#039;vendor specific instructions&#039;&#039;&#039; for optimization steps.&lt;br /&gt;
** For Linux look at the [http://linuxperf.sourceforge.net/ Linux Performance Team] site. &lt;br /&gt;
** For Linux investigate the hdparm command, e.g. hdparm -m16 -d1 can be used to enable read/write on multiple sectors and DMA. Mount disks with the async and noatime options.&lt;br /&gt;
** For Windows set the sever to be optimized for network applications (Control Panel, Network Connections, LAN connection, Properties, File &amp;amp; Printer Sharing for Microsoft Networks, Properties, Optimization). You can also search the [http://technet.microsoft.com/ Microsoft TechNet site] for optimization documents.&lt;br /&gt;
&lt;br /&gt;
==Web server performance==&lt;br /&gt;
&lt;br /&gt;
Installing [http://www.mozilla.com/en-US/ Firefox] and the [https://addons.mozilla.org/en-US/firefox/addon/1843 firebug] extension will allow you to watch the time it takes for each page component to load. Also, the [https://addons.mozilla.org/en-US/firefox/addon/5369 Yslow] extension will evaluate your page against Yahoo&#039;s [http://www.skrenta.com/2007/05/14_rules_for_fast_web_pages_by_1.html 14 rules], full text [http://developer.yahoo.com/performance/rules.html Best Practices for Speeding Up Your Web Site], &amp;lt;strike&amp;gt;([http://video.yahoo.com/video/play?vid=1040890 video])&amp;lt;/strike&amp;gt; for fast loading websites.&lt;br /&gt;
&lt;br /&gt;
===PHP performance===&lt;br /&gt;
* You are strongly recommended to use a &#039;&#039;&#039;PHP accelerator&#039;&#039;&#039; to ease CPU load, such as [http://pecl.php.net/apc APC], [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache], [http://sourceforge.net/projects/wincache WinCache] or [http://eaccelerator.net/ eAccelerator]. (Take care to choose a PHP accelerator that is known to work well with your version of PHP and note that Turck MMCache is [http://turckmmcache.exeprod.com/TheManifestoEnglish no longer maintained] and can cause failures with PHP 5). PHP 5.5 (and newer) includes OpCache and is fully supported and recommended by Moodle 2.6&lt;br /&gt;
* Improvements in read/write performance can be improved by putting the cached PHP pages on a [[TMPFS]] filesystem - but remember that you&#039;ll lose the cache contents when there is a power failure or the server is rebooted.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS6 ISAPI module&#039;&#039;&#039; (rather than a CGI). IIS 7.0/7.5 (Windows Server 2008/R2) users should choose a FastCGI installation for best performance.&lt;br /&gt;
* Also check the &#039;&#039;&#039;memory_limit&#039;&#039;&#039; in php.ini, reduce it to 16M for Moodle version earlier than 1.7 ([http://moodle.org/mod/forum/discuss.php?d=39656 See this forum discussion]). For Moodle 1.7 or later, it is recommended that the value of memory_limit should be 40M. As of [http://www.php.net/ChangeLog-5.php PHP 5.2.1] the default value for the memory_limit directive is 128M.&lt;br /&gt;
* Also see [[PHP_settings_by_Moodle_version]]&lt;br /&gt;
&lt;br /&gt;
===Install HowTo===&lt;br /&gt;
* [http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html APC on CentOS 5.x (linux)]&lt;br /&gt;
* [http://fplanque.com/dev/linux/install-apc-php-cache-debian-lenny APC on Debian (linux)]&lt;br /&gt;
* [http://www.linuxtuts.net/211-installing-memcached-php5-memcache-module-debian-apache2.html MemCache module on Debian (Apache2 and PHP5) ]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/03/installing-memcached-on-centos-5x.html Installing Memcache on CentOS 5.x (linux)]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/02/installing-eaccelerator-cache-for-php.html Installing eAccelerator on CentOS 5.x (linux)]&lt;br /&gt;
* [https://docs.moodle.org/en/Installing_eAccelerator_In_Ubuntu_Server/ Installing eAccelerator on Ubuntu Server (linux)]&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&lt;br /&gt;
* If you are using Apache on a Windows server, use the build from [http://www.apachelounge.com Apache Lounge] which is reported to have [http://moodle.org/mod/forum/discuss.php?d=93358 performance and stability improvements] compared to the official Apache download. Note that this is an unofficial build, so may not keep up with official releases.&lt;br /&gt;
* Set the &#039;&#039;&#039;MaxClients&#039;&#039;&#039; directive correctly. Use this formula to help (which uses 80% of available memory to leave room for spare):&lt;br /&gt;
 MaxClients = Total available memory * 80% / Max memory usage of apache process&lt;br /&gt;
:Memory usage of apache process is usually 10MB but Moodle can easily use up to 100MB per process, so a general rule of thumb is to divide your available memory in megabytes by 100 to get a conservative setting for MaxClients. You are quite likely to find yourself lowering the MaxClients from its default of 150 on a Moodle server. To get a more accurate estimate read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&lt;br /&gt;
&lt;br /&gt;
:If you need to increase the value of &#039;&#039;&#039;MaxClients&#039;&#039;&#039; beyond 256, you will also need to set the &#039;&#039;&#039;ServerLimit&#039;&#039;&#039; directive. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: Do not be tempted to set the value of MaxClients higher than your available memory as your server will consume more RAM than available and start to swap to disk. &lt;br /&gt;
* Consider reducing the &#039;&#039;&#039;number of modules&#039;&#039;&#039; that Apache loads in the httpd.conf file to the minumum necessary to reduce the memory needed. &lt;br /&gt;
* Use the &#039;&#039;&#039;latest version of Apache&#039;&#039;&#039; - Apache 2 has an improved memory model which reduces memory usage further.&lt;br /&gt;
* For Unix/Linux systems, consider lowering &#039;&#039;&#039;MaxRequestsPerChild&#039;&#039;&#039; in httpd.conf to as low as 20-30 (if you set it any lower the overhead of forking begins to outweigh the benefits). &lt;br /&gt;
* For a heavily loaded server, consider setting &#039;&#039;&#039;KeepAlive Off&#039;&#039;&#039; (do this only if your Moodle pages do not contain links to resources or uploaded images) or lowering the &#039;&#039;&#039;KeepAliveTimeout&#039;&#039;&#039; to between 2 and 5. The default is 15 (seconds) - the higher the value the more server processes will be kept waiting for possibly idle connections. A more accurate value for KeepAliveTimeout is obtained by observing how long it takes your users to download a page. After altering any of the KeepAlive variables, monitor your CPU utilization as there may be an additional overhead in initiating more worker processes/threads.&lt;br /&gt;
* As an alternative to using KeepAlive Off, consider setting-up a &#039;&#039;&#039;Reverse Proxy server&#039;&#039;&#039; infront of the Moodle server to cache HTML files with images. You can then return Apache to using keep-alives on the Moodle server.&lt;br /&gt;
* If you do not use a .htaccess file, set the &#039;&#039;&#039;AllowOverride&#039;&#039;&#039; variable to AllowOverride None to prevent .htaccess lookups.&lt;br /&gt;
* Set &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; correctly so as to avoid content-negotiation. Here&#039;s an example from a production server:&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
* Unless you are doing development work on the server, set &#039;&#039;&#039;ExtendedStatus Off&#039;&#039;&#039; and disable mod_info as well as mod_status.&lt;br /&gt;
* Leave &#039;&#039;&#039;HostnameLookups Off&#039;&#039;&#039; (as default) to reduce DNS latency.&lt;br /&gt;
* Consider reducing the value of &#039;&#039;&#039;TimeOut&#039;&#039;&#039; to between 30 to 60 (seconds). &lt;br /&gt;
* For the &#039;&#039;&#039;Options directive&#039;&#039;&#039;, avoid Options Multiviews as this performs a directory scan. To reduce disk I/O further use&lt;br /&gt;
 Options -Indexes FollowSymLinks&lt;br /&gt;
&lt;br /&gt;
* Compression reduces response times by reducing the size of the HTTP response&lt;br /&gt;
# Install and enable mod_deflate - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;ifModule mod_deflate.c&amp;gt;&lt;br /&gt;
   AddOutputFilterByType DEFLATE text/html text/plain text/xml text/x-js text/javascript text/css application/javascript&lt;br /&gt;
 &amp;lt;/ifmodule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IIS performance===&lt;br /&gt;
All alter this location in the registry:&lt;br /&gt;
 HKLM\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters\&lt;br /&gt;
* The equivalent to KeepAliveTimeout is &#039;&#039;&#039;ListenBackLog&#039;&#039;&#039; (IIS - registry location is HKLM\ SYSTEM\ CurrentControlSet\ Services\ Inetinfo\ Parameters). Set this to between 2 to 5.&lt;br /&gt;
*Change the &#039;&#039;&#039;MemCacheSize&#039;&#039;&#039; value to adjust the amount of memory (Mb) that IIS will use for its file cache (50% of available memory by default).&lt;br /&gt;
*Change the &#039;&#039;&#039;MaxCachedFileSize&#039;&#039;&#039; to adjust the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).&lt;br /&gt;
*Create a new DWORD called &#039;&#039;&#039;ObjectCacheTTL&#039;&#039;&#039; to change the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).&lt;br /&gt;
&lt;br /&gt;
===Lighttpd, NginX and Cherokee performance===&lt;br /&gt;
You can increase server performance by using a &#039;&#039;&#039;light-weight&#039;&#039;&#039; webserver like [http://www.lighttpd.net/ lighttpd],  [http://nginx.net/ nginx] or [http://www.cherokee-project.com/ cherokee] in combination with PHP in FastCGI-mode. Lighttpd was originally created as a proof-of-concept[http://www.lighttpd.net/story] to address the [http://www.kegel.com/c10k.html C10k problem] and while primarily recommended for memory-limited servers, its design origins and asynchronous-IO model make it a suitable and proven[http://blog.lighttpd.net/articles/2006/12/28/lighttpd-powers-5-alexa-top-250-sites] alternative HTTP server for high-load websites and web apps, including Moodle. See the [[lighttpd | MoodleDocs Lighttpd page]] for additional information, configuration example and links.&lt;br /&gt;
&lt;br /&gt;
Alternatively, both [http://www.lighttpd.net/ lighttpd] and [http://nginx.net/ nginx] are capable of performing as a load-balancer and/or reverse-proxy to alleviate load on back-end servers[http://www.linuxjournal.com/article/10108], providing benefit without requiring an actual software change on existing servers.&lt;br /&gt;
&lt;br /&gt;
Do note that these are likely to be the least tested server environments of all particularly if you are using advanced features such as web services and/or Moodle Networking. They are probably best considered for heavily used Moodle sites with relatively simple configurations.&lt;br /&gt;
&lt;br /&gt;
===X-Sendfile===&lt;br /&gt;
&lt;br /&gt;
X-Sendfile modules improve performance when sending large files from Moodle. It is recommended to configure your web server and Moodle to use this feature of available.&lt;br /&gt;
&lt;br /&gt;
Configure web server:&lt;br /&gt;
* Apache - https://tn123.org/mod_xsendfile/&lt;br /&gt;
* Lighttpd - http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file&lt;br /&gt;
* Nginx - http://wiki.nginx.org/XSendfile&lt;br /&gt;
&lt;br /&gt;
Enable support in config.php (see config-dist.php):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Sendfile&#039;;           // Apache {@see https://tn123.org/mod_xsendfile/}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-LIGHTTPD-send-file&#039;; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;     // Nginx {@see http://wiki.nginx.org/XSendfile}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure file location prefixes if your server implementation requires it:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
//         &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot,&lt;br /&gt;
//         &#039;/cachedir/&#039; =&amp;gt; &#039;/var/www/moodle/cache&#039;,    // for custom $CFG-&amp;gt;cachedir locations&lt;br /&gt;
//         &#039;/localcachedir/&#039; =&amp;gt; &#039;/var/local/cache&#039;,    // for custom $CFG-&amp;gt;localcachedir locations&lt;br /&gt;
//         &#039;/tempdir/&#039;  =&amp;gt; &#039;/var/www/moodle/temp&#039;,     // for custom $CFG-&amp;gt;tempdir locations&lt;br /&gt;
//         &#039;/filedir&#039;   =&amp;gt; &#039;/var/www/moodle/filedir&#039;,  // for custom $CFG-&amp;gt;filedir locations&lt;br /&gt;
//     );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
===MySQL performance===&lt;br /&gt;
&lt;br /&gt;
The following are MySQL specific settings which can be adjusted for better performance in your my.cnf (my.ini in Windows). The file contains a list of settings and their values. To see the current values use these commands&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
 SHOW VARIABLES; &lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: You must make backups of your database before attempting to change any MySQL server configuration. After any change to the my.cnf, restart mysqld.&lt;br /&gt;
&lt;br /&gt;
If you are able, the [http://mysqltuner.com/ MySQLTuner] tool can be run against your MySQL server and will calculate appropriate configuration values for most of the following settings based on your current load, status and variables automatically.&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with &lt;br /&gt;
 query_cache_type = 1. &lt;br /&gt;
For most Moodle installs, set the following:&lt;br /&gt;
 query_cache_size = 36M &lt;br /&gt;
 query_cache_min_res_unit = 2K. &lt;br /&gt;
The query cache will improve performance if you are doing few updates on the database. &lt;br /&gt;
* Set the &#039;&#039;&#039;table cache&#039;&#039;&#039; correctly. For Moodle 1.6 set &lt;br /&gt;
 table_cache = 256 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min), and for Moodle 1.7 set &lt;br /&gt;
 table_cache = 512 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min). The table cache is used by all threads (connections), so monitor the value of opened_tables to further adjust - if opened_tables &amp;gt; 3 * table_cache(table_open_cache in MySQL &amp;gt; 5.1.2) then increase table_cache upto your OS limit. Note also that the figure for table_cache will also change depending on the number of modules and plugins you have installed. Find the number for your server by executing the mysql statement below. Look at the number returned and set table_cache to this value.&lt;br /&gt;
 mysql&amp;gt;SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema=&#039;yourmoodledbname&#039;;&lt;br /&gt;
* Set the &#039;&#039;&#039;thread cache&#039;&#039;&#039; correctly. Adjust the value so that your thread cache utilization is as close to 100% as possible by this formula:&lt;br /&gt;
 thread cache utilization (%) = (threads_created / connections) * 100&lt;br /&gt;
* The &#039;&#039;&#039;key buffer&#039;&#039;&#039; can improve the access speed to Moodle&#039;s SELECT queries. The correct size depends on the size of the index files (.myi) and in Moodle 1.6 or later (without any additional modules and plugins), the recommendation for this value is key_buffer_size = 32M. Ideally you want the database to be reading once from the disk for every 100 requests so monitor that the value is suitable for your install by adjusting the value of key_buffer_size so that the following formulas are true:&lt;br /&gt;
 key_read / key_read_requests &amp;lt; 0.01&lt;br /&gt;
 key_write / key_write_requests &amp;lt;= 1.0&lt;br /&gt;
* Set the &#039;&#039;&#039;maximum number of connections&#039;&#039;&#039; so that your users will not see a &amp;quot;Too many connections&amp;quot; message. Be careful that this may have an impact on the total memory used. MySQL connections usually last for milliseconds, so it is unusual even for a heavily loaded server for this value to be over 200.&lt;br /&gt;
* Manage &#039;&#039;&#039;high burst activity&#039;&#039;&#039;. If your Moodle install uses a lot of quizzes and you are experiencing performance problems (check by monitoring the value of threads_connected - it should not be rising) consider increasing the value of back_log.&lt;br /&gt;
* &#039;&#039;&#039;Optimize your tables weekly and after upgrading Moodle&#039;&#039;&#039;. It is good practice to also optimize your tables after performing a large data deletion exercise, e.g. at the end of your semester or academic year. This will ensure that index files are up to date. Backup your database first and then use:&lt;br /&gt;
 mysql&amp;gt;CHECK TABLE mdl_tablename;&lt;br /&gt;
 mysql&amp;gt;OPTIMIZE TABLE mdl_tablename;&lt;br /&gt;
:The common tables in Moodle to check are mdl_course_sections, mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any errors need to be corrected using REPAIR TABLE (see the [http://dev.mysql.com/doc/refman/5.0/en/repair-table.html MySQL manual] and this [http://moodle.org/mod/forum/discuss.php?d=58208#p279638 forum script]).&lt;br /&gt;
* &#039;&#039;&#039;Maintain the key distribution&#039;&#039;&#039;. Every month or so it is a good idea to stop the mysql server and run these myisamchk commands.&lt;br /&gt;
 #myisamchk -a -S /pathtomysql/data/moodledir/*.MYI&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.&lt;br /&gt;
* Reduce the number of &#039;&#039;&#039;temporary tables saved to disk&#039;&#039;&#039;. Check this with the created_tmp_disk_tables value. If this is relatively large (&amp;gt;5%) increase tmp_table_size until you see a reduction. Note that this will have an impact on RAM usage.&lt;br /&gt;
&lt;br /&gt;
===PostgreSQL performance===&lt;br /&gt;
&lt;br /&gt;
There are some good papers around on tuning PostgreSQL (like [http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server this one]), and Moodle&#039;s case does not seem to be different to the general case.&lt;br /&gt;
&lt;br /&gt;
The first thing to recognise is that if you really need to worry about tuning you should be using a separate machine for the database server. If you are not using a separate machine then the answers to many performance questions are substantially muddied by the memory requirements of the rest of the application.&lt;br /&gt;
&lt;br /&gt;
You should probably &#039;&#039;&#039;enable autovacuum&#039;&#039;&#039;, unless you know what you are doing. Many e-learning sites have predictable periods of low use, so disabling autovacuum and running a specific vacuum at those times can be a good option. Or perhaps leave autovacuum running but do a full vacuum weekly in a quiet period.&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;shared_buffers&#039;&#039;&#039; to something reasonable. For versions up to 8.1 my testing has shown that peak performance is almost always obtained with buffers &amp;lt; 10000, so if you are using such a version, and have more than 512M of RAM just set shared_buffers to 10,000 (8MB).&lt;br /&gt;
&lt;br /&gt;
The buffer management had a big overhaul in 8.2 and &amp;quot;reasonable&amp;quot; is now a much larger number. I have not conducted performance tests with 8.2, but the recommendations from others are generally that you should now scale shared_buffers much more with memory and may continue to reap benefits even up to values like 100,000 (80MB). Consider using 1-2% of system RAM.&lt;br /&gt;
&lt;br /&gt;
PostgreSQL will also assume that the operating system is caching its files, so setting &#039;&#039;&#039;effective_cache_size&#039;&#039;&#039; to a reasonable value is also a good idea. A reasonable value will usually be (total RAM - RAM in use by programs). If you are running Linux and leave the system running for a day or two you can look at &#039;free&#039; and under the &#039;cached&#039; column you will see what it currently is. Consider taking that number (which is kB) and dividing it by 10 (i.e. allow 20% for other programs cache needs and then divide by 8 to get pages). If you are not using a dedicated database server you will need to decrease that value to account for usage by other programs.&lt;br /&gt;
&lt;br /&gt;
Some other useful parameters that can have positive effects, and the values I would typically set them to on a machine with 4G RAM, are:&lt;br /&gt;
&lt;br /&gt;
 work_mem = 10240&lt;br /&gt;
&lt;br /&gt;
That&#039;s 10M of RAM to use instead of on-disk sorting and so forth. That can give a big speed increase, but it is per connection and 200 connections * 10M is 2G, so it can theoretically chew up a lot of RAM.&lt;br /&gt;
&lt;br /&gt;
 maintenance_work_mem = 163840&lt;br /&gt;
&lt;br /&gt;
That&#039;s 160M of RAM which will be used by (e.g.) VACUUM, index rebuild, cluster and so forth. This should only be used periodically and should be freed when those processes exit, so I believe it is well worth while.&lt;br /&gt;
&lt;br /&gt;
 max_fsm_pages = 100000&lt;br /&gt;
 max_fsm_relations = 5000&lt;br /&gt;
&lt;br /&gt;
These are used to hold the free-space map, and if they are too small you will see performance degradation after the database has been operating for some time. The exact numbers to set can be gleaned from the output of VACUUM VERBOSE, which prints the required FSM pages at the end of it&#039;s run. The 5x increase seems to be useful for a Moodle installation, from experience.&lt;br /&gt;
&lt;br /&gt;
 wal_buffers = 64&lt;br /&gt;
&lt;br /&gt;
These buffers are used for the write-ahead log, and there have been a number of reports on the PostgreSQL mailing lists of improvement from this level of increase.&lt;br /&gt;
&lt;br /&gt;
This is a little out of date now (version 8.0) but still worth a read: http://www.powerpostgresql.com/Docs&lt;br /&gt;
&lt;br /&gt;
And there is lots of good stuff here as well: http://www.varlena.com/GeneralBits/Tidbits/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Based on Andrew McMillan&#039;s post at [http://moodle.org/mod/forum/discuss.php?d=68558 Tuning PostgreSQL] forum thread.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Other database performance links===&lt;br /&gt;
* Consider using a &#039;&#039;&#039;distributed cacheing system&#039;&#039;&#039; like [http://en.wikipedia.org/wiki/Memcached memcached] but note that memcached does not have any security features so it should be used behind a firewall.&lt;br /&gt;
* Consider using PostgreSQL. See [[Arguments in favour of PostgreSQL]] and [http://moodle.org/mod/forum/discuss.php?d=49195 how to migrate from MySQL to PostgreSQL] (forum discussion).&lt;br /&gt;
* [http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html General advice on tuning MySQL parameters] (advice from the MySQL manual)&lt;br /&gt;
* [http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ InnoDB performance optimization] taken from the [http://www.mysqlperformanceblog.com/ MySQL performance blog] site.&lt;br /&gt;
&lt;br /&gt;
==Performance of different Moodle modules==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s activity modules, filters, and other plugins can be activated/deactivated. If necessary, you may wish to deactivate some features (such as chat) if not required - but this isn&#039;t necessary. Some notes on the performance of certain modules:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Chat&#039;&#039;&#039; module is [http://moodle.org/mod/forum/discuss.php?d=37979&amp;amp;parent=175079 said] to be a hog in terms of frequent HTTP requests to the main server. This can be reduced by setting the module to use &#039;&#039;Streamed&#039;&#039; updates, or, if you&#039;re using a Unix-based webserver, by running the chat in daemon mode. When using the Chat module use the configuration settings to tune for your expected load. Pay particular attention to the &#039;&#039;chat_old_ping&#039;&#039; and &#039;&#039;chat_refresh&#039;&#039; parameters as these can have greatest impact on server load.&lt;br /&gt;
* The &#039;&#039;&#039;Quiz&#039;&#039;&#039; module is known to stretch database performance. However, it has been getting better in recent versions, and we don&#039;t know of any good, up-to-date performance measurements. (Here is a [http://moodle.org/mod/forum/discuss.php?d=68579 case study from 2007 with 300 quiz users].)&lt;br /&gt;
* The Moodle &#039;&#039;&#039;Cron&#039;&#039;&#039; task is triggered by calling the script &#039;&#039;cron.php&#039;&#039;. If this is called over HTTP (e.g. using wget or curl) it can take a large amount of memory on large installations. If it is called by directly invoking the php command (e.g. &#039;&#039;php -f /path/to/moodle/directory/admin/cli/cron.php&#039;&#039;) efficiency can be much improved.&lt;br /&gt;
* The &#039;&#039;&#039;Recent activities&#039;&#039;&#039; block is consuming too many resources if you have huge number of records &amp;lt;code&amp;gt;mdl_log&amp;lt;/code&amp;gt;. This is being tested to optimize the SQL query.&lt;br /&gt;
&lt;br /&gt;
==Moodle Image Optimization==&lt;br /&gt;
&lt;br /&gt;
The base images delivered in the original Moodle distribution package provide unoptimized graphics, most of which can benefit from lossless recompression utilizing [http://optipng.sourceforge.net/ optipng] for PNGs, [http://www.lcdf.org/gifsicle/ gifsicle] for GIFs and [http://www.kokkonen.net/tjko/projects.html jpegoptim] for JPGs.  Optimized graphics transfer faster and provide a faster perceived response for clients[http://www.websiteoptimization.com/speed/12/], especially distance learners.  The following example will recursively optimize (without any loss of quality) all the graphics and image files included in a base Moodle installation directory on a server with the above commands installed and available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.png -exec optipng -o7 {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.gif -exec gifsicle -O2 -b {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.jpg -exec jpegoptim -p {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both [http://optipng.sourceforge.net/ optipng] and [http://www.lcdf.org/gifsicle/ gifsicle] are provided in the base repositories of most newer Linux distributions; [http://www.kokkonen.net/tjko/projects.html jpegoptim] must be downloaded and installed manually.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle: [http://moodle.org/mod/forum/view.php?f=94 Hardware and Performance] forum&lt;br /&gt;
*[http://opensourceelearning.blogspot.be/2012/10/why-your-moodle-site-is-slow-five.html Why Your Moodle Site is Slow: Five Simple Settings] blog post from Jonathan Moore &lt;br /&gt;
*I teach with Moodle perfomance testing: http://www.iteachwithmoodle.com/2012/11/17/moodle-2-4-beta-performance-test-comparison-with-moodle-2-3/&lt;br /&gt;
*[http://jfilip.ca/2013/08/20/moodle-2-4-5-vs-2-5-1-performance-and-muc-apc-cache-store/ Moodle 2.4.5 vs 2.5.2 performance and MUC APC cahe store]&lt;br /&gt;
*[http://jfilip.ca/2013/09/25/moodle-performance-testing-2-4-6-vs-2-5-2-vs-2-6dev/ Moodle performance testing 2.4.6 vs 2.5.2 vs 2.6dev]&lt;br /&gt;
*[http://jfilip.ca/2013/09/24/moodle-performance-analysis-revisted-now-with-mariadb/ Moodle performance analysis revisited (now with MariaDB)]&lt;br /&gt;
*[http://tjhunt.blogspot.ca/2013/05/performance-testing-moodle.html Tim Hunt&#039;s blog (May 2, 2013) on performance testing Moodle]&lt;br /&gt;
*[http://newrelic.com/ New Relic, Application Performance Monitoring]&lt;br /&gt;
&lt;br /&gt;
There have been a lot of discussions on moodle.org about performance, here are some of the more interesting and (potentially) useful ones:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=83057 Performance woes!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88927 Comments on planned server hardware]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102978#p461624 Moodle performance in a pil by Martin Langhoff]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=240391#unread Advice on optimising php/db code in moodle2+]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=243531 Moodle 2.5 performance testing at the OU]&lt;br /&gt;
&lt;br /&gt;
[[es:Recomendaciones sobre desempeño]]&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;br /&gt;
[[de:Geschwindigkeitsempfehlungen]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Performance_recommendations&amp;diff=108104</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Performance_recommendations&amp;diff=108104"/>
		<updated>2013-12-01T13:14:55Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Scalability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
Moodle can be made to perform very well, at small usage levels or scaling up to many thousands of users. The factors involved in performance are basically the same as for any PHP-based database-driven system. When trying to optimize your server, try to focus on the factor which will make the most difference to the user. For example, if you have relatively more users browsing than accessing the database, look to improve the webserver performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Obtain a baseline benchmark==&lt;br /&gt;
&lt;br /&gt;
Before attempting any optimization, you should obtain a baseline benchmark of the component of the system you are trying to improve. For Linux try [http://lbs.sourceforge.net/ LBS] and for Windows use the Performance Monitor. Once you have quantitative data about how your system is performing currently, you&#039;ll be able to determine if the change you have made has had any real impact.&lt;br /&gt;
&lt;br /&gt;
The overall aim of adjustments to improve performance is to use RAM (cacheing) and to reduce disk-based activity. It is especially important to try to eliminate swap file usage as much as you can. If your system starts swapping, this is a sign that you need more RAM. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;optimization order preference&#039;&#039;&#039; is usually: primary storage (more RAM), secondary storage (faster hard disks/improved hard disk configuration), processor (more and faster).&lt;br /&gt;
&lt;br /&gt;
==Scalability==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s design (with clear separation of application layers) allows for strongly scalable setups. (Please check the list of [[Large installations|large Moodle installations]].)&lt;br /&gt;
&lt;br /&gt;
Large sites usually separate the web server and database onto separate servers, although for smaller installations this is typically not necessary.&lt;br /&gt;
&lt;br /&gt;
It is possible to load-balance a Moodle installation, for example by using more than one webserver. The separate webservers should query the same database and refer to the same filestore and cache areas (see [[Caching]]), but otherwise the separation of the application layers is complete enough to make this kind of clustering feasible. Similarly, the database could be a cluster of servers (e.g. a MySQL cluster), but this is not an easy task and you should seek expert support, e.g. from a Moodle Partner.&lt;br /&gt;
&lt;br /&gt;
===Server cluster===&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88214 Installation for 3000 simultaneous users]&lt;br /&gt;
&lt;br /&gt;
==Hardware configuration==&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The fastest and most effective change that you can make to improve performance is to &#039;&#039;&#039;increase the amount of RAM on your web server&#039;&#039;&#039; - get as much as possible (e.g. 4GB or more). Increasing primary memory will reduce the need for processes to swap to disk and will enable your server to handle more users.&lt;br /&gt;
* Better performance is gained by obtaining the best &#039;&#039;&#039;processor capability&#039;&#039;&#039; you can, i.e. dual or dual core processors. A modern BIOS should allow you to enable hyperthreading, but check if this makes a difference to the overall performance of the processors by using a [http://en.wikipedia.org/wiki/Super_PI CPU benchmarking tool].&lt;br /&gt;
* If you can afford them, use &#039;&#039;&#039;SCSI hard disks&#039;&#039;&#039; instead of SATA drives. SATA drives will increase your system&#039;s CPU utilization, whereas SCSI drives have their own integrated processors and come into their own when you have multiple drives. If you must have SATA drives, check that your motherboard and the drives themselves support NCQ (Native Command Queuing).&lt;br /&gt;
* Purchase hard disks with a &#039;&#039;&#039;low seek time&#039;&#039;&#039;. This will improve the overall speed of your system, especially when accessing Moodle&#039;s reports.&lt;br /&gt;
* Size your &#039;&#039;&#039;swap file&#039;&#039;&#039; correctly. The general advice is to set it to 4 x physical RAM.&lt;br /&gt;
* Use a &#039;&#039;&#039;RAID disk system&#039;&#039;&#039;. Although there are many different RAID configurations you can create, the following generally works best:&lt;br /&gt;
** install a hardware RAID controller (if you can)&lt;br /&gt;
** the operating system and swap drive on one set of disks configured as RAID-1.&lt;br /&gt;
** Moodle, Web server and Database server on another set of disks configured as RAID-5.&lt;br /&gt;
* If your &#039;moodledata&#039; area is going to be on relatively slow storage (e.g. NFS, SAN) you will probably have performance issues with the default cache configuration (which writes to this storage). See the page on [[Caching]] and consider an alternative. &lt;br /&gt;
* Use &#039;&#039;&#039;gigabit ethernet&#039;&#039;&#039; for improved latency and throughput. This is especially important when you have your webserver and database server separated out on different hosts.&lt;br /&gt;
* Check the settings on your &#039;&#039;&#039;network card&#039;&#039;&#039;. You may get an improvement in performance by increasing the use of buffers and transmit/receive descriptors (balance this with processor and memory overheads) and off-loading TCP checksum calculation onto the card instead of the OS.&lt;br /&gt;
*  Read this [http://moodle.org/mod/forum/discuss.php?d=68579 Case Study] on a server stress test with 300 users.  &lt;br /&gt;
* See this [http://elearning.sgu.ac.jp/doc/PT/ accompanying report] on network traffic and server loads.&lt;br /&gt;
* See the [[Moodle.org configuration]]&lt;br /&gt;
* Also see this SFSU presentation at Educause (using VMWare): [http://www.educause.edu/Resources/AnOpenSourceLMSforaMissionCrit/162843]&lt;br /&gt;
&lt;br /&gt;
==Operating System==&lt;br /&gt;
* You can use [http://en.wikipedia.org/wiki/Linux Linux](recommended), Unix-based, Windows or Mac OS X for the server &#039;&#039;&#039;operating system&#039;&#039;&#039;. *nix operating systems generally require less memory than Mac OS X or Windows servers for doing the same task as the server is configured with just a shell interface. Additionally Linux does not have licensing fees attached, but can have a big learning curve if you&#039;re used to another operating system. If you have a large number of processors running SMP, you may also want to consider using a highly tuned OS such as [http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris].&lt;br /&gt;
* Check your own OS and &#039;&#039;&#039;vendor specific instructions&#039;&#039;&#039; for optimization steps.&lt;br /&gt;
** For Linux look at the [http://linuxperf.sourceforge.net/ Linux Performance Team] site. &lt;br /&gt;
** For Linux investigate the hdparm command, e.g. hdparm -m16 -d1 can be used to enable read/write on multiple sectors and DMA. Mount disks with the async and noatime options.&lt;br /&gt;
** For Windows set the sever to be optimized for network applications (Control Panel, Network Connections, LAN connection, Properties, File &amp;amp; Printer Sharing for Microsoft Networks, Properties, Optimization). You can also search the [http://technet.microsoft.com/ Microsoft TechNet site] for optimization documents.&lt;br /&gt;
&lt;br /&gt;
==Web server performance==&lt;br /&gt;
&lt;br /&gt;
Installing [http://www.mozilla.com/en-US/ Firefox] and the [https://addons.mozilla.org/en-US/firefox/addon/1843 firebug] extension will allow you to watch the time it takes for each page component to load. Also, the [https://addons.mozilla.org/en-US/firefox/addon/5369 Yslow] extension will evaluate your page against Yahoo&#039;s [http://www.skrenta.com/2007/05/14_rules_for_fast_web_pages_by_1.html 14 rules], full text [http://developer.yahoo.com/performance/rules.html Best Practices for Speeding Up Your Web Site], &amp;lt;strike&amp;gt;([http://video.yahoo.com/video/play?vid=1040890 video])&amp;lt;/strike&amp;gt; for fast loading websites.&lt;br /&gt;
&lt;br /&gt;
===PHP performance===&lt;br /&gt;
* You are strongly recommended to use a &#039;&#039;&#039;PHP accelerator&#039;&#039;&#039; to ease CPU load, such as [http://pecl.php.net/apc APC], [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache], [http://sourceforge.net/projects/wincache WinCache] or [http://eaccelerator.net/ eAccelerator]. (Take care to choose a PHP accelerator that is known to work well with your version of PHP and note that Turck MMCache is [http://turckmmcache.exeprod.com/TheManifestoEnglish no longer maintained] and can cause failures with PHP 5). &lt;br /&gt;
* Improvements in read/write performance can be improved by putting the cached PHP pages on a [[TMPFS]] filesystem - but remember that you&#039;ll lose the cache contents when there is a power failure or the server is rebooted.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS6 ISAPI module&#039;&#039;&#039; (rather than a CGI). IIS 7.0/7.5 (Windows Server 2008/R2) users should choose a FastCGI installation for best performance.&lt;br /&gt;
* Also check the &#039;&#039;&#039;memory_limit&#039;&#039;&#039; in php.ini, reduce it to 16M for Moodle version earlier than 1.7 ([http://moodle.org/mod/forum/discuss.php?d=39656 See this forum discussion]). For Moodle 1.7 or later, it is recommended that the value of memory_limit should be 40M. As of [http://www.php.net/ChangeLog-5.php PHP 5.2.1] the default value for the memory_limit directive is 128M.&lt;br /&gt;
* Also see [[PHP_settings_by_Moodle_version]]&lt;br /&gt;
&lt;br /&gt;
===Install HowTo===&lt;br /&gt;
* [http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html APC on CentOS 5.x (linux)]&lt;br /&gt;
* [http://fplanque.com/dev/linux/install-apc-php-cache-debian-lenny APC on Debian (linux)]&lt;br /&gt;
* [http://www.linuxtuts.net/211-installing-memcached-php5-memcache-module-debian-apache2.html MemCache module on Debian (Apache2 and PHP5) ]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/03/installing-memcached-on-centos-5x.html Installing Memcache on CentOS 5.x (linux)]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/02/installing-eaccelerator-cache-for-php.html Installing eAccelerator on CentOS 5.x (linux)]&lt;br /&gt;
* [https://docs.moodle.org/en/Installing_eAccelerator_In_Ubuntu_Server/ Installing eAccelerator on Ubuntu Server (linux)]&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&lt;br /&gt;
* If you are using Apache on a Windows server, use the build from [http://www.apachelounge.com Apache Lounge] which is reported to have [http://moodle.org/mod/forum/discuss.php?d=93358 performance and stability improvements] compared to the official Apache download. Note that this is an unofficial build, so may not keep up with official releases.&lt;br /&gt;
* Set the &#039;&#039;&#039;MaxClients&#039;&#039;&#039; directive correctly. Use this formula to help (which uses 80% of available memory to leave room for spare):&lt;br /&gt;
 MaxClients = Total available memory * 80% / Max memory usage of apache process&lt;br /&gt;
:Memory usage of apache process is usually 10MB but Moodle can easily use up to 100MB per process, so a general rule of thumb is to divide your available memory in megabytes by 100 to get a conservative setting for MaxClients. You are quite likely to find yourself lowering the MaxClients from its default of 150 on a Moodle server. To get a more accurate estimate read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&lt;br /&gt;
&lt;br /&gt;
:If you need to increase the value of &#039;&#039;&#039;MaxClients&#039;&#039;&#039; beyond 256, you will also need to set the &#039;&#039;&#039;ServerLimit&#039;&#039;&#039; directive. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: Do not be tempted to set the value of MaxClients higher than your available memory as your server will consume more RAM than available and start to swap to disk. &lt;br /&gt;
* Consider reducing the &#039;&#039;&#039;number of modules&#039;&#039;&#039; that Apache loads in the httpd.conf file to the minumum necessary to reduce the memory needed. &lt;br /&gt;
* Use the &#039;&#039;&#039;latest version of Apache&#039;&#039;&#039; - Apache 2 has an improved memory model which reduces memory usage further.&lt;br /&gt;
* For Unix/Linux systems, consider lowering &#039;&#039;&#039;MaxRequestsPerChild&#039;&#039;&#039; in httpd.conf to as low as 20-30 (if you set it any lower the overhead of forking begins to outweigh the benefits). &lt;br /&gt;
* For a heavily loaded server, consider setting &#039;&#039;&#039;KeepAlive Off&#039;&#039;&#039; (do this only if your Moodle pages do not contain links to resources or uploaded images) or lowering the &#039;&#039;&#039;KeepAliveTimeout&#039;&#039;&#039; to between 2 and 5. The default is 15 (seconds) - the higher the value the more server processes will be kept waiting for possibly idle connections. A more accurate value for KeepAliveTimeout is obtained by observing how long it takes your users to download a page. After altering any of the KeepAlive variables, monitor your CPU utilization as there may be an additional overhead in initiating more worker processes/threads.&lt;br /&gt;
* As an alternative to using KeepAlive Off, consider setting-up a &#039;&#039;&#039;Reverse Proxy server&#039;&#039;&#039; infront of the Moodle server to cache HTML files with images. You can then return Apache to using keep-alives on the Moodle server.&lt;br /&gt;
* If you do not use a .htaccess file, set the &#039;&#039;&#039;AllowOverride&#039;&#039;&#039; variable to AllowOverride None to prevent .htaccess lookups.&lt;br /&gt;
* Set &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; correctly so as to avoid content-negotiation. Here&#039;s an example from a production server:&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
* Unless you are doing development work on the server, set &#039;&#039;&#039;ExtendedStatus Off&#039;&#039;&#039; and disable mod_info as well as mod_status.&lt;br /&gt;
* Leave &#039;&#039;&#039;HostnameLookups Off&#039;&#039;&#039; (as default) to reduce DNS latency.&lt;br /&gt;
* Consider reducing the value of &#039;&#039;&#039;TimeOut&#039;&#039;&#039; to between 30 to 60 (seconds). &lt;br /&gt;
* For the &#039;&#039;&#039;Options directive&#039;&#039;&#039;, avoid Options Multiviews as this performs a directory scan. To reduce disk I/O further use&lt;br /&gt;
 Options -Indexes FollowSymLinks&lt;br /&gt;
&lt;br /&gt;
* Compression reduces response times by reducing the size of the HTTP response&lt;br /&gt;
# Install and enable mod_deflate - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;ifModule mod_deflate.c&amp;gt;&lt;br /&gt;
   AddOutputFilterByType DEFLATE text/html text/plain text/xml text/x-js text/javascript text/css application/javascript&lt;br /&gt;
 &amp;lt;/ifmodule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IIS performance===&lt;br /&gt;
All alter this location in the registry:&lt;br /&gt;
 HKLM\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters\&lt;br /&gt;
* The equivalent to KeepAliveTimeout is &#039;&#039;&#039;ListenBackLog&#039;&#039;&#039; (IIS - registry location is HKLM\ SYSTEM\ CurrentControlSet\ Services\ Inetinfo\ Parameters). Set this to between 2 to 5.&lt;br /&gt;
*Change the &#039;&#039;&#039;MemCacheSize&#039;&#039;&#039; value to adjust the amount of memory (Mb) that IIS will use for its file cache (50% of available memory by default).&lt;br /&gt;
*Change the &#039;&#039;&#039;MaxCachedFileSize&#039;&#039;&#039; to adjust the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).&lt;br /&gt;
*Create a new DWORD called &#039;&#039;&#039;ObjectCacheTTL&#039;&#039;&#039; to change the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).&lt;br /&gt;
&lt;br /&gt;
===Lighttpd, NginX and Cherokee performance===&lt;br /&gt;
You can increase server performance by using a &#039;&#039;&#039;light-weight&#039;&#039;&#039; webserver like [http://www.lighttpd.net/ lighttpd],  [http://nginx.net/ nginx] or [http://www.cherokee-project.com/ cherokee] in combination with PHP in FastCGI-mode. Lighttpd was originally created as a proof-of-concept[http://www.lighttpd.net/story] to address the [http://www.kegel.com/c10k.html C10k problem] and while primarily recommended for memory-limited servers, its design origins and asynchronous-IO model make it a suitable and proven[http://blog.lighttpd.net/articles/2006/12/28/lighttpd-powers-5-alexa-top-250-sites] alternative HTTP server for high-load websites and web apps, including Moodle. See the [[lighttpd | MoodleDocs Lighttpd page]] for additional information, configuration example and links.&lt;br /&gt;
&lt;br /&gt;
Alternatively, both [http://www.lighttpd.net/ lighttpd] and [http://nginx.net/ nginx] are capable of performing as a load-balancer and/or reverse-proxy to alleviate load on back-end servers[http://www.linuxjournal.com/article/10108], providing benefit without requiring an actual software change on existing servers.&lt;br /&gt;
&lt;br /&gt;
Do note that these are likely to be the least tested server environments of all particularly if you are using advanced features such as web services and/or Moodle Networking. They are probably best considered for heavily used Moodle sites with relatively simple configurations.&lt;br /&gt;
&lt;br /&gt;
===X-Sendfile===&lt;br /&gt;
&lt;br /&gt;
X-Sendfile modules improve performance when sending large files from Moodle. It is recommended to configure your web server and Moodle to use this feature of available.&lt;br /&gt;
&lt;br /&gt;
Configure web server:&lt;br /&gt;
* Apache - https://tn123.org/mod_xsendfile/&lt;br /&gt;
* Lighttpd - http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file&lt;br /&gt;
* Nginx - http://wiki.nginx.org/XSendfile&lt;br /&gt;
&lt;br /&gt;
Enable support in config.php (see config-dist.php):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Sendfile&#039;;           // Apache {@see https://tn123.org/mod_xsendfile/}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-LIGHTTPD-send-file&#039;; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;     // Nginx {@see http://wiki.nginx.org/XSendfile}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure file location prefixes if your server implementation requires it:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
//         &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot,&lt;br /&gt;
//         &#039;/cachedir/&#039; =&amp;gt; &#039;/var/www/moodle/cache&#039;,    // for custom $CFG-&amp;gt;cachedir locations&lt;br /&gt;
//         &#039;/localcachedir/&#039; =&amp;gt; &#039;/var/local/cache&#039;,    // for custom $CFG-&amp;gt;localcachedir locations&lt;br /&gt;
//         &#039;/tempdir/&#039;  =&amp;gt; &#039;/var/www/moodle/temp&#039;,     // for custom $CFG-&amp;gt;tempdir locations&lt;br /&gt;
//         &#039;/filedir&#039;   =&amp;gt; &#039;/var/www/moodle/filedir&#039;,  // for custom $CFG-&amp;gt;filedir locations&lt;br /&gt;
//     );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
===MySQL performance===&lt;br /&gt;
&lt;br /&gt;
The following are MySQL specific settings which can be adjusted for better performance in your my.cnf (my.ini in Windows). The file contains a list of settings and their values. To see the current values use these commands&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
 SHOW VARIABLES; &lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: You must make backups of your database before attempting to change any MySQL server configuration. After any change to the my.cnf, restart mysqld.&lt;br /&gt;
&lt;br /&gt;
If you are able, the [http://mysqltuner.com/ MySQLTuner] tool can be run against your MySQL server and will calculate appropriate configuration values for most of the following settings based on your current load, status and variables automatically.&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with &lt;br /&gt;
 query_cache_type = 1. &lt;br /&gt;
For most Moodle installs, set the following:&lt;br /&gt;
 query_cache_size = 36M &lt;br /&gt;
 query_cache_min_res_unit = 2K. &lt;br /&gt;
The query cache will improve performance if you are doing few updates on the database. &lt;br /&gt;
* Set the &#039;&#039;&#039;table cache&#039;&#039;&#039; correctly. For Moodle 1.6 set &lt;br /&gt;
 table_cache = 256 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min), and for Moodle 1.7 set &lt;br /&gt;
 table_cache = 512 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min). The table cache is used by all threads (connections), so monitor the value of opened_tables to further adjust - if opened_tables &amp;gt; 3 * table_cache(table_open_cache in MySQL &amp;gt; 5.1.2) then increase table_cache upto your OS limit. Note also that the figure for table_cache will also change depending on the number of modules and plugins you have installed. Find the number for your server by executing the mysql statement below. Look at the number returned and set table_cache to this value.&lt;br /&gt;
 mysql&amp;gt;SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema=&#039;yourmoodledbname&#039;;&lt;br /&gt;
* Set the &#039;&#039;&#039;thread cache&#039;&#039;&#039; correctly. Adjust the value so that your thread cache utilization is as close to 100% as possible by this formula:&lt;br /&gt;
 thread cache utilization (%) = (threads_created / connections) * 100&lt;br /&gt;
* The &#039;&#039;&#039;key buffer&#039;&#039;&#039; can improve the access speed to Moodle&#039;s SELECT queries. The correct size depends on the size of the index files (.myi) and in Moodle 1.6 or later (without any additional modules and plugins), the recommendation for this value is key_buffer_size = 32M. Ideally you want the database to be reading once from the disk for every 100 requests so monitor that the value is suitable for your install by adjusting the value of key_buffer_size so that the following formulas are true:&lt;br /&gt;
 key_read / key_read_requests &amp;lt; 0.01&lt;br /&gt;
 key_write / key_write_requests &amp;lt;= 1.0&lt;br /&gt;
* Set the &#039;&#039;&#039;maximum number of connections&#039;&#039;&#039; so that your users will not see a &amp;quot;Too many connections&amp;quot; message. Be careful that this may have an impact on the total memory used. MySQL connections usually last for milliseconds, so it is unusual even for a heavily loaded server for this value to be over 200.&lt;br /&gt;
* Manage &#039;&#039;&#039;high burst activity&#039;&#039;&#039;. If your Moodle install uses a lot of quizzes and you are experiencing performance problems (check by monitoring the value of threads_connected - it should not be rising) consider increasing the value of back_log.&lt;br /&gt;
* &#039;&#039;&#039;Optimize your tables weekly and after upgrading Moodle&#039;&#039;&#039;. It is good practice to also optimize your tables after performing a large data deletion exercise, e.g. at the end of your semester or academic year. This will ensure that index files are up to date. Backup your database first and then use:&lt;br /&gt;
 mysql&amp;gt;CHECK TABLE mdl_tablename;&lt;br /&gt;
 mysql&amp;gt;OPTIMIZE TABLE mdl_tablename;&lt;br /&gt;
:The common tables in Moodle to check are mdl_course_sections, mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any errors need to be corrected using REPAIR TABLE (see the [http://dev.mysql.com/doc/refman/5.0/en/repair-table.html MySQL manual] and this [http://moodle.org/mod/forum/discuss.php?d=58208#p279638 forum script]).&lt;br /&gt;
* &#039;&#039;&#039;Maintain the key distribution&#039;&#039;&#039;. Every month or so it is a good idea to stop the mysql server and run these myisamchk commands.&lt;br /&gt;
 #myisamchk -a -S /pathtomysql/data/moodledir/*.MYI&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.&lt;br /&gt;
* Reduce the number of &#039;&#039;&#039;temporary tables saved to disk&#039;&#039;&#039;. Check this with the created_tmp_disk_tables value. If this is relatively large (&amp;gt;5%) increase tmp_table_size until you see a reduction. Note that this will have an impact on RAM usage.&lt;br /&gt;
&lt;br /&gt;
===PostgreSQL performance===&lt;br /&gt;
&lt;br /&gt;
There are some good papers around on tuning PostgreSQL (like [http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server this one]), and Moodle&#039;s case does not seem to be different to the general case.&lt;br /&gt;
&lt;br /&gt;
The first thing to recognise is that if you really need to worry about tuning you should be using a separate machine for the database server. If you are not using a separate machine then the answers to many performance questions are substantially muddied by the memory requirements of the rest of the application.&lt;br /&gt;
&lt;br /&gt;
You should probably &#039;&#039;&#039;enable autovacuum&#039;&#039;&#039;, unless you know what you are doing. Many e-learning sites have predictable periods of low use, so disabling autovacuum and running a specific vacuum at those times can be a good option. Or perhaps leave autovacuum running but do a full vacuum weekly in a quiet period.&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;shared_buffers&#039;&#039;&#039; to something reasonable. For versions up to 8.1 my testing has shown that peak performance is almost always obtained with buffers &amp;lt; 10000, so if you are using such a version, and have more than 512M of RAM just set shared_buffers to 10,000 (8MB).&lt;br /&gt;
&lt;br /&gt;
The buffer management had a big overhaul in 8.2 and &amp;quot;reasonable&amp;quot; is now a much larger number. I have not conducted performance tests with 8.2, but the recommendations from others are generally that you should now scale shared_buffers much more with memory and may continue to reap benefits even up to values like 100,000 (80MB). Consider using 1-2% of system RAM.&lt;br /&gt;
&lt;br /&gt;
PostgreSQL will also assume that the operating system is caching its files, so setting &#039;&#039;&#039;effective_cache_size&#039;&#039;&#039; to a reasonable value is also a good idea. A reasonable value will usually be (total RAM - RAM in use by programs). If you are running Linux and leave the system running for a day or two you can look at &#039;free&#039; and under the &#039;cached&#039; column you will see what it currently is. Consider taking that number (which is kB) and dividing it by 10 (i.e. allow 20% for other programs cache needs and then divide by 8 to get pages). If you are not using a dedicated database server you will need to decrease that value to account for usage by other programs.&lt;br /&gt;
&lt;br /&gt;
Some other useful parameters that can have positive effects, and the values I would typically set them to on a machine with 4G RAM, are:&lt;br /&gt;
&lt;br /&gt;
 work_mem = 10240&lt;br /&gt;
&lt;br /&gt;
That&#039;s 10M of RAM to use instead of on-disk sorting and so forth. That can give a big speed increase, but it is per connection and 200 connections * 10M is 2G, so it can theoretically chew up a lot of RAM.&lt;br /&gt;
&lt;br /&gt;
 maintenance_work_mem = 163840&lt;br /&gt;
&lt;br /&gt;
That&#039;s 160M of RAM which will be used by (e.g.) VACUUM, index rebuild, cluster and so forth. This should only be used periodically and should be freed when those processes exit, so I believe it is well worth while.&lt;br /&gt;
&lt;br /&gt;
 max_fsm_pages = 100000&lt;br /&gt;
 max_fsm_relations = 5000&lt;br /&gt;
&lt;br /&gt;
These are used to hold the free-space map, and if they are too small you will see performance degradation after the database has been operating for some time. The exact numbers to set can be gleaned from the output of VACUUM VERBOSE, which prints the required FSM pages at the end of it&#039;s run. The 5x increase seems to be useful for a Moodle installation, from experience.&lt;br /&gt;
&lt;br /&gt;
 wal_buffers = 64&lt;br /&gt;
&lt;br /&gt;
These buffers are used for the write-ahead log, and there have been a number of reports on the PostgreSQL mailing lists of improvement from this level of increase.&lt;br /&gt;
&lt;br /&gt;
This is a little out of date now (version 8.0) but still worth a read: http://www.powerpostgresql.com/Docs&lt;br /&gt;
&lt;br /&gt;
And there is lots of good stuff here as well: http://www.varlena.com/GeneralBits/Tidbits/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Based on Andrew McMillan&#039;s post at [http://moodle.org/mod/forum/discuss.php?d=68558 Tuning PostgreSQL] forum thread.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Other database performance links===&lt;br /&gt;
* Consider using a &#039;&#039;&#039;distributed cacheing system&#039;&#039;&#039; like [http://en.wikipedia.org/wiki/Memcached memcached] but note that memcached does not have any security features so it should be used behind a firewall.&lt;br /&gt;
* Consider using PostgreSQL. See [[Arguments in favour of PostgreSQL]] and [http://moodle.org/mod/forum/discuss.php?d=49195 how to migrate from MySQL to PostgreSQL] (forum discussion).&lt;br /&gt;
* [http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html General advice on tuning MySQL parameters] (advice from the MySQL manual)&lt;br /&gt;
* [http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ InnoDB performance optimization] taken from the [http://www.mysqlperformanceblog.com/ MySQL performance blog] site.&lt;br /&gt;
&lt;br /&gt;
==Performance of different Moodle modules==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s activity modules, filters, and other plugins can be activated/deactivated. If necessary, you may wish to deactivate some features (such as chat) if not required - but this isn&#039;t necessary. Some notes on the performance of certain modules:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Chat&#039;&#039;&#039; module is [http://moodle.org/mod/forum/discuss.php?d=37979&amp;amp;parent=175079 said] to be a hog in terms of frequent HTTP requests to the main server. This can be reduced by setting the module to use &#039;&#039;Streamed&#039;&#039; updates, or, if you&#039;re using a Unix-based webserver, by running the chat in daemon mode. When using the Chat module use the configuration settings to tune for your expected load. Pay particular attention to the &#039;&#039;chat_old_ping&#039;&#039; and &#039;&#039;chat_refresh&#039;&#039; parameters as these can have greatest impact on server load.&lt;br /&gt;
* The &#039;&#039;&#039;Quiz&#039;&#039;&#039; module is known to stretch database performance. However, it has been getting better in recent versions, and we don&#039;t know of any good, up-to-date performance measurements. (Here is a [http://moodle.org/mod/forum/discuss.php?d=68579 case study from 2007 with 300 quiz users].)&lt;br /&gt;
* The Moodle &#039;&#039;&#039;Cron&#039;&#039;&#039; task is triggered by calling the script &#039;&#039;cron.php&#039;&#039;. If this is called over HTTP (e.g. using wget or curl) it can take a large amount of memory on large installations. If it is called by directly invoking the php command (e.g. &#039;&#039;php -f /path/to/moodle/directory/admin/cli/cron.php&#039;&#039;) efficiency can be much improved.&lt;br /&gt;
* The &#039;&#039;&#039;Recent activities&#039;&#039;&#039; block is consuming too many resources if you have huge number of records &amp;lt;code&amp;gt;mdl_log&amp;lt;/code&amp;gt;. This is being tested to optimize the SQL query.&lt;br /&gt;
&lt;br /&gt;
==Moodle Image Optimization==&lt;br /&gt;
&lt;br /&gt;
The base images delivered in the original Moodle distribution package provide unoptimized graphics, most of which can benefit from lossless recompression utilizing [http://optipng.sourceforge.net/ optipng] for PNGs, [http://www.lcdf.org/gifsicle/ gifsicle] for GIFs and [http://www.kokkonen.net/tjko/projects.html jpegoptim] for JPGs.  Optimized graphics transfer faster and provide a faster perceived response for clients[http://www.websiteoptimization.com/speed/12/], especially distance learners.  The following example will recursively optimize (without any loss of quality) all the graphics and image files included in a base Moodle installation directory on a server with the above commands installed and available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.png -exec optipng -o7 {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.gif -exec gifsicle -O2 -b {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.jpg -exec jpegoptim -p {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both [http://optipng.sourceforge.net/ optipng] and [http://www.lcdf.org/gifsicle/ gifsicle] are provided in the base repositories of most newer Linux distributions; [http://www.kokkonen.net/tjko/projects.html jpegoptim] must be downloaded and installed manually.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle: [http://moodle.org/mod/forum/view.php?f=94 Hardware and Performance] forum&lt;br /&gt;
*[http://opensourceelearning.blogspot.be/2012/10/why-your-moodle-site-is-slow-five.html Why Your Moodle Site is Slow: Five Simple Settings] blog post from Jonathan Moore &lt;br /&gt;
*I teach with Moodle perfomance testing: http://www.iteachwithmoodle.com/2012/11/17/moodle-2-4-beta-performance-test-comparison-with-moodle-2-3/&lt;br /&gt;
*[http://jfilip.ca/2013/08/20/moodle-2-4-5-vs-2-5-1-performance-and-muc-apc-cache-store/ Moodle 2.4.5 vs 2.5.2 performance and MUC APC cahe store]&lt;br /&gt;
*[http://jfilip.ca/2013/09/25/moodle-performance-testing-2-4-6-vs-2-5-2-vs-2-6dev/ Moodle performance testing 2.4.6 vs 2.5.2 vs 2.6dev]&lt;br /&gt;
*[http://jfilip.ca/2013/09/24/moodle-performance-analysis-revisted-now-with-mariadb/ Moodle performance analysis revisited (now with MariaDB)]&lt;br /&gt;
*[http://tjhunt.blogspot.ca/2013/05/performance-testing-moodle.html Tim Hunt&#039;s blog (May 2, 2013) on performance testing Moodle]&lt;br /&gt;
*[http://newrelic.com/ New Relic, Application Performance Monitoring]&lt;br /&gt;
&lt;br /&gt;
There have been a lot of discussions on moodle.org about performance, here are some of the more interesting and (potentially) useful ones:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=83057 Performance woes!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88927 Comments on planned server hardware]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102978#p461624 Moodle performance in a pil by Martin Langhoff]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=240391#unread Advice on optimising php/db code in moodle2+]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=243531 Moodle 2.5 performance testing at the OU]&lt;br /&gt;
&lt;br /&gt;
[[es:Recomendaciones sobre desempeño]]&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;br /&gt;
[[de:Geschwindigkeitsempfehlungen]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=108103</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=108103"/>
		<updated>2013-12-01T09:16:22Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Create the (moodledata) data directory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]). These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (also sometimes known as the LAMP platform). If in doubt, this is the safest combination (if for no other reason than being the most common). There are other options - see the Software section that follows:&lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 160MB free (min) plus as much as you need to store your materials. 5GB is probably a realistic minimum. &lt;br /&gt;
* Backups: at least the same again (at a remote location preferably) as above to keep backups of your site&lt;br /&gt;
* Memory: 256MB (min), 1GB or more is strongly recommended. The general rule of thumb is that Moodle can support 10 to 20 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination and the type of use. &#039;Concurrent&#039; really means web server processes in memory at the same time (i.e. users interacting with the system within a window of a few seconds). It does NOT mean people &#039;logged in&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
* An operating system (!). Anything that runs the following software; although the choice will most likely depend on the performance you need and the skills you have available. Linux and Windows are the most common choices (and good support is available). If you have a free choice, Linux is generally regarded to be the optimal platform. Moodle is regularly tested with Debian, Ubuntu, CentOS, RedHat, Windows 7/2012 and Mac OS X.&lt;br /&gt;
* Web server, primarily [[Apache]]. Not fully tested (or supported) but should work are [[IIS]], [http://www.lighttpd.net/ lightttpd], [http://nginx.org/ nginx], [http://www.cherokee-project.com/ cherokee], zeus and [http://litespeedtech.com/ LiteSpeed]. Moodle will refuse to install on any other web server. Your web server needs to be correctly configured to serve PHP files.The version is not critical but try to use the newest web server build available to you. &lt;br /&gt;
* [[PHP]] - The minimum version is currently 5.3.3. A number of extensions are required; see the [[PHP]] page for full details. Installation will halt at the environment check if any of the required extensions are missing. If available, PHP 5.5 and newer contain [[OPcache]] which is recommended (you can ignore the environment check for this if not available).&lt;br /&gt;
* A database. MySQL and PostgreSQL are the primary development database, the most comprehensively tested and have extensive documentation and support. MSSQL is fully supported (note that optional plugins may be untested with these databases) but documentation and online help are not as comprehensive as MySQL/PostgreSQL. Oracle database is not fully supported and is not recommended. If in doubt use MySQL (more documentation) or PostgreSQL (better stability/performance). You will need the appropriate PHP extension (configured if need be) for your chosen database.&lt;br /&gt;
** [[MySQL]] - minimum version 5.1.33&lt;br /&gt;
** [[MariaDB]] - minimum version 5.3.5 (drop-in replacement for Oracle&#039;s MySQL)&lt;br /&gt;
** [[PostgreSQL]] - minimum version 8.3&lt;br /&gt;
** [[MSSQL]] - minimum version 9.0&lt;br /&gt;
** [[Oracle]] - minimum version 10.2 (not recommended)&lt;br /&gt;
* Minimum browser for accessing Moodle: recent Firefox, Internet Explorer 9, Safari 6, recent Google Chrome 11 (lower versions may work but are not fully supported)&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
...or desktop computer, if you are just evaluating Moodle. There are lots of possibilities for installing the basic server software depending on your particular choices. Some links and pointers are at [[Installing AMP]]&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted server all this should be done for you. However, (especially on shared hosting) make sure you understand or find out how to change PHP settings (e.g. file upload maximums). This can vary a huge amount from host to host.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone -b MOODLE_26_STABLE git://git.moodle.org/moodle.git &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
...this fetches a complete copy of the Moodle repository and then switches to the 2.6 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in add-on installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]]&lt;br /&gt;
* [[MySQL]]&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions. &lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Settings&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date.&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* If you are having trouble creating a [[Configuration file]] (config.php), you can do it manually by copying config-dist.php (in the root of the Moodle program directory) to config.php, editing it and setting your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=108102</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=108102"/>
		<updated>2013-12-01T09:15:24Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Create the (moodledata) data directory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]). These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (also sometimes known as the LAMP platform). If in doubt, this is the safest combination (if for no other reason than being the most common). There are other options - see the Software section that follows:&lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 160MB free (min) plus as much as you need to store your materials. 5GB is probably a realistic minimum. &lt;br /&gt;
* Backups: at least the same again (at a remote location preferably) as above to keep backups of your site&lt;br /&gt;
* Memory: 256MB (min), 1GB or more is strongly recommended. The general rule of thumb is that Moodle can support 10 to 20 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination and the type of use. &#039;Concurrent&#039; really means web server processes in memory at the same time (i.e. users interacting with the system within a window of a few seconds). It does NOT mean people &#039;logged in&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
* An operating system (!). Anything that runs the following software; although the choice will most likely depend on the performance you need and the skills you have available. Linux and Windows are the most common choices (and good support is available). If you have a free choice, Linux is generally regarded to be the optimal platform. Moodle is regularly tested with Debian, Ubuntu, CentOS, RedHat, Windows 7/2012 and Mac OS X.&lt;br /&gt;
* Web server, primarily [[Apache]]. Not fully tested (or supported) but should work are [[IIS]], [http://www.lighttpd.net/ lightttpd], [http://nginx.org/ nginx], [http://www.cherokee-project.com/ cherokee], zeus and [http://litespeedtech.com/ LiteSpeed]. Moodle will refuse to install on any other web server. Your web server needs to be correctly configured to serve PHP files.The version is not critical but try to use the newest web server build available to you. &lt;br /&gt;
* [[PHP]] - The minimum version is currently 5.3.3. A number of extensions are required; see the [[PHP]] page for full details. Installation will halt at the environment check if any of the required extensions are missing. If available, PHP 5.5 and newer contain [[OPcache]] which is recommended (you can ignore the environment check for this if not available).&lt;br /&gt;
* A database. MySQL and PostgreSQL are the primary development database, the most comprehensively tested and have extensive documentation and support. MSSQL is fully supported (note that optional plugins may be untested with these databases) but documentation and online help are not as comprehensive as MySQL/PostgreSQL. Oracle database is not fully supported and is not recommended. If in doubt use MySQL (more documentation) or PostgreSQL (better stability/performance). You will need the appropriate PHP extension (configured if need be) for your chosen database.&lt;br /&gt;
** [[MySQL]] - minimum version 5.1.33&lt;br /&gt;
** [[MariaDB]] - minimum version 5.3.5 (drop-in replacement for Oracle&#039;s MySQL)&lt;br /&gt;
** [[PostgreSQL]] - minimum version 8.3&lt;br /&gt;
** [[MSSQL]] - minimum version 9.0&lt;br /&gt;
** [[Oracle]] - minimum version 10.2 (not recommended)&lt;br /&gt;
* Minimum browser for accessing Moodle: recent Firefox, Internet Explorer 9, Safari 6, recent Google Chrome 11 (lower versions may work but are not fully supported)&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
...or desktop computer, if you are just evaluating Moodle. There are lots of possibilities for installing the basic server software depending on your particular choices. Some links and pointers are at [[Installing AMP]]&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted server all this should be done for you. However, (especially on shared hosting) make sure you understand or find out how to change PHP settings (e.g. file upload maximums). This can vary a huge amount from host to host.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone -b MOODLE_26_STABLE git://git.moodle.org/moodle.git &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
...this fetches a complete copy of the Moodle repository and then switches to the 2.6 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in add-on installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]]&lt;br /&gt;
* [[MySQL]]&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions. &lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Settings&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date.&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* If you are having trouble creating a [[Configuration file]] (config.php), you can do it manually by copying config-dist.php (in the root of the Moodle program directory) to config.php, editing it and setting your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Performance_recommendations&amp;diff=108101</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Performance_recommendations&amp;diff=108101"/>
		<updated>2013-12-01T09:12:15Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: Note about caching in performance&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
Moodle can be made to perform very well, at small usage levels or scaling up to many thousands of users. The factors involved in performance are basically the same as for any PHP-based database-driven system. When trying to optimize your server, try to focus on the factor which will make the most difference to the user. For example, if you have relatively more users browsing than accessing the database, look to improve the webserver performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Obtain a baseline benchmark==&lt;br /&gt;
&lt;br /&gt;
Before attempting any optimization, you should obtain a baseline benchmark of the component of the system you are trying to improve. For Linux try [http://lbs.sourceforge.net/ LBS] and for Windows use the Performance Monitor. Once you have quantitative data about how your system is performing currently, you&#039;ll be able to determine if the change you have made has had any real impact.&lt;br /&gt;
&lt;br /&gt;
The overall aim of adjustments to improve performance is to use RAM (cacheing) and to reduce disk-based activity. It is especially important to try to eliminate swap file usage as much as you can. If your system starts swapping, this is a sign that you need more RAM. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;optimization order preference&#039;&#039;&#039; is usually: primary storage (more RAM), secondary storage (faster hard disks/improved hard disk configuration), processor (more and faster).&lt;br /&gt;
&lt;br /&gt;
==Scalability==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s design (with clear separation of application layers) allows for strongly scalable setups. (Please check the list of [[Large installations|large Moodle installations]].)&lt;br /&gt;
&lt;br /&gt;
Large sites usually separate the web server and database onto separate servers, although for smaller installations this is typically not necessary.&lt;br /&gt;
&lt;br /&gt;
It is possible to load-balance a Moodle installation, for example by using more than one webserver. The separate webservers should query the same database and refer to the same filestore area, but otherwise the separation of the application layers is complete enough to make this kind of clustering feasible. Similarly, the database could be a cluster of servers (e.g. a MySQL cluster), but this is not an easy task and you should seek expert support, e.g. from a Moodle Partner.&lt;br /&gt;
&lt;br /&gt;
===Server cluster===&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88214 Installation for 3000 simultaneous users]&lt;br /&gt;
&lt;br /&gt;
==Hardware configuration==&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The fastest and most effective change that you can make to improve performance is to &#039;&#039;&#039;increase the amount of RAM on your web server&#039;&#039;&#039; - get as much as possible (e.g. 4GB or more). Increasing primary memory will reduce the need for processes to swap to disk and will enable your server to handle more users.&lt;br /&gt;
* Better performance is gained by obtaining the best &#039;&#039;&#039;processor capability&#039;&#039;&#039; you can, i.e. dual or dual core processors. A modern BIOS should allow you to enable hyperthreading, but check if this makes a difference to the overall performance of the processors by using a [http://en.wikipedia.org/wiki/Super_PI CPU benchmarking tool].&lt;br /&gt;
* If you can afford them, use &#039;&#039;&#039;SCSI hard disks&#039;&#039;&#039; instead of SATA drives. SATA drives will increase your system&#039;s CPU utilization, whereas SCSI drives have their own integrated processors and come into their own when you have multiple drives. If you must have SATA drives, check that your motherboard and the drives themselves support NCQ (Native Command Queuing).&lt;br /&gt;
* Purchase hard disks with a &#039;&#039;&#039;low seek time&#039;&#039;&#039;. This will improve the overall speed of your system, especially when accessing Moodle&#039;s reports.&lt;br /&gt;
* Size your &#039;&#039;&#039;swap file&#039;&#039;&#039; correctly. The general advice is to set it to 4 x physical RAM.&lt;br /&gt;
* Use a &#039;&#039;&#039;RAID disk system&#039;&#039;&#039;. Although there are many different RAID configurations you can create, the following generally works best:&lt;br /&gt;
** install a hardware RAID controller (if you can)&lt;br /&gt;
** the operating system and swap drive on one set of disks configured as RAID-1.&lt;br /&gt;
** Moodle, Web server and Database server on another set of disks configured as RAID-5.&lt;br /&gt;
* If your &#039;moodledata&#039; area is going to be on relatively slow storage (e.g. NFS, SAN) you will probably have performance issues with the default cache configuration (which writes to this storage). See the page on [[Caching]] and consider an alternative. &lt;br /&gt;
* Use &#039;&#039;&#039;gigabit ethernet&#039;&#039;&#039; for improved latency and throughput. This is especially important when you have your webserver and database server separated out on different hosts.&lt;br /&gt;
* Check the settings on your &#039;&#039;&#039;network card&#039;&#039;&#039;. You may get an improvement in performance by increasing the use of buffers and transmit/receive descriptors (balance this with processor and memory overheads) and off-loading TCP checksum calculation onto the card instead of the OS.&lt;br /&gt;
*  Read this [http://moodle.org/mod/forum/discuss.php?d=68579 Case Study] on a server stress test with 300 users.  &lt;br /&gt;
* See this [http://elearning.sgu.ac.jp/doc/PT/ accompanying report] on network traffic and server loads.&lt;br /&gt;
* See the [[Moodle.org configuration]]&lt;br /&gt;
* Also see this SFSU presentation at Educause (using VMWare): [http://www.educause.edu/Resources/AnOpenSourceLMSforaMissionCrit/162843]&lt;br /&gt;
&lt;br /&gt;
==Operating System==&lt;br /&gt;
* You can use [http://en.wikipedia.org/wiki/Linux Linux](recommended), Unix-based, Windows or Mac OS X for the server &#039;&#039;&#039;operating system&#039;&#039;&#039;. *nix operating systems generally require less memory than Mac OS X or Windows servers for doing the same task as the server is configured with just a shell interface. Additionally Linux does not have licensing fees attached, but can have a big learning curve if you&#039;re used to another operating system. If you have a large number of processors running SMP, you may also want to consider using a highly tuned OS such as [http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris].&lt;br /&gt;
* Check your own OS and &#039;&#039;&#039;vendor specific instructions&#039;&#039;&#039; for optimization steps.&lt;br /&gt;
** For Linux look at the [http://linuxperf.sourceforge.net/ Linux Performance Team] site. &lt;br /&gt;
** For Linux investigate the hdparm command, e.g. hdparm -m16 -d1 can be used to enable read/write on multiple sectors and DMA. Mount disks with the async and noatime options.&lt;br /&gt;
** For Windows set the sever to be optimized for network applications (Control Panel, Network Connections, LAN connection, Properties, File &amp;amp; Printer Sharing for Microsoft Networks, Properties, Optimization). You can also search the [http://technet.microsoft.com/ Microsoft TechNet site] for optimization documents.&lt;br /&gt;
&lt;br /&gt;
==Web server performance==&lt;br /&gt;
&lt;br /&gt;
Installing [http://www.mozilla.com/en-US/ Firefox] and the [https://addons.mozilla.org/en-US/firefox/addon/1843 firebug] extension will allow you to watch the time it takes for each page component to load. Also, the [https://addons.mozilla.org/en-US/firefox/addon/5369 Yslow] extension will evaluate your page against Yahoo&#039;s [http://www.skrenta.com/2007/05/14_rules_for_fast_web_pages_by_1.html 14 rules], full text [http://developer.yahoo.com/performance/rules.html Best Practices for Speeding Up Your Web Site], &amp;lt;strike&amp;gt;([http://video.yahoo.com/video/play?vid=1040890 video])&amp;lt;/strike&amp;gt; for fast loading websites.&lt;br /&gt;
&lt;br /&gt;
===PHP performance===&lt;br /&gt;
* You are strongly recommended to use a &#039;&#039;&#039;PHP accelerator&#039;&#039;&#039; to ease CPU load, such as [http://pecl.php.net/apc APC], [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache], [http://sourceforge.net/projects/wincache WinCache] or [http://eaccelerator.net/ eAccelerator]. (Take care to choose a PHP accelerator that is known to work well with your version of PHP and note that Turck MMCache is [http://turckmmcache.exeprod.com/TheManifestoEnglish no longer maintained] and can cause failures with PHP 5). &lt;br /&gt;
* Improvements in read/write performance can be improved by putting the cached PHP pages on a [[TMPFS]] filesystem - but remember that you&#039;ll lose the cache contents when there is a power failure or the server is rebooted.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS6 ISAPI module&#039;&#039;&#039; (rather than a CGI). IIS 7.0/7.5 (Windows Server 2008/R2) users should choose a FastCGI installation for best performance.&lt;br /&gt;
* Also check the &#039;&#039;&#039;memory_limit&#039;&#039;&#039; in php.ini, reduce it to 16M for Moodle version earlier than 1.7 ([http://moodle.org/mod/forum/discuss.php?d=39656 See this forum discussion]). For Moodle 1.7 or later, it is recommended that the value of memory_limit should be 40M. As of [http://www.php.net/ChangeLog-5.php PHP 5.2.1] the default value for the memory_limit directive is 128M.&lt;br /&gt;
* Also see [[PHP_settings_by_Moodle_version]]&lt;br /&gt;
&lt;br /&gt;
===Install HowTo===&lt;br /&gt;
* [http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html APC on CentOS 5.x (linux)]&lt;br /&gt;
* [http://fplanque.com/dev/linux/install-apc-php-cache-debian-lenny APC on Debian (linux)]&lt;br /&gt;
* [http://www.linuxtuts.net/211-installing-memcached-php5-memcache-module-debian-apache2.html MemCache module on Debian (Apache2 and PHP5) ]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/03/installing-memcached-on-centos-5x.html Installing Memcache on CentOS 5.x (linux)]&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/02/installing-eaccelerator-cache-for-php.html Installing eAccelerator on CentOS 5.x (linux)]&lt;br /&gt;
* [https://docs.moodle.org/en/Installing_eAccelerator_In_Ubuntu_Server/ Installing eAccelerator on Ubuntu Server (linux)]&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&lt;br /&gt;
* If you are using Apache on a Windows server, use the build from [http://www.apachelounge.com Apache Lounge] which is reported to have [http://moodle.org/mod/forum/discuss.php?d=93358 performance and stability improvements] compared to the official Apache download. Note that this is an unofficial build, so may not keep up with official releases.&lt;br /&gt;
* Set the &#039;&#039;&#039;MaxClients&#039;&#039;&#039; directive correctly. Use this formula to help (which uses 80% of available memory to leave room for spare):&lt;br /&gt;
 MaxClients = Total available memory * 80% / Max memory usage of apache process&lt;br /&gt;
:Memory usage of apache process is usually 10MB but Moodle can easily use up to 100MB per process, so a general rule of thumb is to divide your available memory in megabytes by 100 to get a conservative setting for MaxClients. You are quite likely to find yourself lowering the MaxClients from its default of 150 on a Moodle server. To get a more accurate estimate read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&lt;br /&gt;
&lt;br /&gt;
:If you need to increase the value of &#039;&#039;&#039;MaxClients&#039;&#039;&#039; beyond 256, you will also need to set the &#039;&#039;&#039;ServerLimit&#039;&#039;&#039; directive. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: Do not be tempted to set the value of MaxClients higher than your available memory as your server will consume more RAM than available and start to swap to disk. &lt;br /&gt;
* Consider reducing the &#039;&#039;&#039;number of modules&#039;&#039;&#039; that Apache loads in the httpd.conf file to the minumum necessary to reduce the memory needed. &lt;br /&gt;
* Use the &#039;&#039;&#039;latest version of Apache&#039;&#039;&#039; - Apache 2 has an improved memory model which reduces memory usage further.&lt;br /&gt;
* For Unix/Linux systems, consider lowering &#039;&#039;&#039;MaxRequestsPerChild&#039;&#039;&#039; in httpd.conf to as low as 20-30 (if you set it any lower the overhead of forking begins to outweigh the benefits). &lt;br /&gt;
* For a heavily loaded server, consider setting &#039;&#039;&#039;KeepAlive Off&#039;&#039;&#039; (do this only if your Moodle pages do not contain links to resources or uploaded images) or lowering the &#039;&#039;&#039;KeepAliveTimeout&#039;&#039;&#039; to between 2 and 5. The default is 15 (seconds) - the higher the value the more server processes will be kept waiting for possibly idle connections. A more accurate value for KeepAliveTimeout is obtained by observing how long it takes your users to download a page. After altering any of the KeepAlive variables, monitor your CPU utilization as there may be an additional overhead in initiating more worker processes/threads.&lt;br /&gt;
* As an alternative to using KeepAlive Off, consider setting-up a &#039;&#039;&#039;Reverse Proxy server&#039;&#039;&#039; infront of the Moodle server to cache HTML files with images. You can then return Apache to using keep-alives on the Moodle server.&lt;br /&gt;
* If you do not use a .htaccess file, set the &#039;&#039;&#039;AllowOverride&#039;&#039;&#039; variable to AllowOverride None to prevent .htaccess lookups.&lt;br /&gt;
* Set &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; correctly so as to avoid content-negotiation. Here&#039;s an example from a production server:&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
* Unless you are doing development work on the server, set &#039;&#039;&#039;ExtendedStatus Off&#039;&#039;&#039; and disable mod_info as well as mod_status.&lt;br /&gt;
* Leave &#039;&#039;&#039;HostnameLookups Off&#039;&#039;&#039; (as default) to reduce DNS latency.&lt;br /&gt;
* Consider reducing the value of &#039;&#039;&#039;TimeOut&#039;&#039;&#039; to between 30 to 60 (seconds). &lt;br /&gt;
* For the &#039;&#039;&#039;Options directive&#039;&#039;&#039;, avoid Options Multiviews as this performs a directory scan. To reduce disk I/O further use&lt;br /&gt;
 Options -Indexes FollowSymLinks&lt;br /&gt;
&lt;br /&gt;
* Compression reduces response times by reducing the size of the HTTP response&lt;br /&gt;
# Install and enable mod_deflate - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;ifModule mod_deflate.c&amp;gt;&lt;br /&gt;
   AddOutputFilterByType DEFLATE text/html text/plain text/xml text/x-js text/javascript text/css application/javascript&lt;br /&gt;
 &amp;lt;/ifmodule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IIS performance===&lt;br /&gt;
All alter this location in the registry:&lt;br /&gt;
 HKLM\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters\&lt;br /&gt;
* The equivalent to KeepAliveTimeout is &#039;&#039;&#039;ListenBackLog&#039;&#039;&#039; (IIS - registry location is HKLM\ SYSTEM\ CurrentControlSet\ Services\ Inetinfo\ Parameters). Set this to between 2 to 5.&lt;br /&gt;
*Change the &#039;&#039;&#039;MemCacheSize&#039;&#039;&#039; value to adjust the amount of memory (Mb) that IIS will use for its file cache (50% of available memory by default).&lt;br /&gt;
*Change the &#039;&#039;&#039;MaxCachedFileSize&#039;&#039;&#039; to adjust the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).&lt;br /&gt;
*Create a new DWORD called &#039;&#039;&#039;ObjectCacheTTL&#039;&#039;&#039; to change the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).&lt;br /&gt;
&lt;br /&gt;
===Lighttpd, NginX and Cherokee performance===&lt;br /&gt;
You can increase server performance by using a &#039;&#039;&#039;light-weight&#039;&#039;&#039; webserver like [http://www.lighttpd.net/ lighttpd],  [http://nginx.net/ nginx] or [http://www.cherokee-project.com/ cherokee] in combination with PHP in FastCGI-mode. Lighttpd was originally created as a proof-of-concept[http://www.lighttpd.net/story] to address the [http://www.kegel.com/c10k.html C10k problem] and while primarily recommended for memory-limited servers, its design origins and asynchronous-IO model make it a suitable and proven[http://blog.lighttpd.net/articles/2006/12/28/lighttpd-powers-5-alexa-top-250-sites] alternative HTTP server for high-load websites and web apps, including Moodle. See the [[lighttpd | MoodleDocs Lighttpd page]] for additional information, configuration example and links.&lt;br /&gt;
&lt;br /&gt;
Alternatively, both [http://www.lighttpd.net/ lighttpd] and [http://nginx.net/ nginx] are capable of performing as a load-balancer and/or reverse-proxy to alleviate load on back-end servers[http://www.linuxjournal.com/article/10108], providing benefit without requiring an actual software change on existing servers.&lt;br /&gt;
&lt;br /&gt;
Do note that these are likely to be the least tested server environments of all particularly if you are using advanced features such as web services and/or Moodle Networking. They are probably best considered for heavily used Moodle sites with relatively simple configurations.&lt;br /&gt;
&lt;br /&gt;
===X-Sendfile===&lt;br /&gt;
&lt;br /&gt;
X-Sendfile modules improve performance when sending large files from Moodle. It is recommended to configure your web server and Moodle to use this feature of available.&lt;br /&gt;
&lt;br /&gt;
Configure web server:&lt;br /&gt;
* Apache - https://tn123.org/mod_xsendfile/&lt;br /&gt;
* Lighttpd - http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file&lt;br /&gt;
* Nginx - http://wiki.nginx.org/XSendfile&lt;br /&gt;
&lt;br /&gt;
Enable support in config.php (see config-dist.php):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Sendfile&#039;;           // Apache {@see https://tn123.org/mod_xsendfile/}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-LIGHTTPD-send-file&#039;; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;     // Nginx {@see http://wiki.nginx.org/XSendfile}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure file location prefixes if your server implementation requires it:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
//         &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot,&lt;br /&gt;
//         &#039;/cachedir/&#039; =&amp;gt; &#039;/var/www/moodle/cache&#039;,    // for custom $CFG-&amp;gt;cachedir locations&lt;br /&gt;
//         &#039;/localcachedir/&#039; =&amp;gt; &#039;/var/local/cache&#039;,    // for custom $CFG-&amp;gt;localcachedir locations&lt;br /&gt;
//         &#039;/tempdir/&#039;  =&amp;gt; &#039;/var/www/moodle/temp&#039;,     // for custom $CFG-&amp;gt;tempdir locations&lt;br /&gt;
//         &#039;/filedir&#039;   =&amp;gt; &#039;/var/www/moodle/filedir&#039;,  // for custom $CFG-&amp;gt;filedir locations&lt;br /&gt;
//     );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
===MySQL performance===&lt;br /&gt;
&lt;br /&gt;
The following are MySQL specific settings which can be adjusted for better performance in your my.cnf (my.ini in Windows). The file contains a list of settings and their values. To see the current values use these commands&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
 SHOW VARIABLES; &lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: You must make backups of your database before attempting to change any MySQL server configuration. After any change to the my.cnf, restart mysqld.&lt;br /&gt;
&lt;br /&gt;
If you are able, the [http://mysqltuner.com/ MySQLTuner] tool can be run against your MySQL server and will calculate appropriate configuration values for most of the following settings based on your current load, status and variables automatically.&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with &lt;br /&gt;
 query_cache_type = 1. &lt;br /&gt;
For most Moodle installs, set the following:&lt;br /&gt;
 query_cache_size = 36M &lt;br /&gt;
 query_cache_min_res_unit = 2K. &lt;br /&gt;
The query cache will improve performance if you are doing few updates on the database. &lt;br /&gt;
* Set the &#039;&#039;&#039;table cache&#039;&#039;&#039; correctly. For Moodle 1.6 set &lt;br /&gt;
 table_cache = 256 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min), and for Moodle 1.7 set &lt;br /&gt;
 table_cache = 512 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min). The table cache is used by all threads (connections), so monitor the value of opened_tables to further adjust - if opened_tables &amp;gt; 3 * table_cache(table_open_cache in MySQL &amp;gt; 5.1.2) then increase table_cache upto your OS limit. Note also that the figure for table_cache will also change depending on the number of modules and plugins you have installed. Find the number for your server by executing the mysql statement below. Look at the number returned and set table_cache to this value.&lt;br /&gt;
 mysql&amp;gt;SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema=&#039;yourmoodledbname&#039;;&lt;br /&gt;
* Set the &#039;&#039;&#039;thread cache&#039;&#039;&#039; correctly. Adjust the value so that your thread cache utilization is as close to 100% as possible by this formula:&lt;br /&gt;
 thread cache utilization (%) = (threads_created / connections) * 100&lt;br /&gt;
* The &#039;&#039;&#039;key buffer&#039;&#039;&#039; can improve the access speed to Moodle&#039;s SELECT queries. The correct size depends on the size of the index files (.myi) and in Moodle 1.6 or later (without any additional modules and plugins), the recommendation for this value is key_buffer_size = 32M. Ideally you want the database to be reading once from the disk for every 100 requests so monitor that the value is suitable for your install by adjusting the value of key_buffer_size so that the following formulas are true:&lt;br /&gt;
 key_read / key_read_requests &amp;lt; 0.01&lt;br /&gt;
 key_write / key_write_requests &amp;lt;= 1.0&lt;br /&gt;
* Set the &#039;&#039;&#039;maximum number of connections&#039;&#039;&#039; so that your users will not see a &amp;quot;Too many connections&amp;quot; message. Be careful that this may have an impact on the total memory used. MySQL connections usually last for milliseconds, so it is unusual even for a heavily loaded server for this value to be over 200.&lt;br /&gt;
* Manage &#039;&#039;&#039;high burst activity&#039;&#039;&#039;. If your Moodle install uses a lot of quizzes and you are experiencing performance problems (check by monitoring the value of threads_connected - it should not be rising) consider increasing the value of back_log.&lt;br /&gt;
* &#039;&#039;&#039;Optimize your tables weekly and after upgrading Moodle&#039;&#039;&#039;. It is good practice to also optimize your tables after performing a large data deletion exercise, e.g. at the end of your semester or academic year. This will ensure that index files are up to date. Backup your database first and then use:&lt;br /&gt;
 mysql&amp;gt;CHECK TABLE mdl_tablename;&lt;br /&gt;
 mysql&amp;gt;OPTIMIZE TABLE mdl_tablename;&lt;br /&gt;
:The common tables in Moodle to check are mdl_course_sections, mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any errors need to be corrected using REPAIR TABLE (see the [http://dev.mysql.com/doc/refman/5.0/en/repair-table.html MySQL manual] and this [http://moodle.org/mod/forum/discuss.php?d=58208#p279638 forum script]).&lt;br /&gt;
* &#039;&#039;&#039;Maintain the key distribution&#039;&#039;&#039;. Every month or so it is a good idea to stop the mysql server and run these myisamchk commands.&lt;br /&gt;
 #myisamchk -a -S /pathtomysql/data/moodledir/*.MYI&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.&lt;br /&gt;
* Reduce the number of &#039;&#039;&#039;temporary tables saved to disk&#039;&#039;&#039;. Check this with the created_tmp_disk_tables value. If this is relatively large (&amp;gt;5%) increase tmp_table_size until you see a reduction. Note that this will have an impact on RAM usage.&lt;br /&gt;
&lt;br /&gt;
===PostgreSQL performance===&lt;br /&gt;
&lt;br /&gt;
There are some good papers around on tuning PostgreSQL (like [http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server this one]), and Moodle&#039;s case does not seem to be different to the general case.&lt;br /&gt;
&lt;br /&gt;
The first thing to recognise is that if you really need to worry about tuning you should be using a separate machine for the database server. If you are not using a separate machine then the answers to many performance questions are substantially muddied by the memory requirements of the rest of the application.&lt;br /&gt;
&lt;br /&gt;
You should probably &#039;&#039;&#039;enable autovacuum&#039;&#039;&#039;, unless you know what you are doing. Many e-learning sites have predictable periods of low use, so disabling autovacuum and running a specific vacuum at those times can be a good option. Or perhaps leave autovacuum running but do a full vacuum weekly in a quiet period.&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;shared_buffers&#039;&#039;&#039; to something reasonable. For versions up to 8.1 my testing has shown that peak performance is almost always obtained with buffers &amp;lt; 10000, so if you are using such a version, and have more than 512M of RAM just set shared_buffers to 10,000 (8MB).&lt;br /&gt;
&lt;br /&gt;
The buffer management had a big overhaul in 8.2 and &amp;quot;reasonable&amp;quot; is now a much larger number. I have not conducted performance tests with 8.2, but the recommendations from others are generally that you should now scale shared_buffers much more with memory and may continue to reap benefits even up to values like 100,000 (80MB). Consider using 1-2% of system RAM.&lt;br /&gt;
&lt;br /&gt;
PostgreSQL will also assume that the operating system is caching its files, so setting &#039;&#039;&#039;effective_cache_size&#039;&#039;&#039; to a reasonable value is also a good idea. A reasonable value will usually be (total RAM - RAM in use by programs). If you are running Linux and leave the system running for a day or two you can look at &#039;free&#039; and under the &#039;cached&#039; column you will see what it currently is. Consider taking that number (which is kB) and dividing it by 10 (i.e. allow 20% for other programs cache needs and then divide by 8 to get pages). If you are not using a dedicated database server you will need to decrease that value to account for usage by other programs.&lt;br /&gt;
&lt;br /&gt;
Some other useful parameters that can have positive effects, and the values I would typically set them to on a machine with 4G RAM, are:&lt;br /&gt;
&lt;br /&gt;
 work_mem = 10240&lt;br /&gt;
&lt;br /&gt;
That&#039;s 10M of RAM to use instead of on-disk sorting and so forth. That can give a big speed increase, but it is per connection and 200 connections * 10M is 2G, so it can theoretically chew up a lot of RAM.&lt;br /&gt;
&lt;br /&gt;
 maintenance_work_mem = 163840&lt;br /&gt;
&lt;br /&gt;
That&#039;s 160M of RAM which will be used by (e.g.) VACUUM, index rebuild, cluster and so forth. This should only be used periodically and should be freed when those processes exit, so I believe it is well worth while.&lt;br /&gt;
&lt;br /&gt;
 max_fsm_pages = 100000&lt;br /&gt;
 max_fsm_relations = 5000&lt;br /&gt;
&lt;br /&gt;
These are used to hold the free-space map, and if they are too small you will see performance degradation after the database has been operating for some time. The exact numbers to set can be gleaned from the output of VACUUM VERBOSE, which prints the required FSM pages at the end of it&#039;s run. The 5x increase seems to be useful for a Moodle installation, from experience.&lt;br /&gt;
&lt;br /&gt;
 wal_buffers = 64&lt;br /&gt;
&lt;br /&gt;
These buffers are used for the write-ahead log, and there have been a number of reports on the PostgreSQL mailing lists of improvement from this level of increase.&lt;br /&gt;
&lt;br /&gt;
This is a little out of date now (version 8.0) but still worth a read: http://www.powerpostgresql.com/Docs&lt;br /&gt;
&lt;br /&gt;
And there is lots of good stuff here as well: http://www.varlena.com/GeneralBits/Tidbits/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Based on Andrew McMillan&#039;s post at [http://moodle.org/mod/forum/discuss.php?d=68558 Tuning PostgreSQL] forum thread.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Other database performance links===&lt;br /&gt;
* Consider using a &#039;&#039;&#039;distributed cacheing system&#039;&#039;&#039; like [http://en.wikipedia.org/wiki/Memcached memcached] but note that memcached does not have any security features so it should be used behind a firewall.&lt;br /&gt;
* Consider using PostgreSQL. See [[Arguments in favour of PostgreSQL]] and [http://moodle.org/mod/forum/discuss.php?d=49195 how to migrate from MySQL to PostgreSQL] (forum discussion).&lt;br /&gt;
* [http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html General advice on tuning MySQL parameters] (advice from the MySQL manual)&lt;br /&gt;
* [http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ InnoDB performance optimization] taken from the [http://www.mysqlperformanceblog.com/ MySQL performance blog] site.&lt;br /&gt;
&lt;br /&gt;
==Performance of different Moodle modules==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s activity modules, filters, and other plugins can be activated/deactivated. If necessary, you may wish to deactivate some features (such as chat) if not required - but this isn&#039;t necessary. Some notes on the performance of certain modules:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Chat&#039;&#039;&#039; module is [http://moodle.org/mod/forum/discuss.php?d=37979&amp;amp;parent=175079 said] to be a hog in terms of frequent HTTP requests to the main server. This can be reduced by setting the module to use &#039;&#039;Streamed&#039;&#039; updates, or, if you&#039;re using a Unix-based webserver, by running the chat in daemon mode. When using the Chat module use the configuration settings to tune for your expected load. Pay particular attention to the &#039;&#039;chat_old_ping&#039;&#039; and &#039;&#039;chat_refresh&#039;&#039; parameters as these can have greatest impact on server load.&lt;br /&gt;
* The &#039;&#039;&#039;Quiz&#039;&#039;&#039; module is known to stretch database performance. However, it has been getting better in recent versions, and we don&#039;t know of any good, up-to-date performance measurements. (Here is a [http://moodle.org/mod/forum/discuss.php?d=68579 case study from 2007 with 300 quiz users].)&lt;br /&gt;
* The Moodle &#039;&#039;&#039;Cron&#039;&#039;&#039; task is triggered by calling the script &#039;&#039;cron.php&#039;&#039;. If this is called over HTTP (e.g. using wget or curl) it can take a large amount of memory on large installations. If it is called by directly invoking the php command (e.g. &#039;&#039;php -f /path/to/moodle/directory/admin/cli/cron.php&#039;&#039;) efficiency can be much improved.&lt;br /&gt;
* The &#039;&#039;&#039;Recent activities&#039;&#039;&#039; block is consuming too many resources if you have huge number of records &amp;lt;code&amp;gt;mdl_log&amp;lt;/code&amp;gt;. This is being tested to optimize the SQL query.&lt;br /&gt;
&lt;br /&gt;
==Moodle Image Optimization==&lt;br /&gt;
&lt;br /&gt;
The base images delivered in the original Moodle distribution package provide unoptimized graphics, most of which can benefit from lossless recompression utilizing [http://optipng.sourceforge.net/ optipng] for PNGs, [http://www.lcdf.org/gifsicle/ gifsicle] for GIFs and [http://www.kokkonen.net/tjko/projects.html jpegoptim] for JPGs.  Optimized graphics transfer faster and provide a faster perceived response for clients[http://www.websiteoptimization.com/speed/12/], especially distance learners.  The following example will recursively optimize (without any loss of quality) all the graphics and image files included in a base Moodle installation directory on a server with the above commands installed and available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.png -exec optipng -o7 {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.gif -exec gifsicle -O2 -b {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname *.jpg -exec jpegoptim -p {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both [http://optipng.sourceforge.net/ optipng] and [http://www.lcdf.org/gifsicle/ gifsicle] are provided in the base repositories of most newer Linux distributions; [http://www.kokkonen.net/tjko/projects.html jpegoptim] must be downloaded and installed manually.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle: [http://moodle.org/mod/forum/view.php?f=94 Hardware and Performance] forum&lt;br /&gt;
*[http://opensourceelearning.blogspot.be/2012/10/why-your-moodle-site-is-slow-five.html Why Your Moodle Site is Slow: Five Simple Settings] blog post from Jonathan Moore &lt;br /&gt;
*I teach with Moodle perfomance testing: http://www.iteachwithmoodle.com/2012/11/17/moodle-2-4-beta-performance-test-comparison-with-moodle-2-3/&lt;br /&gt;
*[http://jfilip.ca/2013/08/20/moodle-2-4-5-vs-2-5-1-performance-and-muc-apc-cache-store/ Moodle 2.4.5 vs 2.5.2 performance and MUC APC cahe store]&lt;br /&gt;
*[http://jfilip.ca/2013/09/25/moodle-performance-testing-2-4-6-vs-2-5-2-vs-2-6dev/ Moodle performance testing 2.4.6 vs 2.5.2 vs 2.6dev]&lt;br /&gt;
*[http://jfilip.ca/2013/09/24/moodle-performance-analysis-revisted-now-with-mariadb/ Moodle performance analysis revisited (now with MariaDB)]&lt;br /&gt;
*[http://tjhunt.blogspot.ca/2013/05/performance-testing-moodle.html Tim Hunt&#039;s blog (May 2, 2013) on performance testing Moodle]&lt;br /&gt;
*[http://newrelic.com/ New Relic, Application Performance Monitoring]&lt;br /&gt;
&lt;br /&gt;
There have been a lot of discussions on moodle.org about performance, here are some of the more interesting and (potentially) useful ones:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=83057 Performance woes!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88927 Comments on planned server hardware]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102978#p461624 Moodle performance in a pil by Martin Langhoff]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=240391#unread Advice on optimising php/db code in moodle2+]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=243531 Moodle 2.5 performance testing at the OU]&lt;br /&gt;
&lt;br /&gt;
[[es:Recomendaciones sobre desempeño]]&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;br /&gt;
[[de:Geschwindigkeitsempfehlungen]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=108100</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=108100"/>
		<updated>2013-12-01T09:05:26Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: Add link to OPCache notes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]). These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (also sometimes known as the LAMP platform). If in doubt, this is the safest combination (if for no other reason than being the most common). There are other options - see the Software section that follows:&lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 160MB free (min) plus as much as you need to store your materials. 5GB is probably a realistic minimum. &lt;br /&gt;
* Backups: at least the same again (at a remote location preferably) as above to keep backups of your site&lt;br /&gt;
* Memory: 256MB (min), 1GB or more is strongly recommended. The general rule of thumb is that Moodle can support 10 to 20 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination and the type of use. &#039;Concurrent&#039; really means web server processes in memory at the same time (i.e. users interacting with the system within a window of a few seconds). It does NOT mean people &#039;logged in&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
* An operating system (!). Anything that runs the following software; although the choice will most likely depend on the performance you need and the skills you have available. Linux and Windows are the most common choices (and good support is available). If you have a free choice, Linux is generally regarded to be the optimal platform. Moodle is regularly tested with Debian, Ubuntu, CentOS, RedHat, Windows 7/2012 and Mac OS X.&lt;br /&gt;
* Web server, primarily [[Apache]]. Not fully tested (or supported) but should work are [[IIS]], [http://www.lighttpd.net/ lightttpd], [http://nginx.org/ nginx], [http://www.cherokee-project.com/ cherokee], zeus and [http://litespeedtech.com/ LiteSpeed]. Moodle will refuse to install on any other web server. Your web server needs to be correctly configured to serve PHP files.The version is not critical but try to use the newest web server build available to you. &lt;br /&gt;
* [[PHP]] - The minimum version is currently 5.3.3. A number of extensions are required; see the [[PHP]] page for full details. Installation will halt at the environment check if any of the required extensions are missing. If available, PHP 5.5 and newer contain [[OPcache]] which is recommended (you can ignore the environment check for this if not available).&lt;br /&gt;
* A database. MySQL and PostgreSQL are the primary development database, the most comprehensively tested and have extensive documentation and support. MSSQL is fully supported (note that optional plugins may be untested with these databases) but documentation and online help are not as comprehensive as MySQL/PostgreSQL. Oracle database is not fully supported and is not recommended. If in doubt use MySQL (more documentation) or PostgreSQL (better stability/performance). You will need the appropriate PHP extension (configured if need be) for your chosen database.&lt;br /&gt;
** [[MySQL]] - minimum version 5.1.33&lt;br /&gt;
** [[MariaDB]] - minimum version 5.3.5 (drop-in replacement for Oracle&#039;s MySQL)&lt;br /&gt;
** [[PostgreSQL]] - minimum version 8.3&lt;br /&gt;
** [[MSSQL]] - minimum version 9.0&lt;br /&gt;
** [[Oracle]] - minimum version 10.2 (not recommended)&lt;br /&gt;
* Minimum browser for accessing Moodle: recent Firefox, Internet Explorer 9, Safari 6, recent Google Chrome 11 (lower versions may work but are not fully supported)&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
...or desktop computer, if you are just evaluating Moodle. There are lots of possibilities for installing the basic server software depending on your particular choices. Some links and pointers are at [[Installing AMP]]&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted server all this should be done for you. However, (especially on shared hosting) make sure you understand or find out how to change PHP settings (e.g. file upload maximums). This can vary a huge amount from host to host.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone -b MOODLE_26_STABLE git://git.moodle.org/moodle.git &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
...this fetches a complete copy of the Moodle repository and then switches to the 2.6 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in add-on installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]]&lt;br /&gt;
* [[MySQL]]&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions. &lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Settings&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date.&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* If you are having trouble creating a [[Configuration file]] (config.php), you can do it manually by copying config-dist.php (in the root of the Moodle program directory) to config.php, editing it and setting your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Complete_install_packages_for_Windows&amp;diff=106478</id>
		<title>Complete install packages for Windows</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Complete_install_packages_for_Windows&amp;diff=106478"/>
		<updated>2013-08-29T13:58:14Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
Complete install packages are available from Moodle.org&#039;s [http://download.moodle.org/windows Windows download page]. The packages are designed for new installations on a standalone computer. The complete install package can be used on a server, but &#039;&#039;&#039;it is not recommended that it be used as a production site&#039;&#039;&#039;. Please note Moodle.org&#039;s [http://download.moodle.org Standard install packages] only contain the Moodle code.&lt;br /&gt;
&lt;br /&gt;
This document provides instructions for using the Windows packages. Separate instructions are available for [[Complete Install Packages for Mac OS X|Mac OS X packages]].&lt;br /&gt;
&lt;br /&gt;
The complete install packages allow Moodle to be installed, along with the prerequisites that includes a web server, Apache, database, MySQL, scripting language, PHP, an administration tool, phpMyAdmin and Moodle all wrapped in the Xampp-lite shell. Several versions of the complete install package are available. The instructions on the download page provide guidance on which version is likely to be most suitable.&lt;br /&gt;
&lt;br /&gt;
In short, complete install packages are designed to create a matched webserver and Moodle site on a standalone computer with minimal effort. &lt;br /&gt;
&lt;br /&gt;
==System requirements==&lt;br /&gt;
:*256 MB RAM (minimum), 512 MB RAM (recommended)&lt;br /&gt;
:*160 MB free Fixed Disk (more space will be needed depending on user uploads)&lt;br /&gt;
:*Windows 98/ME (minimum)&lt;br /&gt;
:*Windows NT/2000/XP (recommended)&lt;br /&gt;
&lt;br /&gt;
==Install complete package process==&lt;br /&gt;
The complete install package is a zip file that contains a webserver called [[Apache]], plus Moodle and Moodle&#039;s required [[MySQL]] database and [[PHP]] program. &lt;br /&gt;
&lt;br /&gt;
There are three basic parts to the this install process.  &lt;br /&gt;
#Download and unpack the complete install package. &lt;br /&gt;
#Start the webserver. &lt;br /&gt;
#Install Moodle using a web browser.&lt;br /&gt;
&lt;br /&gt;
===First create file structure===&lt;br /&gt;
====Download the package====&lt;br /&gt;
[http://download.moodle.org/windows Download Windows] packed-zip file from Moodle.&lt;br /&gt;
[[Image:Moodle Setup zipfile.jpg|frame|center|A downloaded complete install package Windows 1.9 zip file in Windows Explorer]]&lt;br /&gt;
 &lt;br /&gt;
====Unpack the package====&lt;br /&gt;
Unpack (extract files by clicking on) the zip file you downloaded to a drive or partition of your choice. The extract process will create three files (&amp;quot;Start Moodle&amp;quot;, &amp;quot;Stop Moodle&amp;quot;, and &amp;quot;README&amp;quot;) and a subfolder called &amp;quot;server&amp;quot;. &lt;br /&gt;
*Do NOT rename the &amp;quot;server&amp;quot; subfolder  &lt;br /&gt;
:&#039;&#039;Note:&#039;&#039; There will also be a folder under this server subfolder, called \moodle that holds the Moodle program.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;TIP:&#039;&#039; Create a folder and extract the files there.  For example, you might have one folder called Moodle193 and another one called Moodle187 for different versions or purposes.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;TIP:&#039;&#039; Make path to &amp;quot;server&amp;quot; subfolder simple. Best way if it will be in drive root. Like &amp;quot;D:\moodle193\server&amp;quot;. A long path, especially with any strange symbols, can prevent XAMPP from working properly.&lt;br /&gt;
&lt;br /&gt;
===Second - start the webserver===&lt;br /&gt;
Now you are ready to start the webserver.  Use the &amp;quot;Start Moodle.exe&amp;quot; file which you should find in the top directory. Once the &amp;quot;Start Moodle.exe&amp;quot; program is open, don&#039;t close it; use &amp;quot;Stop Moodle.exe&amp;quot; for that purpose.&lt;br /&gt;
 &lt;br /&gt;
:&#039;&#039;Note:&#039;&#039; These programs control both Apache and MySQL programs that operate the webserver.  Some sites will individually start and stop Apache and MySQL with the Xampp bat files found in the &amp;quot;server&amp;quot; subfolder.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; Alternatively, on a standalone computer with several potential webservers that might be running, you can use the &amp;quot;xampp_restart.exe&amp;quot; file in the &amp;quot;server&amp;quot; subfolder.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; You can also add shortcuts to the commands that start and stop the site in your Windows &amp;quot;start&amp;quot; menu.&lt;br /&gt;
 &lt;br /&gt;
Now you are ready to start the Moodle installation.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Warning:&#039;&#039; Windows XP requires the msvcr71.dll library file in order to run Xampp. Installing the [http://www.microsoft.com/downloads/details.aspx?familyid=262D25E3-F589-4842-8157-034D1E7CF3A3&amp;amp;displaylang=en .Net 1.1 framework] (not .Net 2.0 and upper) could resolve it. You can also search for the file on Google, download it and copy it into the server/apache/bin folder.&lt;br /&gt;
&lt;br /&gt;
===Third - start Moodle installation===&lt;br /&gt;
Start your web browser and type &amp;lt;nowiki&amp;gt; localhost, or  http://127.0.0.1 or http://localhost &amp;lt;/nowiki&amp;gt;in the address bar. You will either start your first time Moodle installation or if it is already installed you will enter the Moodle site&#039;s [[Front Page]] or Login screen.&lt;br /&gt;
&lt;br /&gt;
[[Image:Moodle_Setup_localhost_browser.jpg|frame|center|A browser&#039;s addressbar showing &amp;quot;localhost&amp;quot;. Click on  the green Goto arrow will go to the installed Moodle site.]]&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; After Moodle installs, put the site in your &amp;quot;favorites&amp;quot; or as a &amp;quot;bookmark&amp;quot; in you browser.&lt;br /&gt;
&lt;br /&gt;
====Set language====&lt;br /&gt;
The initial install page will be displayed after you type &amp;quot;localhost&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:C Install Windows 1.png|thumb|center|600px|Set initial language]]&lt;br /&gt;
&lt;br /&gt;
*Choose your preferred language (English is used in this example) and click the “Next” button.&lt;br /&gt;
&lt;br /&gt;
====Diagnostic results====&lt;br /&gt;
A diagnostic report is displayed – hopefully it will look like this, if not you may need to address some issues.&lt;br /&gt;
[[Image:Complete Windows Install 2.png|thumb|center|546px|Moodle liked and gave a Pass ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Moodle paths====&lt;br /&gt;
The paths for your Moodle installation are shown – if you are only using this as a local testing server, accept the ones that are shown on your screen.&lt;br /&gt;
&lt;br /&gt;
What you enter in the &amp;quot;Web Address&amp;quot; field depends on what you intend to use the new Moodle installation for. &lt;br /&gt;
If you are just going to use it for local testing, then use &#039;http://localhost&#039;. &lt;br /&gt;
If you are going to test the new installation on a LAN, and will be accessing it from other machines on that LAN, then put the private IP address or network name of the serving machine, followed by a forward slash and moodle: Web Address - http://192.168.1.1/moodle&lt;br /&gt;
If you are going to test the installation on the internet, then you will need to put the public ip address followed by a forward slash and moodle: http://your_ip_address/moodle or you can put your domain name here instead.&lt;br /&gt;
&lt;br /&gt;
[[image:Complete install Windows 3.png|thumb|center|600px|Installation paths]]&lt;br /&gt;
&lt;br /&gt;
*Click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Database configuration====&lt;br /&gt;
*In the next fields, we enter the database settings. The fields are populated with some suggested values.&lt;br /&gt;
&lt;br /&gt;
*We strongly recommend you place a user name and password in this screen. (Don&#039;t forget them).&lt;br /&gt;
&lt;br /&gt;
*DO NOT USE THE “ROOT” USER WITHOUT A PASSWORD FOR PRODUCTION INSTALLATIONS AS THIS CREATES A SECURITY VULNERABILITY&lt;br /&gt;
[[image:Complete install Windows 4.png|thumb|center|535px|Installation&#039;s database settings]]&lt;br /&gt;
&lt;br /&gt;
*When the fields have been populated, click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Check server====&lt;br /&gt;
The install process checks the server it installed.&lt;br /&gt;
[[image:Complete install Windows 5.png|thumb|center|535px|Check server environment screen]]&lt;br /&gt;
*Click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Confirm initial language pack====&lt;br /&gt;
Moodle will now check to see if the language pack is available for the language you selected at the first step.  If it is not, Moodle will continue with the install in English.&lt;br /&gt;
[[image:Complete install Windows 6.png|thumb|center|535px|Language pack check]]&lt;br /&gt;
&lt;br /&gt;
====Confirm config.php====&lt;br /&gt;
Provided the Moodle folder is writable, a message confirming the configuration has been completed will be displayed.&lt;br /&gt;
[[image:Complete install Windows 7.png|thumb|center|549px|Confirmation that config.php has been created]]&lt;br /&gt;
&lt;br /&gt;
*Click the “ Continue” button to proceed.&lt;br /&gt;
&lt;br /&gt;
====Moodle copyright &amp;amp; agreement====&lt;br /&gt;
The Moodle copyright / license notices are displayed.&lt;br /&gt;
&lt;br /&gt;
[[image:Complete install Windows 8.png|thumb|center|400px|Copyright notice and agreement]]&lt;br /&gt;
&lt;br /&gt;
*Click the “Yes” button to continue.  &lt;br /&gt;
&lt;br /&gt;
====Current release and unattended option====&lt;br /&gt;
The current release information is shown. &lt;br /&gt;
&#039;&#039;&#039;Check off the unattended operations box&#039;&#039;&#039;. This will automatically advance through many screens.  If you would like to watch the install screen by screen, do not check this box and be prepared to press the &amp;quot;continute button&amp;quot; many times.&lt;br /&gt;
 &lt;br /&gt;
*Click the &amp;quot;Continue&amp;quot; button and wait.&lt;br /&gt;
[[Image:Complete install Windows 9.png|thumb|center|600px|Current release and &amp;quot;unattended&amp;quot; check box]]&lt;br /&gt;
&lt;br /&gt;
====Installation modules and blocks screens====&lt;br /&gt;
In most cases this will be followed by a series of screens that have a continue button on the bottom.  This process stops with Admin user profile settings which needs to be filled out.&lt;br /&gt;
&lt;br /&gt;
====Administrator user profile====&lt;br /&gt;
[[Image:Complete install Windows 10.png|thumb|center|The administrator&#039;s users profile screen]]&lt;br /&gt;
&lt;br /&gt;
Fill out the required fields.&lt;br /&gt;
*Click on &amp;quot;Save&amp;quot; to continue&lt;br /&gt;
&lt;br /&gt;
====Front page settings====&lt;br /&gt;
The next screen is the Front Page settings page.  There are two parts to it.&lt;br /&gt;
The first part will ask for your Full site name and a short name for the navigation bar. There is also a place for a description. You can change these later.  &lt;br /&gt;
&lt;br /&gt;
[[Image:Complete install Windows 11a.png|thumb|center|The Moodle sites [[Front Page]] information]]&lt;br /&gt;
&lt;br /&gt;
The second part on the bottom instructs Moodle if you will disable the new user self [[authentication]] through email process.  The default is to disable.  This can be changed later in the [[Site administration block|site administration block]].&lt;br /&gt;
&lt;br /&gt;
[[Image:Complete install Windows 11ba.png|thumb|center|500px|Determine if users can create their own profiles when they log onto the side via email self authentication]]&lt;br /&gt;
&lt;br /&gt;
*Click on &amp;quot;Save changes&amp;quot; button to go to Moodle sites home page.&lt;br /&gt;
&lt;br /&gt;
====Moodle on====&lt;br /&gt;
&#039;&#039;&#039;Now you are ready to Moodle !&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Complete install Windows 12.png|thumb|center|Blank Front page of your new site]]&lt;br /&gt;
&lt;br /&gt;
The Site Administration block is on the left, the &amp;quot;Turn edit on&amp;quot; button in the upper right corner, withe the site description block just below it.&lt;br /&gt;
&lt;br /&gt;
===Congratulations - Moodle has been installed===&lt;br /&gt;
This finishes the installation of a complete package.   Type &amp;lt;nowiki&amp;gt;http://localhost&amp;lt;/nowiki&amp;gt; (or what ever you set for web address earlier in the setup!) in your browser and Moodle will open. &lt;br /&gt;
&lt;br /&gt;
Your next task will be to configure Moodle to meet your needs.  Don&#039;t worry, it is easy to change any of the settings now that Moodle is up and running.&lt;br /&gt;
*Check &#039;&#039;Settings &amp;gt; Site administration&#039;&#039; for further links.&lt;br /&gt;
&lt;br /&gt;
==More tips and cautions==&lt;br /&gt;
*For installation on a Windows 2000 or Windows 2003 production server it is good practice to perform a manual install (see the manual installation section in [[Windows_installation|Windows Installation]]). &lt;br /&gt;
&lt;br /&gt;
*After installing the Windows package, you may wish to add additional contributed modules and plugins.  Theset may involve more customization of configuration files.&lt;br /&gt;
&lt;br /&gt;
*The latest complete install package version components, may not be backwardly compatible. Always check version compatibility of each component if you intend to develop materials on a later version of Moodle than the version installed on your &amp;quot;main&amp;quot; Moodle site.  In short, complete install packages are designed for first time install on a &amp;quot;clean&amp;quot; machine.  &lt;br /&gt;
&lt;br /&gt;
== Security matters (A MUST READ!)==&lt;br /&gt;
&lt;br /&gt;
As mentioned before, XAMPP is not meant for production use but only for developers &lt;br /&gt;
in a development environment. The way XAMPP is configured is to be open as possible &lt;br /&gt;
and allowing the developer anything he/she wants. For development environments this &lt;br /&gt;
is great but in a production environment it could be fatal. Here a list of missing security &lt;br /&gt;
in XAMPP:&lt;br /&gt;
&lt;br /&gt;
The MySQL administrator (root) has no password.&lt;br /&gt;
The MySQL daemon is accessible via network.&lt;br /&gt;
phpMyAdmin is accessible via network.&lt;br /&gt;
Examples are accessible via network.&lt;br /&gt;
&lt;br /&gt;
To fix most of the security weaknesses simply call the following URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://localhost/security/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The root password for MySQL + phpMyAdmin and also a XAMPP directory protection can be established here.&lt;br /&gt;
&lt;br /&gt;
Note that on the Windows installer package, some (all?) of these issues have been fixed already by default and the above link does not work.&lt;br /&gt;
&lt;br /&gt;
If in doubt, more info is [http://www.apachefriends.org/en/faq-xampp-windows.html  here]&lt;br /&gt;
&lt;br /&gt;
== Apache and MySQL tweaks ==&lt;br /&gt;
Most of the time it is not necessary to tweak Apache or MySQL after completing the complete install package. Nor is it necessary to individually start and stop them because that is what the Xampp_start, Xampp_restart and Xammp_stop files are for.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache and MySQL as services===&lt;br /&gt;
(This is only for NT4 | Windows 2000 | Windows XP operating systems)&lt;br /&gt;
&lt;br /&gt;
\xampplite\apache\apache_installservice.bat =&lt;br /&gt;
==&amp;gt; Install Apache 2 as service   &lt;br /&gt;
&lt;br /&gt;
\xampplite\apache\apache_uninstallservice.bat =&lt;br /&gt;
==&amp;gt; Uninstall Apache 2 as service   &lt;br /&gt;
&lt;br /&gt;
\xampplite\mysql\mysql_installservice.bat =&lt;br /&gt;
==&amp;gt; Install MySQL as service   &lt;br /&gt;
&lt;br /&gt;
\xampplite\mysql\mysql_uninstallservice.bat =&lt;br /&gt;
==&amp;gt; Uninstall MySQL as service   &lt;br /&gt;
&lt;br /&gt;
==&amp;gt; After all Service (un)installations, please restart your system!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Apache Notes===&lt;br /&gt;
&lt;br /&gt;
You can use the apache_start and apache_stop bat files to start and stop apache from running. However the Xampp_start or Xampp_restart and Xampp_stop is recommended to turn on/off both Apache and MySQL.&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If you find that Apache is very flaky, with the page often not loading properly or even at all (especially on localhost), try adding these lines to the end of C:\your_moodle_installer_directory\apache\conf\httpd.conf &lt;br /&gt;
&lt;br /&gt;
  EnableSendfile Off&lt;br /&gt;
  EnableMMAP Off&lt;br /&gt;
  Win32DisableAcceptEx&lt;br /&gt;
&lt;br /&gt;
If You edit some .php files but browser still show old state of them, try to disable eAccelerator extension in \server\php\php.ini&lt;br /&gt;
&lt;br /&gt;
 [eAccelerator]&lt;br /&gt;
 ;extension=eaccelerator.dll&lt;br /&gt;
&lt;br /&gt;
===MySQL notes===&lt;br /&gt;
Again, the recommendation to start and stop the entire webserver is to use the xampp_start or Xampp_restart and the Xampp_stop.  The following maybe useful if you wish to tweak the system further.  Please be careful.&lt;br /&gt;
&lt;br /&gt;
(1) The MySQL server can be started by double-clicking (executing) mysql_start.bat. This file can be found in the same folder you installed xampp in, most likely this will be C:\xampplite\.  The exact path to this file is X:\xampplite\mysql_start.bat, where &amp;quot;X&amp;quot; indicates the letter of the drive you unpacked xampp into.This batch file starts the MySQL server in console mode. The first intialization might take a few minutes.&lt;br /&gt;
    &lt;br /&gt;
Do not close the DOS window or you&#039;ll crash the server! To stop the server, please use mysql_shutdown.bat, which is located in the same directory.&lt;br /&gt;
&lt;br /&gt;
(2) To use the MySQL Daemon with &amp;quot;innodb&amp;quot; for better performance, &lt;br /&gt;
please edit the &amp;quot;my&amp;quot; (or &amp;quot;my.cnf&amp;quot;) file in the /xampplite/mysql/bin directory or for services the c:\my.cnf for windows NT/2000/XP. In that director, activate the&lt;br /&gt;
 &amp;quot;innodb_data_file_path=ibdata1:30M&amp;quot;&lt;br /&gt;
statement. Attention, &amp;quot;innodb&amp;quot; is not recommended for 95/98/ME.&lt;br /&gt;
    &lt;br /&gt;
:To use MySQL as Service for NT/2000/XP, simply copy the &amp;quot;my&amp;quot; / &amp;quot;my.cnf&amp;quot; file to C:\my, or C:\my.cnf. Please note that this file has to be placed in C:\ (root), other locations are not permitted. Then execute the &amp;quot;mysql_installservice.bat&amp;quot; in the mysql folder. 	&lt;br /&gt;
   	&lt;br /&gt;
&lt;br /&gt;
(3) MySQL starts with standard values for the user id and the password. The preset user id is &amp;quot;root&amp;quot;, the password is &amp;quot;&amp;quot; (= no password). To access MySQL via PHP with the preset values, you&#039;ll have to use the following syntax:&lt;br /&gt;
 mysql_connect(&amp;quot;localhost&amp;quot;,&amp;quot;root&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
If you want to set a password for MySQL access, please use of mysqladmin.&lt;br /&gt;
To set the password &amp;quot;secret&amp;quot; for the user &amp;quot;root&amp;quot;, type the following:&lt;br /&gt;
   &lt;br /&gt;
  \xampplite\mysql\bin\mysqladmin -u root password secret&lt;br /&gt;
    &lt;br /&gt;
After changing the password you&#039;ll have to reconfigure phpMyAdmin to use the new password, otherwise it won&#039;t be able to access the databases. To do that, open the file config.inc.php in \xampplite\phpmyadmin\ and edit the following lines:    &lt;br /&gt;
    &lt;br /&gt;
    $cfg[&#039;Servers&#039;][$i][&#039;user&#039;]            = &#039;root&#039;;   // MySQL user&lt;br /&gt;
    $cfg[&#039;Servers&#039;][$i][&#039;auth_type&#039;]       = &#039;http&#039;;   // HTTP authentificate&lt;br /&gt;
&lt;br /&gt;
So first the &#039;root&#039; password is queried by the MySQL server, before phpMyAdmin may access.&lt;br /&gt;
  	    	&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
Have a lot of fun! Viel Spaß! Bonne Chance!&lt;br /&gt;
&lt;br /&gt;
==Vista and Windows 7==&lt;br /&gt;
&lt;br /&gt;
Many people have trouble installing the packages for Windows on Vista and Windows 7.&lt;br /&gt;
&lt;br /&gt;
One simple solution is to use http://bitnami.org/stack/moodle (from amazon.com).&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[https://docs.moodle.org/19/en/Installation_guide_-_Moodle_for_Windows_on_a_USB_Memory_Stick Installation guide - Moodle 1.9 for Windows on a USB Memory Stick]&lt;br /&gt;
*Return to [[Windows installation]]&lt;br /&gt;
*[[Windows 1 computer many servers |Multiple web servers, on 1 computer]] similar to windows installation page, with some tips&lt;br /&gt;
*[https://docs.moodle.org/en/Windows_installation_using_XAMPP#Troubleshooting Troubleshooting]if you are running Skype. &lt;br /&gt;
*[[Installing_AMP]] lots of XAMPP stuff.  XAMPP stands for X (cross platform), Apache, MySQL,PHP and Perl.  XAMPP used in Moodle does not include Perl. MAMP stands for Mac, Apache, MySQL and PHP.  &lt;br /&gt;
*[[Complete Install Packages for Mac OS X]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:Paquetes_para_Instalaci%C3%B3n_Completa]]&lt;br /&gt;
[[pl:Kompletne pakiety instalacyjne]]&lt;br /&gt;
[[de:Vollständiges Installationspaket für Windows]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Complete_install_packages_for_Windows&amp;diff=106477</id>
		<title>Complete install packages for Windows</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Complete_install_packages_for_Windows&amp;diff=106477"/>
		<updated>2013-08-29T13:57:55Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
Complete install packages are available from Moodle.org&#039;s [http://download.moodle.org/windows Windows download page]. The packages are designed for new installations on a standalone computer. The complete install package can be used on a server, but &#039;&#039;it is not recommended that it be used as a production site&#039;&#039;. Please note Moodle.org&#039;s [http://download.moodle.org Standard install packages] only contain the Moodle code.&lt;br /&gt;
&lt;br /&gt;
This document provides instructions for using the Windows packages. Separate instructions are available for [[Complete Install Packages for Mac OS X|Mac OS X packages]].&lt;br /&gt;
&lt;br /&gt;
The complete install packages allow Moodle to be installed, along with the prerequisites that includes a web server, Apache, database, MySQL, scripting language, PHP, an administration tool, phpMyAdmin and Moodle all wrapped in the Xampp-lite shell. Several versions of the complete install package are available. The instructions on the download page provide guidance on which version is likely to be most suitable.&lt;br /&gt;
&lt;br /&gt;
In short, complete install packages are designed to create a matched webserver and Moodle site on a standalone computer with minimal effort. &lt;br /&gt;
&lt;br /&gt;
==System requirements==&lt;br /&gt;
:*256 MB RAM (minimum), 512 MB RAM (recommended)&lt;br /&gt;
:*160 MB free Fixed Disk (more space will be needed depending on user uploads)&lt;br /&gt;
:*Windows 98/ME (minimum)&lt;br /&gt;
:*Windows NT/2000/XP (recommended)&lt;br /&gt;
&lt;br /&gt;
==Install complete package process==&lt;br /&gt;
The complete install package is a zip file that contains a webserver called [[Apache]], plus Moodle and Moodle&#039;s required [[MySQL]] database and [[PHP]] program. &lt;br /&gt;
&lt;br /&gt;
There are three basic parts to the this install process.  &lt;br /&gt;
#Download and unpack the complete install package. &lt;br /&gt;
#Start the webserver. &lt;br /&gt;
#Install Moodle using a web browser.&lt;br /&gt;
&lt;br /&gt;
===First create file structure===&lt;br /&gt;
====Download the package====&lt;br /&gt;
[http://download.moodle.org/windows Download Windows] packed-zip file from Moodle.&lt;br /&gt;
[[Image:Moodle Setup zipfile.jpg|frame|center|A downloaded complete install package Windows 1.9 zip file in Windows Explorer]]&lt;br /&gt;
 &lt;br /&gt;
====Unpack the package====&lt;br /&gt;
Unpack (extract files by clicking on) the zip file you downloaded to a drive or partition of your choice. The extract process will create three files (&amp;quot;Start Moodle&amp;quot;, &amp;quot;Stop Moodle&amp;quot;, and &amp;quot;README&amp;quot;) and a subfolder called &amp;quot;server&amp;quot;. &lt;br /&gt;
*Do NOT rename the &amp;quot;server&amp;quot; subfolder  &lt;br /&gt;
:&#039;&#039;Note:&#039;&#039; There will also be a folder under this server subfolder, called \moodle that holds the Moodle program.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;TIP:&#039;&#039; Create a folder and extract the files there.  For example, you might have one folder called Moodle193 and another one called Moodle187 for different versions or purposes.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;TIP:&#039;&#039; Make path to &amp;quot;server&amp;quot; subfolder simple. Best way if it will be in drive root. Like &amp;quot;D:\moodle193\server&amp;quot;. A long path, especially with any strange symbols, can prevent XAMPP from working properly.&lt;br /&gt;
&lt;br /&gt;
===Second - start the webserver===&lt;br /&gt;
Now you are ready to start the webserver.  Use the &amp;quot;Start Moodle.exe&amp;quot; file which you should find in the top directory. Once the &amp;quot;Start Moodle.exe&amp;quot; program is open, don&#039;t close it; use &amp;quot;Stop Moodle.exe&amp;quot; for that purpose.&lt;br /&gt;
 &lt;br /&gt;
:&#039;&#039;Note:&#039;&#039; These programs control both Apache and MySQL programs that operate the webserver.  Some sites will individually start and stop Apache and MySQL with the Xampp bat files found in the &amp;quot;server&amp;quot; subfolder.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; Alternatively, on a standalone computer with several potential webservers that might be running, you can use the &amp;quot;xampp_restart.exe&amp;quot; file in the &amp;quot;server&amp;quot; subfolder.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; You can also add shortcuts to the commands that start and stop the site in your Windows &amp;quot;start&amp;quot; menu.&lt;br /&gt;
 &lt;br /&gt;
Now you are ready to start the Moodle installation.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Warning:&#039;&#039; Windows XP requires the msvcr71.dll library file in order to run Xampp. Installing the [http://www.microsoft.com/downloads/details.aspx?familyid=262D25E3-F589-4842-8157-034D1E7CF3A3&amp;amp;displaylang=en .Net 1.1 framework] (not .Net 2.0 and upper) could resolve it. You can also search for the file on Google, download it and copy it into the server/apache/bin folder.&lt;br /&gt;
&lt;br /&gt;
===Third - start Moodle installation===&lt;br /&gt;
Start your web browser and type &amp;lt;nowiki&amp;gt; localhost, or  http://127.0.0.1 or http://localhost &amp;lt;/nowiki&amp;gt;in the address bar. You will either start your first time Moodle installation or if it is already installed you will enter the Moodle site&#039;s [[Front Page]] or Login screen.&lt;br /&gt;
&lt;br /&gt;
[[Image:Moodle_Setup_localhost_browser.jpg|frame|center|A browser&#039;s addressbar showing &amp;quot;localhost&amp;quot;. Click on  the green Goto arrow will go to the installed Moodle site.]]&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; After Moodle installs, put the site in your &amp;quot;favorites&amp;quot; or as a &amp;quot;bookmark&amp;quot; in you browser.&lt;br /&gt;
&lt;br /&gt;
====Set language====&lt;br /&gt;
The initial install page will be displayed after you type &amp;quot;localhost&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:C Install Windows 1.png|thumb|center|600px|Set initial language]]&lt;br /&gt;
&lt;br /&gt;
*Choose your preferred language (English is used in this example) and click the “Next” button.&lt;br /&gt;
&lt;br /&gt;
====Diagnostic results====&lt;br /&gt;
A diagnostic report is displayed – hopefully it will look like this, if not you may need to address some issues.&lt;br /&gt;
[[Image:Complete Windows Install 2.png|thumb|center|546px|Moodle liked and gave a Pass ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Moodle paths====&lt;br /&gt;
The paths for your Moodle installation are shown – if you are only using this as a local testing server, accept the ones that are shown on your screen.&lt;br /&gt;
&lt;br /&gt;
What you enter in the &amp;quot;Web Address&amp;quot; field depends on what you intend to use the new Moodle installation for. &lt;br /&gt;
If you are just going to use it for local testing, then use &#039;http://localhost&#039;. &lt;br /&gt;
If you are going to test the new installation on a LAN, and will be accessing it from other machines on that LAN, then put the private IP address or network name of the serving machine, followed by a forward slash and moodle: Web Address - http://192.168.1.1/moodle&lt;br /&gt;
If you are going to test the installation on the internet, then you will need to put the public ip address followed by a forward slash and moodle: http://your_ip_address/moodle or you can put your domain name here instead.&lt;br /&gt;
&lt;br /&gt;
[[image:Complete install Windows 3.png|thumb|center|600px|Installation paths]]&lt;br /&gt;
&lt;br /&gt;
*Click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Database configuration====&lt;br /&gt;
*In the next fields, we enter the database settings. The fields are populated with some suggested values.&lt;br /&gt;
&lt;br /&gt;
*We strongly recommend you place a user name and password in this screen. (Don&#039;t forget them).&lt;br /&gt;
&lt;br /&gt;
*DO NOT USE THE “ROOT” USER WITHOUT A PASSWORD FOR PRODUCTION INSTALLATIONS AS THIS CREATES A SECURITY VULNERABILITY&lt;br /&gt;
[[image:Complete install Windows 4.png|thumb|center|535px|Installation&#039;s database settings]]&lt;br /&gt;
&lt;br /&gt;
*When the fields have been populated, click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Check server====&lt;br /&gt;
The install process checks the server it installed.&lt;br /&gt;
[[image:Complete install Windows 5.png|thumb|center|535px|Check server environment screen]]&lt;br /&gt;
*Click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Confirm initial language pack====&lt;br /&gt;
Moodle will now check to see if the language pack is available for the language you selected at the first step.  If it is not, Moodle will continue with the install in English.&lt;br /&gt;
[[image:Complete install Windows 6.png|thumb|center|535px|Language pack check]]&lt;br /&gt;
&lt;br /&gt;
====Confirm config.php====&lt;br /&gt;
Provided the Moodle folder is writable, a message confirming the configuration has been completed will be displayed.&lt;br /&gt;
[[image:Complete install Windows 7.png|thumb|center|549px|Confirmation that config.php has been created]]&lt;br /&gt;
&lt;br /&gt;
*Click the “ Continue” button to proceed.&lt;br /&gt;
&lt;br /&gt;
====Moodle copyright &amp;amp; agreement====&lt;br /&gt;
The Moodle copyright / license notices are displayed.&lt;br /&gt;
&lt;br /&gt;
[[image:Complete install Windows 8.png|thumb|center|400px|Copyright notice and agreement]]&lt;br /&gt;
&lt;br /&gt;
*Click the “Yes” button to continue.  &lt;br /&gt;
&lt;br /&gt;
====Current release and unattended option====&lt;br /&gt;
The current release information is shown. &lt;br /&gt;
&#039;&#039;&#039;Check off the unattended operations box&#039;&#039;&#039;. This will automatically advance through many screens.  If you would like to watch the install screen by screen, do not check this box and be prepared to press the &amp;quot;continute button&amp;quot; many times.&lt;br /&gt;
 &lt;br /&gt;
*Click the &amp;quot;Continue&amp;quot; button and wait.&lt;br /&gt;
[[Image:Complete install Windows 9.png|thumb|center|600px|Current release and &amp;quot;unattended&amp;quot; check box]]&lt;br /&gt;
&lt;br /&gt;
====Installation modules and blocks screens====&lt;br /&gt;
In most cases this will be followed by a series of screens that have a continue button on the bottom.  This process stops with Admin user profile settings which needs to be filled out.&lt;br /&gt;
&lt;br /&gt;
====Administrator user profile====&lt;br /&gt;
[[Image:Complete install Windows 10.png|thumb|center|The administrator&#039;s users profile screen]]&lt;br /&gt;
&lt;br /&gt;
Fill out the required fields.&lt;br /&gt;
*Click on &amp;quot;Save&amp;quot; to continue&lt;br /&gt;
&lt;br /&gt;
====Front page settings====&lt;br /&gt;
The next screen is the Front Page settings page.  There are two parts to it.&lt;br /&gt;
The first part will ask for your Full site name and a short name for the navigation bar. There is also a place for a description. You can change these later.  &lt;br /&gt;
&lt;br /&gt;
[[Image:Complete install Windows 11a.png|thumb|center|The Moodle sites [[Front Page]] information]]&lt;br /&gt;
&lt;br /&gt;
The second part on the bottom instructs Moodle if you will disable the new user self [[authentication]] through email process.  The default is to disable.  This can be changed later in the [[Site administration block|site administration block]].&lt;br /&gt;
&lt;br /&gt;
[[Image:Complete install Windows 11ba.png|thumb|center|500px|Determine if users can create their own profiles when they log onto the side via email self authentication]]&lt;br /&gt;
&lt;br /&gt;
*Click on &amp;quot;Save changes&amp;quot; button to go to Moodle sites home page.&lt;br /&gt;
&lt;br /&gt;
====Moodle on====&lt;br /&gt;
&#039;&#039;&#039;Now you are ready to Moodle !&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Complete install Windows 12.png|thumb|center|Blank Front page of your new site]]&lt;br /&gt;
&lt;br /&gt;
The Site Administration block is on the left, the &amp;quot;Turn edit on&amp;quot; button in the upper right corner, withe the site description block just below it.&lt;br /&gt;
&lt;br /&gt;
===Congratulations - Moodle has been installed===&lt;br /&gt;
This finishes the installation of a complete package.   Type &amp;lt;nowiki&amp;gt;http://localhost&amp;lt;/nowiki&amp;gt; (or what ever you set for web address earlier in the setup!) in your browser and Moodle will open. &lt;br /&gt;
&lt;br /&gt;
Your next task will be to configure Moodle to meet your needs.  Don&#039;t worry, it is easy to change any of the settings now that Moodle is up and running.&lt;br /&gt;
*Check &#039;&#039;Settings &amp;gt; Site administration&#039;&#039; for further links.&lt;br /&gt;
&lt;br /&gt;
==More tips and cautions==&lt;br /&gt;
*For installation on a Windows 2000 or Windows 2003 production server it is good practice to perform a manual install (see the manual installation section in [[Windows_installation|Windows Installation]]). &lt;br /&gt;
&lt;br /&gt;
*After installing the Windows package, you may wish to add additional contributed modules and plugins.  Theset may involve more customization of configuration files.&lt;br /&gt;
&lt;br /&gt;
*The latest complete install package version components, may not be backwardly compatible. Always check version compatibility of each component if you intend to develop materials on a later version of Moodle than the version installed on your &amp;quot;main&amp;quot; Moodle site.  In short, complete install packages are designed for first time install on a &amp;quot;clean&amp;quot; machine.  &lt;br /&gt;
&lt;br /&gt;
== Security matters (A MUST READ!)==&lt;br /&gt;
&lt;br /&gt;
As mentioned before, XAMPP is not meant for production use but only for developers &lt;br /&gt;
in a development environment. The way XAMPP is configured is to be open as possible &lt;br /&gt;
and allowing the developer anything he/she wants. For development environments this &lt;br /&gt;
is great but in a production environment it could be fatal. Here a list of missing security &lt;br /&gt;
in XAMPP:&lt;br /&gt;
&lt;br /&gt;
The MySQL administrator (root) has no password.&lt;br /&gt;
The MySQL daemon is accessible via network.&lt;br /&gt;
phpMyAdmin is accessible via network.&lt;br /&gt;
Examples are accessible via network.&lt;br /&gt;
&lt;br /&gt;
To fix most of the security weaknesses simply call the following URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://localhost/security/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The root password for MySQL + phpMyAdmin and also a XAMPP directory protection can be established here.&lt;br /&gt;
&lt;br /&gt;
Note that on the Windows installer package, some (all?) of these issues have been fixed already by default and the above link does not work.&lt;br /&gt;
&lt;br /&gt;
If in doubt, more info is [http://www.apachefriends.org/en/faq-xampp-windows.html  here]&lt;br /&gt;
&lt;br /&gt;
== Apache and MySQL tweaks ==&lt;br /&gt;
Most of the time it is not necessary to tweak Apache or MySQL after completing the complete install package. Nor is it necessary to individually start and stop them because that is what the Xampp_start, Xampp_restart and Xammp_stop files are for.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache and MySQL as services===&lt;br /&gt;
(This is only for NT4 | Windows 2000 | Windows XP operating systems)&lt;br /&gt;
&lt;br /&gt;
\xampplite\apache\apache_installservice.bat =&lt;br /&gt;
==&amp;gt; Install Apache 2 as service   &lt;br /&gt;
&lt;br /&gt;
\xampplite\apache\apache_uninstallservice.bat =&lt;br /&gt;
==&amp;gt; Uninstall Apache 2 as service   &lt;br /&gt;
&lt;br /&gt;
\xampplite\mysql\mysql_installservice.bat =&lt;br /&gt;
==&amp;gt; Install MySQL as service   &lt;br /&gt;
&lt;br /&gt;
\xampplite\mysql\mysql_uninstallservice.bat =&lt;br /&gt;
==&amp;gt; Uninstall MySQL as service   &lt;br /&gt;
&lt;br /&gt;
==&amp;gt; After all Service (un)installations, please restart your system!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Apache Notes===&lt;br /&gt;
&lt;br /&gt;
You can use the apache_start and apache_stop bat files to start and stop apache from running. However the Xampp_start or Xampp_restart and Xampp_stop is recommended to turn on/off both Apache and MySQL.&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If you find that Apache is very flaky, with the page often not loading properly or even at all (especially on localhost), try adding these lines to the end of C:\your_moodle_installer_directory\apache\conf\httpd.conf &lt;br /&gt;
&lt;br /&gt;
  EnableSendfile Off&lt;br /&gt;
  EnableMMAP Off&lt;br /&gt;
  Win32DisableAcceptEx&lt;br /&gt;
&lt;br /&gt;
If You edit some .php files but browser still show old state of them, try to disable eAccelerator extension in \server\php\php.ini&lt;br /&gt;
&lt;br /&gt;
 [eAccelerator]&lt;br /&gt;
 ;extension=eaccelerator.dll&lt;br /&gt;
&lt;br /&gt;
===MySQL notes===&lt;br /&gt;
Again, the recommendation to start and stop the entire webserver is to use the xampp_start or Xampp_restart and the Xampp_stop.  The following maybe useful if you wish to tweak the system further.  Please be careful.&lt;br /&gt;
&lt;br /&gt;
(1) The MySQL server can be started by double-clicking (executing) mysql_start.bat. This file can be found in the same folder you installed xampp in, most likely this will be C:\xampplite\.  The exact path to this file is X:\xampplite\mysql_start.bat, where &amp;quot;X&amp;quot; indicates the letter of the drive you unpacked xampp into.This batch file starts the MySQL server in console mode. The first intialization might take a few minutes.&lt;br /&gt;
    &lt;br /&gt;
Do not close the DOS window or you&#039;ll crash the server! To stop the server, please use mysql_shutdown.bat, which is located in the same directory.&lt;br /&gt;
&lt;br /&gt;
(2) To use the MySQL Daemon with &amp;quot;innodb&amp;quot; for better performance, &lt;br /&gt;
please edit the &amp;quot;my&amp;quot; (or &amp;quot;my.cnf&amp;quot;) file in the /xampplite/mysql/bin directory or for services the c:\my.cnf for windows NT/2000/XP. In that director, activate the&lt;br /&gt;
 &amp;quot;innodb_data_file_path=ibdata1:30M&amp;quot;&lt;br /&gt;
statement. Attention, &amp;quot;innodb&amp;quot; is not recommended for 95/98/ME.&lt;br /&gt;
    &lt;br /&gt;
:To use MySQL as Service for NT/2000/XP, simply copy the &amp;quot;my&amp;quot; / &amp;quot;my.cnf&amp;quot; file to C:\my, or C:\my.cnf. Please note that this file has to be placed in C:\ (root), other locations are not permitted. Then execute the &amp;quot;mysql_installservice.bat&amp;quot; in the mysql folder. 	&lt;br /&gt;
   	&lt;br /&gt;
&lt;br /&gt;
(3) MySQL starts with standard values for the user id and the password. The preset user id is &amp;quot;root&amp;quot;, the password is &amp;quot;&amp;quot; (= no password). To access MySQL via PHP with the preset values, you&#039;ll have to use the following syntax:&lt;br /&gt;
 mysql_connect(&amp;quot;localhost&amp;quot;,&amp;quot;root&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
If you want to set a password for MySQL access, please use of mysqladmin.&lt;br /&gt;
To set the password &amp;quot;secret&amp;quot; for the user &amp;quot;root&amp;quot;, type the following:&lt;br /&gt;
   &lt;br /&gt;
  \xampplite\mysql\bin\mysqladmin -u root password secret&lt;br /&gt;
    &lt;br /&gt;
After changing the password you&#039;ll have to reconfigure phpMyAdmin to use the new password, otherwise it won&#039;t be able to access the databases. To do that, open the file config.inc.php in \xampplite\phpmyadmin\ and edit the following lines:    &lt;br /&gt;
    &lt;br /&gt;
    $cfg[&#039;Servers&#039;][$i][&#039;user&#039;]            = &#039;root&#039;;   // MySQL user&lt;br /&gt;
    $cfg[&#039;Servers&#039;][$i][&#039;auth_type&#039;]       = &#039;http&#039;;   // HTTP authentificate&lt;br /&gt;
&lt;br /&gt;
So first the &#039;root&#039; password is queried by the MySQL server, before phpMyAdmin may access.&lt;br /&gt;
  	    	&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
Have a lot of fun! Viel Spaß! Bonne Chance!&lt;br /&gt;
&lt;br /&gt;
==Vista and Windows 7==&lt;br /&gt;
&lt;br /&gt;
Many people have trouble installing the packages for Windows on Vista and Windows 7.&lt;br /&gt;
&lt;br /&gt;
One simple solution is to use http://bitnami.org/stack/moodle (from amazon.com).&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[https://docs.moodle.org/19/en/Installation_guide_-_Moodle_for_Windows_on_a_USB_Memory_Stick Installation guide - Moodle 1.9 for Windows on a USB Memory Stick]&lt;br /&gt;
*Return to [[Windows installation]]&lt;br /&gt;
*[[Windows 1 computer many servers |Multiple web servers, on 1 computer]] similar to windows installation page, with some tips&lt;br /&gt;
*[https://docs.moodle.org/en/Windows_installation_using_XAMPP#Troubleshooting Troubleshooting]if you are running Skype. &lt;br /&gt;
*[[Installing_AMP]] lots of XAMPP stuff.  XAMPP stands for X (cross platform), Apache, MySQL,PHP and Perl.  XAMPP used in Moodle does not include Perl. MAMP stands for Mac, Apache, MySQL and PHP.  &lt;br /&gt;
*[[Complete Install Packages for Mac OS X]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:Paquetes_para_Instalaci%C3%B3n_Completa]]&lt;br /&gt;
[[pl:Kompletne pakiety instalacyjne]]&lt;br /&gt;
[[de:Vollständiges Installationspaket für Windows]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=103265</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installing_Moodle&amp;diff=103265"/>
		<updated>2013-02-20T11:57:23Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Remaining tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]). These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[MySQL]] and [[PHP]] (also sometimes known as the LAMP platform). If in doubt, this is the safest combination (if for no other reason than being the most common). There are other options - see the Software section that follows:&lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 160MB free (min) plus as much as you need to store your materials. 5GB is probably a realistic minimum. &lt;br /&gt;
* Backups: at least the same again (at a remote location preferably) as above to keep backups of your site&lt;br /&gt;
* Memory: 256MB (min), 1GB or more is strongly recommended. The general rule of thumb is that Moodle can support 10 to 20 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination and the type of use. &#039;Concurrent&#039; really means web server processes in memory at the same time (i.e. users interacting with the system within a window of a few seconds). It does NOT mean people &#039;logged in&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
* An operating system (!). Anything that runs the following software; although the choice will most likely depend on the performance you need and the skills you have available. Linux and Windows are the most common choices (and good support is available). If you have a free choice, Linux is generally regarded to be the optimal platform. Moodle is also regularly tested with Windows XP/2000/2003, Solaris 10 (Sparc and x64), Mac OS X and Netware 6 operating systems.&lt;br /&gt;
* Web server. Primarily [[Apache]] or [[IIS]]. Not fully tested (or supported) but should work are [http://www.lighttpd.net/ lightttpd], [http://nginx.org/ nginx], [http://www.cherokee-project.com/ cherokee], zeus and [http://litespeedtech.com/ LiteSpeed]. Moodle will refuse to install on any other web server. Your web server needs to be correctly configured to serve PHP files.The version is not critical but try to use the newest web server build available to you. &lt;br /&gt;
* [[PHP]] - The minimum version is currently 5.3.2. A number of extensions are required; see the [[PHP]] page for full details. Installation will halt at the environment check if any of the required extensions are missing.&lt;br /&gt;
* A database. MySQL and PostgreSQL are the primary development database, the most comprehensively tested and have extensive documentation and support. Oracle and MSSQL are fully supported (note that optional plugins may be untested with these databases) but documentation and online help are not as comprehensive as MySQL/PostgreSQL. If in doubt use MySQL (more documentation) or PostgreSQL (better stability/performance). You will need the appropriate PHP extension (configured if need be) for your chosen database.&lt;br /&gt;
** [[MySQL]] - minimum version 5.1.33&lt;br /&gt;
** [[PostgreSQL]] - minimum version 8.3&lt;br /&gt;
** [[MSSQL]] - minimum version 9.0&lt;br /&gt;
** [[Oracle]] - minimum version 10.2&lt;br /&gt;
** [[SQLite]] - minimum version 2.0&lt;br /&gt;
* Minimum browser for accessing Moodle: Firefox 4, Internet Explorer 8, Safari 5, Google Chrome 11, Opera 9&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
...or desktop computer, if you are just evaluating Moodle. There are lots of possibilities for installing the basic server software depending on your particular choices. Some links and pointers are at [[Installing AMP]]&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted server all this should be done for you. However, (especially on shared hosting) make sure you understand or find out how to change PHP settings (e.g. file upload maximums). This can vary a huge amount from host to host.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone -b MOODLE_24_STABLE git://git.moodle.org/moodle.git &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
...this fetches a complete copy of the Moodle repository and then switches to the 2.4 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[MySQL]]&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]]&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for other scenarios...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line installer as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line installer (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions. &lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Settings&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date.&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* If you are having trouble creating a [[Configuration file]] (config.php), you can do it manually by copying config-dist.php (in the root of the Moodle program directory) to config.php, editing it and setting your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installation_FAQ&amp;diff=103185</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installation_FAQ&amp;diff=103185"/>
		<updated>2013-02-15T15:38:01Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* &amp;quot;ACould not find a top level course&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
== System information needed for Installation problems forum ==&lt;br /&gt;
When posting questions to the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum], try to provide as much background information as possible about your Moodle system. Consider providing some or all of the following:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* PHP version (e.g. PHP 5.3.2)&lt;br /&gt;
* Database server type and version (e.g. MySQL 5.5.18)&lt;br /&gt;
* Browser and version (e.g. Internet Explorer 8):&lt;br /&gt;
* Moodle version (e.g. 2.1):&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached (please remove passwords):&lt;br /&gt;
* Phpinfo attached?:&lt;br /&gt;
&lt;br /&gt;
Make sure you provide a sensible description (never HELP! or URGENT!) and a full description of what you did and what happened. Copy and paste any error messages accurately in full. &#039;Nothing&#039; is not a symptom, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==PHP - is it installed and what version do I have?==&lt;br /&gt;
&lt;br /&gt;
Make a new file on your web site called &#039;&#039;info.php&#039;&#039;, containing the following text, and call it from your browser:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?PHP phpinfo() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If nothing happens then you don&#039;t have PHP installed or your webserver is not configured to handle .php files properly. See the installation docs for some information about where to download it for your computer. See the [[phpinfo]] page for details about the content of this page.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==What &amp;amp; where are Moodle&#039;s configuration settings stored?==&lt;br /&gt;
Configuration settings are stored in the config.php file stored in your moodle folder. This file is created during the installation process. If there is a problem and the installation cannot create the file, you can try creating it manually from the [[Configuration file]] docs. &lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
It is possible to download previous versions of Moodle that are not found on the  [http://download.moodle.org Standard Moodle Download page].  There are zip and tgz compressed located at &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]&amp;lt;/nowiki&amp;gt; (see links below). &lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:75%; height:75px&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
| 2.0 Versions || [http://download.moodle.org/stable19 1.9 Versions]  || [http://download.moodle.org/stable18 1.8 Versions] &lt;br /&gt;
|- &lt;br /&gt;
|[http://download.moodle.org/stable17 1.7 Versions] || [http://download.moodle.org/stable16 1.6 Versions] || [http://download.moodle.org/stable15/ 1.5 Versions] &lt;br /&gt;
|-&lt;br /&gt;
| [http://download.moodle.org/stable14 1.4 Versions] || [http://download.moodle.org/stable13 1.3 Versions]  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You can download previous releases by using wget, lynx or curl with this URL:&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]&amp;lt;/nowiki&amp;gt;. &lt;br /&gt;
:For example: to download Moodle version 1.5, use &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable15&amp;lt;/nowiki&amp;gt;. You&#039;ll see a directory tree with the files displayed. Click on the one you want and download as normal - if you require the latest update of the version, scroll to the end of the list and download the &amp;quot;moodle-latest&amp;quot; file.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download other releases not found in [http://download.moodle.org/windows/ Moodle packages for Windows], use this URL:&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/windows/MoodleWindowsInstaller-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Mac Packages&#039;&#039;&#039;: To download other releases not found in [http://download.moodle.org/macosx/ Mac packages], use either of these URLs (depending on whether you need the Intel or PPC package):&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/macosx/Moodle4Mac-Intel-[version_number].dmg&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/macosx/Moodle4Mac-PPC-[version_number}.dmg&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== How to enable and check PHP error logs==&lt;br /&gt;
PHP can be set up to log errors in a variety of different ways: two of these involve the use of the php.ini file and the ini_set command.  See [[PHP error logs]].&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Could not find a top level course&amp;quot; ==&lt;br /&gt;
If this appears immediately after you have attempted to install Moodle it almost certainly means that the installation did not complete. A complete installation will ask you for the administrator profile and to name the site just before it completes. Check your logs for errors. Then drop the database and start again. If you used the web-based installer try the command line one. Does your computer definitely have sufficient resource to run Moodle?&lt;br /&gt;
&lt;br /&gt;
==Email copies are not being sent from my forums==&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;must&#039;&#039; set up cron properly if you want Moodle to send out automatic email from forums, assignments etc. This same process also performs a number of clean-up tasks such as deleting old unconfirmed users, unenrolling old students and so on. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Try the default settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. This generally works. Except...&lt;br /&gt;
* On a Windows server you *must* supply the address of an SMTP server (Windows, unlike Unix, does not have a build in mail server) in the above settings page&lt;br /&gt;
* Make sure that &#039;&#039;allowuseremailcharset&#039;&#039; in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039; is set to No unless you really know what you are doing. Setting this to Yes can cause a problem in some versions of Moodle.&lt;br /&gt;
* Check your firewall or ask your network administrator. Many mail servers are heavily locked down and you may need permission to send mail through them.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t log in - I just stay stuck on the login screen==&lt;br /&gt;
&lt;br /&gt;
This may also apply if you are seeing  “Your session has timed out. Please login again” or &amp;quot;A server error that affects your login session was detected. Please login again or restart your browser&amp;quot; and cannot log in.&lt;br /&gt;
&lt;br /&gt;
The following are possible causes and actions you can take (in no particular order):&lt;br /&gt;
&lt;br /&gt;
* Check first that your main admin account (which will be a manual account) is also a problem. If your users are using an external authentication method (e.g. LDAP) that could be the problem. Isolate the fault and make sure it really is Moodle before going any further.&lt;br /&gt;
* Check that your hard disk is not full or if your server is on shared hosting check that you have not reached your disk space quota. This will prevent new sessions being created and nobody will be able to log in. &lt;br /&gt;
* Carefully check the permissions in your &#039;moodledata&#039; area. The web server needs to be able to write to the &#039;sessions&#039; subdirectory. &lt;br /&gt;
* Your own computer (not your Moodle server) may have a firewall that is stripping referrer information from the browser. Here are some instructions for fixing [http://service1.symantec.com/SUPPORT/nip.nsf/46f26a2d6dafb0a788256bc7005c3fa3/b9b47ad7eddd343b88256c6b006a85a8?OpenDocument&amp;amp;src=bar_sch_nam Norton firewall products].&lt;br /&gt;
* Try deleting the &#039;&#039;sessions&#039;&#039; folder in your moodledata directory (anybody currently logged in will be thrown out)&lt;br /&gt;
* Try deleting cookies on your computer and/or try another browser or another client computer&lt;br /&gt;
* In &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; Session Handling&#039;&#039;, try setting a value for &#039;Cookie prefix&#039;. You can also do this by setting &amp;lt;code&amp;gt;$CFG-&amp;gt;sessioncookie=&#039;something&#039;;&amp;lt;/code&amp;gt; in config.php. This is especially true if you are using multiple Moodles on the same browser. &lt;br /&gt;
* Make sure you have not removed or changed the [[Password salting|Password Salt]] value(s) in config.php. If passwords were created using a salt the correct salt must be in config.php for those passwords to continue to work. This is easily done if you recreate config.php while performing an upgrade and forget to transfer the salt values. &lt;br /&gt;
* Do you have a .htaccess file in your Moodle folder (or its parent directories). If so, is there anything in there that might be causing trouble (strange redirects, access restrictions etc.)?&lt;br /&gt;
* Check the value of &#039;&#039;&#039;mnet_localhost_id&#039;&#039;&#039; in the mdl_config database table. It&#039;s normally 1 but must match the &#039;&#039;&#039;mnet_hostid&#039;&#039;&#039; field in your user records in the mdl_user table for the user to be recognised. It can sometimes get changed spuriously during upgrades or site migrations. &lt;br /&gt;
* Check config.php - it should NOT have any spaces/new lines at the end of code.&lt;br /&gt;
* You are using the correct username and password, yes?&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page. You &#039;&#039;&#039;could&#039;&#039;&#039; also try changing the admin password. Proceed as if you have lost it - see [[Administration FAQ]].&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==I log in but the login link doesn&#039;t change. I am logged in and can navigate freely.==&lt;br /&gt;
&lt;br /&gt;
Make sure the URL in your &amp;lt;code&amp;gt;$CFG-&amp;gt;wwwroot&amp;lt;/code&amp;gt; setting is exactly the same as the one you are actually using to access the site.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Uploaded files give &amp;quot;File not found&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
For example: Not Found: The requested URL /moodle/file.php/2/myfile.jpg was not found on this server.&lt;br /&gt;
&lt;br /&gt;
Your web server needs to be configured to allow the part of the URL after a script name to be passed directly to the script. This is usually enabled in Apache 1, but is usually disabled by default in Apache 2. To turn it on, add this line to your &#039;&#039;httpd.conf&#039;&#039;, or to a &#039;&#039;.htaccess&#039;&#039; file in your local directory (see [[Installing Moodle]] for more details):&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
Note, this will ONLY work for Apache versions 2.x.&lt;br /&gt;
&lt;br /&gt;
For IIS you need to configure URL rewriting. This feature is not available in IIS 6 so you need to install a 3rd party IIS extension - see http://msdn.microsoft.com/en-us/library/ms972974.aspx. &lt;br /&gt;
&lt;br /&gt;
IIS 7 now comes with the new URL Rewrite Module so a 3rd part extension is no longer required if you are running IIS 7. See http://learn.iis.net/page.aspx/734/url-rewrite-module for more details.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve got URL rewriting working the recommended rewriting rule is:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;RewriteRule&#039;&#039;&#039; ^([^\?]+?\.php)(\/.+)$ $1\?file=$2 [QSA]&lt;br /&gt;
&lt;br /&gt;
In theory you could try to use path info on IIS too, but it is not reliable, especially when using unicode file names.&lt;br /&gt;
&lt;br /&gt;
If you are unable to configure your server properly then you can switch Moodle to use an alternative method. The major disadvantages is that you will not be able to use SCORM packages at all and some Adobe Flash and Java applets will not work either.&lt;br /&gt;
&lt;br /&gt;
To use this alternative method, you should change the &#039;&#039;slasharguments&#039;&#039; variable. For moodle versions &amp;lt; 1.7, this is located in the Operating System section of &#039;&#039;Administration &amp;gt; Configuration &amp;gt; [[admin/config|Variables]]&#039;&#039;. In later versions, this option is located in &#039;&#039;Site Administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;. You should now be able to access your uploaded files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=145422 Troubleshooting Guide - 404 Errors] forum discussion.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Why are all my pages blank?==&lt;br /&gt;
&lt;br /&gt;
Check the dirroot variable in &#039;&#039;config.php&#039;&#039;. You must use complete, absolute pathnames (e.g.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dirroot = &amp;quot;/var/www/moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL (or whatever other database you are using). This is common on RedHat and OpenBSD installations. In this case, an error is generated, but since error displays are often disabled by default, all that is seen on the browser is a blank screen. To enable PHP error displays see [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | How to enable and check PHP error logs]].&lt;br /&gt;
&lt;br /&gt;
To determine if database support is your problem, insert this as the second line in your &#039;&#039;config.php&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
phpinfo();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if you chosen database is supported. If not, look for a package you are missing.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== Why is a particular page blank or incomplete? ==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your web server log files!!&#039;&#039;&#039; &lt;br /&gt;
:If a particular page is blank or incomplete (it doesn&#039;t display the footer), before you do anything else switch on [[Debugging]] and  [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your PHP error logs]]. Having established that PHP error logging is working, reproduce the error. Immediately check the error log file right at the end. Hopefully you will see a PHP error message at or very near the end of the file. This may solve your problem directly or makes it a lot easier to diagnose the problem in the Moodle forums.&lt;br /&gt;
&lt;br /&gt;
*If you are &#039;&#039;&#039;upgrading to a new version of Moodle&#039;&#039;&#039;, check that you do not have an old version of a non-standard block or module installed. Remove any such blocks or modules installed using the admin settings page and start the install process again. However, do also make sure that you have included all optional plugins that were required by your courses. This is particularly common with &amp;quot;editing on&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*If you &#039;&#039;&#039;do not see any blocks listed&#039;&#039;&#039;, turn editing on and remove any blocks that you have added to that page and try reloading.&lt;br /&gt;
&lt;br /&gt;
*You may get this error immediately after &#039;&#039;&#039;selecting a language&#039;&#039;&#039;. At this stage of the installation process your Moodle computer may need to connect to the Internet and download a language pack, so check that the computer can access the Internet by using a browser. Check also that your PHP settings are as given in the Moodle [[Installing_Moodle#Requirements | Moodle Requirements]] page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=97734 PHP configuration error] forum discussion&lt;br /&gt;
&lt;br /&gt;
==Installation hangs when setting-up database tables==&lt;br /&gt;
Sometimes the installation will hang when setting up tables, where only half the page displayed in the browser and/or other outputs are removed.  You may see truncated MySQL statements, or the “Scroll to continue” link is displayed but no “Continue” button is there. &lt;br /&gt;
&lt;br /&gt;
See [[Unexpected installation halts]] for more about solutions that involve:&lt;br /&gt;
*Checking for MySQL limits&lt;br /&gt;
*Checking the .htaccess files &lt;br /&gt;
*Code customizations issues&lt;br /&gt;
*Checking memory limit &lt;br /&gt;
*Upgrade incrementally&lt;br /&gt;
*Fix fopen function&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Why can&#039;t I upload a new image into my profile?==&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see anything on your user profile pages to let you upload user images then it&#039;s usually one of the following:&lt;br /&gt;
*The permissions associated with the role you are using are preventing you from changing your profile picture.&lt;br /&gt;
* GD is not installed, or is not enabled on your server. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going to &#039;&#039;Site Administration &amp;gt; Server &amp;gt; PHP info&#039;&#039; and looking for the gdversion setting. This setting is chosen automatically every time you visit that page. If it shows GD version 1 or version 2 then everything should be fine. Save that configuration page and go back to your user profile.&lt;br /&gt;
* GD is installed, but is in some way corrupt. For instance, [http://moodle.org/mod/forum/discuss.php?d=44271#p386194 see this discussion on empty lines or white spaces in config files.]&lt;br /&gt;
GD is a library that allows image processing. For example, when all is well with your system, and you upload a new profile image, GD compresses the image and produces two thumbnails, one is 100x100 pixels, and the other is 35x35 pixels.&lt;br /&gt;
&lt;br /&gt;
If Moodle thinks GD is not installed, then you will need to &#039;&#039;&#039;install the GD library&#039;&#039;&#039;. &lt;br /&gt;
*On Unix you may need to re-compile PHP with arguments something like this:&lt;br /&gt;
&lt;br /&gt;
 ./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --with-gd &lt;br /&gt;
 --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-ttf --enable-gd-native-ttf &lt;br /&gt;
 --enable-magic-quotes --with-mysql --enable-sockets --enable-track-vars &lt;br /&gt;
 --enable-versioning --with-zlib&lt;br /&gt;
&lt;br /&gt;
* On Windows this is usually a matter of &amp;quot;turning on&amp;quot; the extension in PHP by editing your php.ini file. To do this remove the semicolon for the php_gd2.dll extension - check that this file is actually present in your php extensions  folder first (search your php.ini for extension_dir to determine where this points to on your hard disk). You should then have a line that looks like this:&lt;br /&gt;
 extension=php_gd2.dll&lt;br /&gt;
&lt;br /&gt;
:Windows users should see the [[Installing AMP|installation instructions]] for further help. &lt;br /&gt;
&lt;br /&gt;
3. Remember to &#039;&#039;&#039;restart your webserver&#039;&#039;&#039; (if possible) and re-visit the Moodle configuration page after making any changes to PHP so it can pick up the correct version of GD.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;: Using Moodle forum discussion [http://moodle.org/mod/forum/discuss.php?d=44271 Profile pictures] for additional information.&lt;br /&gt;
&lt;br /&gt;
== Why doesn&#039;t my Moodle site display the time and date correctly? ==&lt;br /&gt;
&lt;br /&gt;
Each language requires a specific language code (called a &#039;&#039;&#039;locale&#039;&#039;&#039; code) to allow dates to be displayed correctly. The language packs contain default standard codes, but sometimes these don&#039;t work on Windows servers.&lt;br /&gt;
&lt;br /&gt;
You can find the correct locale codes for Windows on these two pages: [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp Language codes] and [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_country_strings.asp Country/region] codes (e.g. &amp;quot;esp_esp&amp;quot; for spanish)&lt;br /&gt;
&lt;br /&gt;
These new locale codes can be entered on the Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]] page, where they override the ones in the currently chosen language pack.&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
== How do I uninstall Moodle?==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Webhost/manual installation&#039;&#039;&#039;: If you have installed Moodle manually or have installed onto a webhost, follow these steps:&lt;br /&gt;
*Delete the moodle database using this mysql command (or delete using your mysql client, e.g. PHPMyAdmin):&lt;br /&gt;
&amp;lt;pre&amp;gt;sql&amp;gt;DROP DATABASE moodle;&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above example replace &#039;moodle&#039; with the name of the moodle database you created when installing.&lt;br /&gt;
*Delete the moodledata directory. If you, or your users, have uploaded materials into this directory take a copy of these before deleting this directory.&lt;br /&gt;
*Delete the moodle directory itself. This will delete all of the moodle PHP script files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XAMPP windows installation&#039;&#039;&#039;: If you have installed Moodle on windows through the XAMPP package, follow these steps:&lt;br /&gt;
*Open cmd.exe and navigate to this directory within your installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;server/mysql/bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Run this command, replacing USERNAME with your database username (the default is &amp;quot;root&amp;quot;) and DATABASE with your database name (the default is &amp;quot;moodle&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;mysqladmin.exe -u USERNAME -p drop DATABASE&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Enter your database password at the prompt (the default is &amp;quot;&amp;quot; [blank]).&lt;br /&gt;
*Enter &amp;quot;y&amp;quot; to confirm the database drop.&lt;br /&gt;
*Delete the moodledata directory. If you, or your users, have uploaded materials into this directory take a copy of these before deleting this directory.&lt;br /&gt;
*Delete the moodle directory itself. This will delete all of the moodle PHP script files.&lt;br /&gt;
&lt;br /&gt;
==Migrating Moodle to a new site or server==&lt;br /&gt;
Migrating Moodle means that you have to move the current installation to a new server, and so may have to change IP addresses or DNS entries. To do this you will need to change the $CFG-&amp;gt;wwwroot value in the config.php on the new server. You will also have to change any absolute links stored in the database backup file (before restoring the file on the new server) either using the admin/replace.php script, your text editor or another &amp;quot;search and replace&amp;quot; tool, e.g. sed. For more details see the [[Moodle_migration | Moodle Migration]] page.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Why does my new installation display correctly on the server, but when I view it from a different machine, styles and images are missing?==&lt;br /&gt;
In the installation instructions, one of the suggested settings for &#039;webroot&#039; is &#039;localhost&#039;. This is fine if all you want to do is some local testing of your new Moodle installation. If, however, you want to view your new installation from another machine on the same local area network, or view your site on the internet, you will have to change this setting:&lt;br /&gt;
*For local testing, &#039;localhost&#039; is fine for the webroot ($CFG-&amp;gt;wwwroot in config.php). &lt;br /&gt;
*If you want to test your site from other machines on the same local area network (LAN), then you will have to use the private ip address of the serving machine, (e.g. 192.168.1.2/moodle) or the network name of the serving computer (e.g. network_name_of_serving_machine/moodle) as the web root. Depending on your LAN setup, it may be better to use the network name of the computer rather than its (private) ip address, because the ip address can and will change from time to time. If you don&#039;t want to use the network name, then you will have to speak to your network administrator and have them assign a permanent ip address to the serving machine.&lt;br /&gt;
*Finally, if you want to test your new installation across the internet, you will have to use either a domain name or a permanent (public) ip address/moodle as your web root. To handle both types of access, see [https://docs.moodle.org/en/masquerading masquerading].&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Maximum upload file size - how to change it?==&lt;br /&gt;
There are several places to change the maximum file upload size. The first place to check is the Administration block.   Security -&amp;gt; Site Policies -&amp;gt; and look for &amp;quot;Maximum Uploaded File Size&amp;quot;.  This is the &amp;quot;maxbyte&amp;quot; variable found in older versions of Moodle (under Admin &amp;gt; Variables). Teachers may also set the maximum file size by the [[Course_settings#Maximum_upload_size|course administration block]].&lt;br /&gt;
&lt;br /&gt;
If the above does not provide a large enough figure you will need to make changes in your server settings. The usual place is in your php.ini file (go to Site administration &amp;gt; Server &amp;gt; PHPinfo and check a few lines down for its location). Look for settings &#039;&#039;&#039;upload_max_filesize&#039;&#039;&#039; and &#039;&#039;&#039;post_max_size&#039;&#039;&#039;, setting them both to your desired new value (e.g. &#039;64MB&#039;). You will need to restart the web server for these changes to take effect - e.g. on Linux, &#039;&#039;&#039;/etc/init.d/apache2 force-reload&#039;&#039;&#039;. Check your documentation or just reboot the server. &lt;br /&gt;
&lt;br /&gt;
For more help see:&lt;br /&gt;
*[[Administration_FAQ#How_do_the_limits_on_uploaded_files_work.3F]]&lt;br /&gt;
*[[Installing_Moodle#Recheck_PHP_settings]]&lt;br /&gt;
*[[Installing_Moodle#Using_a_.htaccess_file_for_webserver_and_PHP_settings]]&lt;br /&gt;
*[[Site_policies#Maximum_uploaded_file_size]]&lt;br /&gt;
*These forum posts: http://moodle.org/mod/forum/discuss.php?d=63840#287960 and http://moodle.org/mod/forum/discuss.php?d=93882#p414650&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Moodle claims PHP float handling is not compatible==&lt;br /&gt;
&lt;br /&gt;
The symptom is that when you try to install or upgrade your Moodle, you get a message &amp;quot;Detected unexpected problem in handling of PHP float numbers&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[http://moodle.org/mod/forum/discuss.php?d=114945 This forum thread] and MDL-18253 have more information. In short, this problem should not happen, you can help us by telling posting information about exactly which version of PHP, and OS you are using. That may let us find a way to work around this problem.&lt;br /&gt;
&lt;br /&gt;
You may be able to solve this issue by installing a more recent PHP versions. If you compile PHP yourself from source, changing the compilation options may help. However, since we don&#039;t understand the cause, we don&#039;t really know. If you do find a solution that works for you, please do tell us about it.&lt;br /&gt;
&lt;br /&gt;
Update: we have a guess that the problem may be the [http://au2.php.net/manual/en/ini.core.php#ini.precision &#039;precision&#039; setting in your php.ini file]. In a default PHP install this is set of 14. On at least one server that exhibited this problem it had been changed to a smaller value. So, if you see this problem, please try adding &lt;br /&gt;
 ini_set(&#039;precision&#039;, 14);&lt;br /&gt;
to your config.php file, and report your success in MDL-18253.&lt;br /&gt;
&lt;br /&gt;
==When upgrading Moodle claims my database is not UTF8 when I&#039;m sure it is==&lt;br /&gt;
&lt;br /&gt;
The symptom is that you are upgrading a post-1.6 Moodle to a newer version. The Environment check tells you that your database is not UTF8 and refuses to upgrade. &lt;br /&gt;
&lt;br /&gt;
The database may not have it&#039;s character encoding set quite correctly. You can safely try this command on the database (mySQL):&lt;br /&gt;
&lt;br /&gt;
    ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&lt;br /&gt;
&lt;br /&gt;
(Change &#039;moodle&#039; for the name of your database). You need to copy this into your MySQL client program that comes packaged with it. &lt;br /&gt;
&lt;br /&gt;
Alternatively, you maybe adding a new clean install Moodle version to an existing web server and the UTF8 check error will not allow you to proceed.  Use [[phpMyAdmin]] to help you.  This web client is available as a plugin for Moodle or through your web hosting control panel. Using this program, create an empty database (for example moodle199) and make sure &amp;quot;MySQL connection collation&amp;quot; is a utf8 entry, such as utf8_general_ci. Go back to the Moodle installation screen with the check error, hit the previous button on the bottom and make sure the databae has the same name as your new empty database (for example moodle199). &lt;br /&gt;
&lt;br /&gt;
If your Moodle site is version 1.5 or older then it&#039;s telling the truth. &lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== How do I run multiple instances of Moodle without duplicating base code? ==&lt;br /&gt;
&lt;br /&gt;
See [http://moodle.org/mod/forum/discuss.php?d=13211 this thread] for a detailed explanation by [[User:Martin_Langhoff| Martin Langhoff]].&lt;br /&gt;
&lt;br /&gt;
== What is FreeTDS and how can I use it in my installation? ==&lt;br /&gt;
[[FreeTDS]] is an open source implementation of the Tabular Data Stream protocol used by Microsoft SQL Server and Sybase for their databases. Unfortunately, Microsoft servers don&#039;t usually accept TDS 5.0 connections. FreeTDS allows your Unix/Linux applications to talk to these other database products and import and export data between different systems successfully.&lt;br /&gt;
&lt;br /&gt;
== How do I install a plugin? ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Installing plugins]].&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t enable a plugin on the Plugins overview page because the icon is not clickable==&lt;br /&gt;
The open and closed eye icon on the Plugins overview page is simply there to show whether or not a plugin is enabled. You can&#039;t edit plugins from this screen. If you wish to enable a plugin, to to the appropriate page for managing the type of plugin you need, for instance &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Repositories&amp;gt;Manage repositories&#039;&#039; or &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Activity modules&amp;gt;Manage activities.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* [[Beginning_Moodle_2.0_Administration|Beginning Moodle 2.0 Administration FAQ]]&lt;br /&gt;
* [https://docs.moodle.org/24/en/Install_Moodle2.2_on_godaddy Installing on GoDaddy]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[de:Installation FAQ]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installation_FAQ&amp;diff=103184</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installation_FAQ&amp;diff=103184"/>
		<updated>2013-02-15T15:37:52Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* &amp;quot;A top level course could not be found&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
== System information needed for Installation problems forum ==&lt;br /&gt;
When posting questions to the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum], try to provide as much background information as possible about your Moodle system. Consider providing some or all of the following:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* PHP version (e.g. PHP 5.3.2)&lt;br /&gt;
* Database server type and version (e.g. MySQL 5.5.18)&lt;br /&gt;
* Browser and version (e.g. Internet Explorer 8):&lt;br /&gt;
* Moodle version (e.g. 2.1):&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached (please remove passwords):&lt;br /&gt;
* Phpinfo attached?:&lt;br /&gt;
&lt;br /&gt;
Make sure you provide a sensible description (never HELP! or URGENT!) and a full description of what you did and what happened. Copy and paste any error messages accurately in full. &#039;Nothing&#039; is not a symptom, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==PHP - is it installed and what version do I have?==&lt;br /&gt;
&lt;br /&gt;
Make a new file on your web site called &#039;&#039;info.php&#039;&#039;, containing the following text, and call it from your browser:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?PHP phpinfo() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If nothing happens then you don&#039;t have PHP installed or your webserver is not configured to handle .php files properly. See the installation docs for some information about where to download it for your computer. See the [[phpinfo]] page for details about the content of this page.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==What &amp;amp; where are Moodle&#039;s configuration settings stored?==&lt;br /&gt;
Configuration settings are stored in the config.php file stored in your moodle folder. This file is created during the installation process. If there is a problem and the installation cannot create the file, you can try creating it manually from the [[Configuration file]] docs. &lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
It is possible to download previous versions of Moodle that are not found on the  [http://download.moodle.org Standard Moodle Download page].  There are zip and tgz compressed located at &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]&amp;lt;/nowiki&amp;gt; (see links below). &lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:75%; height:75px&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
| 2.0 Versions || [http://download.moodle.org/stable19 1.9 Versions]  || [http://download.moodle.org/stable18 1.8 Versions] &lt;br /&gt;
|- &lt;br /&gt;
|[http://download.moodle.org/stable17 1.7 Versions] || [http://download.moodle.org/stable16 1.6 Versions] || [http://download.moodle.org/stable15/ 1.5 Versions] &lt;br /&gt;
|-&lt;br /&gt;
| [http://download.moodle.org/stable14 1.4 Versions] || [http://download.moodle.org/stable13 1.3 Versions]  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You can download previous releases by using wget, lynx or curl with this URL:&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]&amp;lt;/nowiki&amp;gt;. &lt;br /&gt;
:For example: to download Moodle version 1.5, use &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable15&amp;lt;/nowiki&amp;gt;. You&#039;ll see a directory tree with the files displayed. Click on the one you want and download as normal - if you require the latest update of the version, scroll to the end of the list and download the &amp;quot;moodle-latest&amp;quot; file.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download other releases not found in [http://download.moodle.org/windows/ Moodle packages for Windows], use this URL:&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/windows/MoodleWindowsInstaller-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Mac Packages&#039;&#039;&#039;: To download other releases not found in [http://download.moodle.org/macosx/ Mac packages], use either of these URLs (depending on whether you need the Intel or PPC package):&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/macosx/Moodle4Mac-Intel-[version_number].dmg&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/macosx/Moodle4Mac-PPC-[version_number}.dmg&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== How to enable and check PHP error logs==&lt;br /&gt;
PHP can be set up to log errors in a variety of different ways: two of these involve the use of the php.ini file and the ini_set command.  See [[PHP error logs]].&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;ACould not find a top level course&amp;quot; ==&lt;br /&gt;
If this appears immediately after you have attempted to install Moodle it almost certainly means that the installation did not complete. A complete installation will ask you for the administrator profile and to name the site just before it completes. Check your logs for errors. Then drop the database and start again. If you used the web-based installer try the command line one. Does your computer definitely have sufficient resource to run Moodle?&lt;br /&gt;
&lt;br /&gt;
==Email copies are not being sent from my forums==&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;must&#039;&#039; set up cron properly if you want Moodle to send out automatic email from forums, assignments etc. This same process also performs a number of clean-up tasks such as deleting old unconfirmed users, unenrolling old students and so on. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Try the default settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. This generally works. Except...&lt;br /&gt;
* On a Windows server you *must* supply the address of an SMTP server (Windows, unlike Unix, does not have a build in mail server) in the above settings page&lt;br /&gt;
* Make sure that &#039;&#039;allowuseremailcharset&#039;&#039; in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039; is set to No unless you really know what you are doing. Setting this to Yes can cause a problem in some versions of Moodle.&lt;br /&gt;
* Check your firewall or ask your network administrator. Many mail servers are heavily locked down and you may need permission to send mail through them.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t log in - I just stay stuck on the login screen==&lt;br /&gt;
&lt;br /&gt;
This may also apply if you are seeing  “Your session has timed out. Please login again” or &amp;quot;A server error that affects your login session was detected. Please login again or restart your browser&amp;quot; and cannot log in.&lt;br /&gt;
&lt;br /&gt;
The following are possible causes and actions you can take (in no particular order):&lt;br /&gt;
&lt;br /&gt;
* Check first that your main admin account (which will be a manual account) is also a problem. If your users are using an external authentication method (e.g. LDAP) that could be the problem. Isolate the fault and make sure it really is Moodle before going any further.&lt;br /&gt;
* Check that your hard disk is not full or if your server is on shared hosting check that you have not reached your disk space quota. This will prevent new sessions being created and nobody will be able to log in. &lt;br /&gt;
* Carefully check the permissions in your &#039;moodledata&#039; area. The web server needs to be able to write to the &#039;sessions&#039; subdirectory. &lt;br /&gt;
* Your own computer (not your Moodle server) may have a firewall that is stripping referrer information from the browser. Here are some instructions for fixing [http://service1.symantec.com/SUPPORT/nip.nsf/46f26a2d6dafb0a788256bc7005c3fa3/b9b47ad7eddd343b88256c6b006a85a8?OpenDocument&amp;amp;src=bar_sch_nam Norton firewall products].&lt;br /&gt;
* Try deleting the &#039;&#039;sessions&#039;&#039; folder in your moodledata directory (anybody currently logged in will be thrown out)&lt;br /&gt;
* Try deleting cookies on your computer and/or try another browser or another client computer&lt;br /&gt;
* In &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; Session Handling&#039;&#039;, try setting a value for &#039;Cookie prefix&#039;. You can also do this by setting &amp;lt;code&amp;gt;$CFG-&amp;gt;sessioncookie=&#039;something&#039;;&amp;lt;/code&amp;gt; in config.php. This is especially true if you are using multiple Moodles on the same browser. &lt;br /&gt;
* Make sure you have not removed or changed the [[Password salting|Password Salt]] value(s) in config.php. If passwords were created using a salt the correct salt must be in config.php for those passwords to continue to work. This is easily done if you recreate config.php while performing an upgrade and forget to transfer the salt values. &lt;br /&gt;
* Do you have a .htaccess file in your Moodle folder (or its parent directories). If so, is there anything in there that might be causing trouble (strange redirects, access restrictions etc.)?&lt;br /&gt;
* Check the value of &#039;&#039;&#039;mnet_localhost_id&#039;&#039;&#039; in the mdl_config database table. It&#039;s normally 1 but must match the &#039;&#039;&#039;mnet_hostid&#039;&#039;&#039; field in your user records in the mdl_user table for the user to be recognised. It can sometimes get changed spuriously during upgrades or site migrations. &lt;br /&gt;
* Check config.php - it should NOT have any spaces/new lines at the end of code.&lt;br /&gt;
* You are using the correct username and password, yes?&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page. You &#039;&#039;&#039;could&#039;&#039;&#039; also try changing the admin password. Proceed as if you have lost it - see [[Administration FAQ]].&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==I log in but the login link doesn&#039;t change. I am logged in and can navigate freely.==&lt;br /&gt;
&lt;br /&gt;
Make sure the URL in your &amp;lt;code&amp;gt;$CFG-&amp;gt;wwwroot&amp;lt;/code&amp;gt; setting is exactly the same as the one you are actually using to access the site.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Uploaded files give &amp;quot;File not found&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
For example: Not Found: The requested URL /moodle/file.php/2/myfile.jpg was not found on this server.&lt;br /&gt;
&lt;br /&gt;
Your web server needs to be configured to allow the part of the URL after a script name to be passed directly to the script. This is usually enabled in Apache 1, but is usually disabled by default in Apache 2. To turn it on, add this line to your &#039;&#039;httpd.conf&#039;&#039;, or to a &#039;&#039;.htaccess&#039;&#039; file in your local directory (see [[Installing Moodle]] for more details):&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
Note, this will ONLY work for Apache versions 2.x.&lt;br /&gt;
&lt;br /&gt;
For IIS you need to configure URL rewriting. This feature is not available in IIS 6 so you need to install a 3rd party IIS extension - see http://msdn.microsoft.com/en-us/library/ms972974.aspx. &lt;br /&gt;
&lt;br /&gt;
IIS 7 now comes with the new URL Rewrite Module so a 3rd part extension is no longer required if you are running IIS 7. See http://learn.iis.net/page.aspx/734/url-rewrite-module for more details.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve got URL rewriting working the recommended rewriting rule is:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;RewriteRule&#039;&#039;&#039; ^([^\?]+?\.php)(\/.+)$ $1\?file=$2 [QSA]&lt;br /&gt;
&lt;br /&gt;
In theory you could try to use path info on IIS too, but it is not reliable, especially when using unicode file names.&lt;br /&gt;
&lt;br /&gt;
If you are unable to configure your server properly then you can switch Moodle to use an alternative method. The major disadvantages is that you will not be able to use SCORM packages at all and some Adobe Flash and Java applets will not work either.&lt;br /&gt;
&lt;br /&gt;
To use this alternative method, you should change the &#039;&#039;slasharguments&#039;&#039; variable. For moodle versions &amp;lt; 1.7, this is located in the Operating System section of &#039;&#039;Administration &amp;gt; Configuration &amp;gt; [[admin/config|Variables]]&#039;&#039;. In later versions, this option is located in &#039;&#039;Site Administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;. You should now be able to access your uploaded files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=145422 Troubleshooting Guide - 404 Errors] forum discussion.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Why are all my pages blank?==&lt;br /&gt;
&lt;br /&gt;
Check the dirroot variable in &#039;&#039;config.php&#039;&#039;. You must use complete, absolute pathnames (e.g.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dirroot = &amp;quot;/var/www/moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL (or whatever other database you are using). This is common on RedHat and OpenBSD installations. In this case, an error is generated, but since error displays are often disabled by default, all that is seen on the browser is a blank screen. To enable PHP error displays see [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | How to enable and check PHP error logs]].&lt;br /&gt;
&lt;br /&gt;
To determine if database support is your problem, insert this as the second line in your &#039;&#039;config.php&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
phpinfo();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if you chosen database is supported. If not, look for a package you are missing.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== Why is a particular page blank or incomplete? ==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your web server log files!!&#039;&#039;&#039; &lt;br /&gt;
:If a particular page is blank or incomplete (it doesn&#039;t display the footer), before you do anything else switch on [[Debugging]] and  [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your PHP error logs]]. Having established that PHP error logging is working, reproduce the error. Immediately check the error log file right at the end. Hopefully you will see a PHP error message at or very near the end of the file. This may solve your problem directly or makes it a lot easier to diagnose the problem in the Moodle forums.&lt;br /&gt;
&lt;br /&gt;
*If you are &#039;&#039;&#039;upgrading to a new version of Moodle&#039;&#039;&#039;, check that you do not have an old version of a non-standard block or module installed. Remove any such blocks or modules installed using the admin settings page and start the install process again. However, do also make sure that you have included all optional plugins that were required by your courses. This is particularly common with &amp;quot;editing on&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*If you &#039;&#039;&#039;do not see any blocks listed&#039;&#039;&#039;, turn editing on and remove any blocks that you have added to that page and try reloading.&lt;br /&gt;
&lt;br /&gt;
*You may get this error immediately after &#039;&#039;&#039;selecting a language&#039;&#039;&#039;. At this stage of the installation process your Moodle computer may need to connect to the Internet and download a language pack, so check that the computer can access the Internet by using a browser. Check also that your PHP settings are as given in the Moodle [[Installing_Moodle#Requirements | Moodle Requirements]] page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=97734 PHP configuration error] forum discussion&lt;br /&gt;
&lt;br /&gt;
==Installation hangs when setting-up database tables==&lt;br /&gt;
Sometimes the installation will hang when setting up tables, where only half the page displayed in the browser and/or other outputs are removed.  You may see truncated MySQL statements, or the “Scroll to continue” link is displayed but no “Continue” button is there. &lt;br /&gt;
&lt;br /&gt;
See [[Unexpected installation halts]] for more about solutions that involve:&lt;br /&gt;
*Checking for MySQL limits&lt;br /&gt;
*Checking the .htaccess files &lt;br /&gt;
*Code customizations issues&lt;br /&gt;
*Checking memory limit &lt;br /&gt;
*Upgrade incrementally&lt;br /&gt;
*Fix fopen function&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Why can&#039;t I upload a new image into my profile?==&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see anything on your user profile pages to let you upload user images then it&#039;s usually one of the following:&lt;br /&gt;
*The permissions associated with the role you are using are preventing you from changing your profile picture.&lt;br /&gt;
* GD is not installed, or is not enabled on your server. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going to &#039;&#039;Site Administration &amp;gt; Server &amp;gt; PHP info&#039;&#039; and looking for the gdversion setting. This setting is chosen automatically every time you visit that page. If it shows GD version 1 or version 2 then everything should be fine. Save that configuration page and go back to your user profile.&lt;br /&gt;
* GD is installed, but is in some way corrupt. For instance, [http://moodle.org/mod/forum/discuss.php?d=44271#p386194 see this discussion on empty lines or white spaces in config files.]&lt;br /&gt;
GD is a library that allows image processing. For example, when all is well with your system, and you upload a new profile image, GD compresses the image and produces two thumbnails, one is 100x100 pixels, and the other is 35x35 pixels.&lt;br /&gt;
&lt;br /&gt;
If Moodle thinks GD is not installed, then you will need to &#039;&#039;&#039;install the GD library&#039;&#039;&#039;. &lt;br /&gt;
*On Unix you may need to re-compile PHP with arguments something like this:&lt;br /&gt;
&lt;br /&gt;
 ./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --with-gd &lt;br /&gt;
 --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-ttf --enable-gd-native-ttf &lt;br /&gt;
 --enable-magic-quotes --with-mysql --enable-sockets --enable-track-vars &lt;br /&gt;
 --enable-versioning --with-zlib&lt;br /&gt;
&lt;br /&gt;
* On Windows this is usually a matter of &amp;quot;turning on&amp;quot; the extension in PHP by editing your php.ini file. To do this remove the semicolon for the php_gd2.dll extension - check that this file is actually present in your php extensions  folder first (search your php.ini for extension_dir to determine where this points to on your hard disk). You should then have a line that looks like this:&lt;br /&gt;
 extension=php_gd2.dll&lt;br /&gt;
&lt;br /&gt;
:Windows users should see the [[Installing AMP|installation instructions]] for further help. &lt;br /&gt;
&lt;br /&gt;
3. Remember to &#039;&#039;&#039;restart your webserver&#039;&#039;&#039; (if possible) and re-visit the Moodle configuration page after making any changes to PHP so it can pick up the correct version of GD.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;: Using Moodle forum discussion [http://moodle.org/mod/forum/discuss.php?d=44271 Profile pictures] for additional information.&lt;br /&gt;
&lt;br /&gt;
== Why doesn&#039;t my Moodle site display the time and date correctly? ==&lt;br /&gt;
&lt;br /&gt;
Each language requires a specific language code (called a &#039;&#039;&#039;locale&#039;&#039;&#039; code) to allow dates to be displayed correctly. The language packs contain default standard codes, but sometimes these don&#039;t work on Windows servers.&lt;br /&gt;
&lt;br /&gt;
You can find the correct locale codes for Windows on these two pages: [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp Language codes] and [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_country_strings.asp Country/region] codes (e.g. &amp;quot;esp_esp&amp;quot; for spanish)&lt;br /&gt;
&lt;br /&gt;
These new locale codes can be entered on the Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]] page, where they override the ones in the currently chosen language pack.&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
== How do I uninstall Moodle?==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Webhost/manual installation&#039;&#039;&#039;: If you have installed Moodle manually or have installed onto a webhost, follow these steps:&lt;br /&gt;
*Delete the moodle database using this mysql command (or delete using your mysql client, e.g. PHPMyAdmin):&lt;br /&gt;
&amp;lt;pre&amp;gt;sql&amp;gt;DROP DATABASE moodle;&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above example replace &#039;moodle&#039; with the name of the moodle database you created when installing.&lt;br /&gt;
*Delete the moodledata directory. If you, or your users, have uploaded materials into this directory take a copy of these before deleting this directory.&lt;br /&gt;
*Delete the moodle directory itself. This will delete all of the moodle PHP script files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XAMPP windows installation&#039;&#039;&#039;: If you have installed Moodle on windows through the XAMPP package, follow these steps:&lt;br /&gt;
*Open cmd.exe and navigate to this directory within your installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;server/mysql/bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Run this command, replacing USERNAME with your database username (the default is &amp;quot;root&amp;quot;) and DATABASE with your database name (the default is &amp;quot;moodle&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;mysqladmin.exe -u USERNAME -p drop DATABASE&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Enter your database password at the prompt (the default is &amp;quot;&amp;quot; [blank]).&lt;br /&gt;
*Enter &amp;quot;y&amp;quot; to confirm the database drop.&lt;br /&gt;
*Delete the moodledata directory. If you, or your users, have uploaded materials into this directory take a copy of these before deleting this directory.&lt;br /&gt;
*Delete the moodle directory itself. This will delete all of the moodle PHP script files.&lt;br /&gt;
&lt;br /&gt;
==Migrating Moodle to a new site or server==&lt;br /&gt;
Migrating Moodle means that you have to move the current installation to a new server, and so may have to change IP addresses or DNS entries. To do this you will need to change the $CFG-&amp;gt;wwwroot value in the config.php on the new server. You will also have to change any absolute links stored in the database backup file (before restoring the file on the new server) either using the admin/replace.php script, your text editor or another &amp;quot;search and replace&amp;quot; tool, e.g. sed. For more details see the [[Moodle_migration | Moodle Migration]] page.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Why does my new installation display correctly on the server, but when I view it from a different machine, styles and images are missing?==&lt;br /&gt;
In the installation instructions, one of the suggested settings for &#039;webroot&#039; is &#039;localhost&#039;. This is fine if all you want to do is some local testing of your new Moodle installation. If, however, you want to view your new installation from another machine on the same local area network, or view your site on the internet, you will have to change this setting:&lt;br /&gt;
*For local testing, &#039;localhost&#039; is fine for the webroot ($CFG-&amp;gt;wwwroot in config.php). &lt;br /&gt;
*If you want to test your site from other machines on the same local area network (LAN), then you will have to use the private ip address of the serving machine, (e.g. 192.168.1.2/moodle) or the network name of the serving computer (e.g. network_name_of_serving_machine/moodle) as the web root. Depending on your LAN setup, it may be better to use the network name of the computer rather than its (private) ip address, because the ip address can and will change from time to time. If you don&#039;t want to use the network name, then you will have to speak to your network administrator and have them assign a permanent ip address to the serving machine.&lt;br /&gt;
*Finally, if you want to test your new installation across the internet, you will have to use either a domain name or a permanent (public) ip address/moodle as your web root. To handle both types of access, see [https://docs.moodle.org/en/masquerading masquerading].&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Maximum upload file size - how to change it?==&lt;br /&gt;
There are several places to change the maximum file upload size. The first place to check is the Administration block.   Security -&amp;gt; Site Policies -&amp;gt; and look for &amp;quot;Maximum Uploaded File Size&amp;quot;.  This is the &amp;quot;maxbyte&amp;quot; variable found in older versions of Moodle (under Admin &amp;gt; Variables). Teachers may also set the maximum file size by the [[Course_settings#Maximum_upload_size|course administration block]].&lt;br /&gt;
&lt;br /&gt;
If the above does not provide a large enough figure you will need to make changes in your server settings. The usual place is in your php.ini file (go to Site administration &amp;gt; Server &amp;gt; PHPinfo and check a few lines down for its location). Look for settings &#039;&#039;&#039;upload_max_filesize&#039;&#039;&#039; and &#039;&#039;&#039;post_max_size&#039;&#039;&#039;, setting them both to your desired new value (e.g. &#039;64MB&#039;). You will need to restart the web server for these changes to take effect - e.g. on Linux, &#039;&#039;&#039;/etc/init.d/apache2 force-reload&#039;&#039;&#039;. Check your documentation or just reboot the server. &lt;br /&gt;
&lt;br /&gt;
For more help see:&lt;br /&gt;
*[[Administration_FAQ#How_do_the_limits_on_uploaded_files_work.3F]]&lt;br /&gt;
*[[Installing_Moodle#Recheck_PHP_settings]]&lt;br /&gt;
*[[Installing_Moodle#Using_a_.htaccess_file_for_webserver_and_PHP_settings]]&lt;br /&gt;
*[[Site_policies#Maximum_uploaded_file_size]]&lt;br /&gt;
*These forum posts: http://moodle.org/mod/forum/discuss.php?d=63840#287960 and http://moodle.org/mod/forum/discuss.php?d=93882#p414650&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Moodle claims PHP float handling is not compatible==&lt;br /&gt;
&lt;br /&gt;
The symptom is that when you try to install or upgrade your Moodle, you get a message &amp;quot;Detected unexpected problem in handling of PHP float numbers&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[http://moodle.org/mod/forum/discuss.php?d=114945 This forum thread] and MDL-18253 have more information. In short, this problem should not happen, you can help us by telling posting information about exactly which version of PHP, and OS you are using. That may let us find a way to work around this problem.&lt;br /&gt;
&lt;br /&gt;
You may be able to solve this issue by installing a more recent PHP versions. If you compile PHP yourself from source, changing the compilation options may help. However, since we don&#039;t understand the cause, we don&#039;t really know. If you do find a solution that works for you, please do tell us about it.&lt;br /&gt;
&lt;br /&gt;
Update: we have a guess that the problem may be the [http://au2.php.net/manual/en/ini.core.php#ini.precision &#039;precision&#039; setting in your php.ini file]. In a default PHP install this is set of 14. On at least one server that exhibited this problem it had been changed to a smaller value. So, if you see this problem, please try adding &lt;br /&gt;
 ini_set(&#039;precision&#039;, 14);&lt;br /&gt;
to your config.php file, and report your success in MDL-18253.&lt;br /&gt;
&lt;br /&gt;
==When upgrading Moodle claims my database is not UTF8 when I&#039;m sure it is==&lt;br /&gt;
&lt;br /&gt;
The symptom is that you are upgrading a post-1.6 Moodle to a newer version. The Environment check tells you that your database is not UTF8 and refuses to upgrade. &lt;br /&gt;
&lt;br /&gt;
The database may not have it&#039;s character encoding set quite correctly. You can safely try this command on the database (mySQL):&lt;br /&gt;
&lt;br /&gt;
    ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&lt;br /&gt;
&lt;br /&gt;
(Change &#039;moodle&#039; for the name of your database). You need to copy this into your MySQL client program that comes packaged with it. &lt;br /&gt;
&lt;br /&gt;
Alternatively, you maybe adding a new clean install Moodle version to an existing web server and the UTF8 check error will not allow you to proceed.  Use [[phpMyAdmin]] to help you.  This web client is available as a plugin for Moodle or through your web hosting control panel. Using this program, create an empty database (for example moodle199) and make sure &amp;quot;MySQL connection collation&amp;quot; is a utf8 entry, such as utf8_general_ci. Go back to the Moodle installation screen with the check error, hit the previous button on the bottom and make sure the databae has the same name as your new empty database (for example moodle199). &lt;br /&gt;
&lt;br /&gt;
If your Moodle site is version 1.5 or older then it&#039;s telling the truth. &lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== How do I run multiple instances of Moodle without duplicating base code? ==&lt;br /&gt;
&lt;br /&gt;
See [http://moodle.org/mod/forum/discuss.php?d=13211 this thread] for a detailed explanation by [[User:Martin_Langhoff| Martin Langhoff]].&lt;br /&gt;
&lt;br /&gt;
== What is FreeTDS and how can I use it in my installation? ==&lt;br /&gt;
[[FreeTDS]] is an open source implementation of the Tabular Data Stream protocol used by Microsoft SQL Server and Sybase for their databases. Unfortunately, Microsoft servers don&#039;t usually accept TDS 5.0 connections. FreeTDS allows your Unix/Linux applications to talk to these other database products and import and export data between different systems successfully.&lt;br /&gt;
&lt;br /&gt;
== How do I install a plugin? ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Installing plugins]].&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t enable a plugin on the Plugins overview page because the icon is not clickable==&lt;br /&gt;
The open and closed eye icon on the Plugins overview page is simply there to show whether or not a plugin is enabled. You can&#039;t edit plugins from this screen. If you wish to enable a plugin, to to the appropriate page for managing the type of plugin you need, for instance &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Repositories&amp;gt;Manage repositories&#039;&#039; or &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Activity modules&amp;gt;Manage activities.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* [[Beginning_Moodle_2.0_Administration|Beginning Moodle 2.0 Administration FAQ]]&lt;br /&gt;
* [https://docs.moodle.org/24/en/Install_Moodle2.2_on_godaddy Installing on GoDaddy]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[de:Installation FAQ]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/32/en/index.php?title=Installation_FAQ&amp;diff=103183</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/32/en/index.php?title=Installation_FAQ&amp;diff=103183"/>
		<updated>2013-02-15T15:16:27Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* How to enable and check PHP error logs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
== System information needed for Installation problems forum ==&lt;br /&gt;
When posting questions to the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum], try to provide as much background information as possible about your Moodle system. Consider providing some or all of the following:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* PHP version (e.g. PHP 5.3.2)&lt;br /&gt;
* Database server type and version (e.g. MySQL 5.5.18)&lt;br /&gt;
* Browser and version (e.g. Internet Explorer 8):&lt;br /&gt;
* Moodle version (e.g. 2.1):&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached (please remove passwords):&lt;br /&gt;
* Phpinfo attached?:&lt;br /&gt;
&lt;br /&gt;
Make sure you provide a sensible description (never HELP! or URGENT!) and a full description of what you did and what happened. Copy and paste any error messages accurately in full. &#039;Nothing&#039; is not a symptom, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==PHP - is it installed and what version do I have?==&lt;br /&gt;
&lt;br /&gt;
Make a new file on your web site called &#039;&#039;info.php&#039;&#039;, containing the following text, and call it from your browser:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?PHP phpinfo() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If nothing happens then you don&#039;t have PHP installed or your webserver is not configured to handle .php files properly. See the installation docs for some information about where to download it for your computer. See the [[phpinfo]] page for details about the content of this page.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==What &amp;amp; where are Moodle&#039;s configuration settings stored?==&lt;br /&gt;
Configuration settings are stored in the config.php file stored in your moodle folder. This file is created during the installation process. If there is a problem and the installation cannot create the file, you can try creating it manually from the [[Configuration file]] docs. &lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
It is possible to download previous versions of Moodle that are not found on the  [http://download.moodle.org Standard Moodle Download page].  There are zip and tgz compressed located at &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]&amp;lt;/nowiki&amp;gt; (see links below). &lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:75%; height:75px&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
| 2.0 Versions || [http://download.moodle.org/stable19 1.9 Versions]  || [http://download.moodle.org/stable18 1.8 Versions] &lt;br /&gt;
|- &lt;br /&gt;
|[http://download.moodle.org/stable17 1.7 Versions] || [http://download.moodle.org/stable16 1.6 Versions] || [http://download.moodle.org/stable15/ 1.5 Versions] &lt;br /&gt;
|-&lt;br /&gt;
| [http://download.moodle.org/stable14 1.4 Versions] || [http://download.moodle.org/stable13 1.3 Versions]  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You can download previous releases by using wget, lynx or curl with this URL:&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]&amp;lt;/nowiki&amp;gt;. &lt;br /&gt;
:For example: to download Moodle version 1.5, use &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable15&amp;lt;/nowiki&amp;gt;. You&#039;ll see a directory tree with the files displayed. Click on the one you want and download as normal - if you require the latest update of the version, scroll to the end of the list and download the &amp;quot;moodle-latest&amp;quot; file.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download other releases not found in [http://download.moodle.org/windows/ Moodle packages for Windows], use this URL:&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/windows/MoodleWindowsInstaller-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Mac Packages&#039;&#039;&#039;: To download other releases not found in [http://download.moodle.org/macosx/ Mac packages], use either of these URLs (depending on whether you need the Intel or PPC package):&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/macosx/Moodle4Mac-Intel-[version_number].dmg&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:&amp;lt;nowiki&amp;gt;http://download.moodle.org/macosx/Moodle4Mac-PPC-[version_number}.dmg&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== How to enable and check PHP error logs==&lt;br /&gt;
PHP can be set up to log errors in a variety of different ways: two of these involve the use of the php.ini file and the ini_set command.  See [[PHP error logs]].&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;A top level course could not be found&amp;quot; ==&lt;br /&gt;
If this appears immediately after you have attempted to install Moodle it almost certainly means that the installation did not complete. A complete installation will ask you for the administrator profile and to name the site just before it completes. Check your logs for errors. Then drop the database and start again. If you used the web-based installer try the command line one. Does your computer definitely have sufficient resource to run Moodle?&lt;br /&gt;
&lt;br /&gt;
==Email copies are not being sent from my forums==&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;must&#039;&#039; set up cron properly if you want Moodle to send out automatic email from forums, assignments etc. This same process also performs a number of clean-up tasks such as deleting old unconfirmed users, unenrolling old students and so on. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Try the default settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. This generally works. Except...&lt;br /&gt;
* On a Windows server you *must* supply the address of an SMTP server (Windows, unlike Unix, does not have a build in mail server) in the above settings page&lt;br /&gt;
* Make sure that &#039;&#039;allowuseremailcharset&#039;&#039; in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039; is set to No unless you really know what you are doing. Setting this to Yes can cause a problem in some versions of Moodle.&lt;br /&gt;
* Check your firewall or ask your network administrator. Many mail servers are heavily locked down and you may need permission to send mail through them.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t log in - I just stay stuck on the login screen==&lt;br /&gt;
&lt;br /&gt;
This may also apply if you are seeing  “Your session has timed out. Please login again” or &amp;quot;A server error that affects your login session was detected. Please login again or restart your browser&amp;quot; and cannot log in.&lt;br /&gt;
&lt;br /&gt;
The following are possible causes and actions you can take (in no particular order):&lt;br /&gt;
&lt;br /&gt;
* Check first that your main admin account (which will be a manual account) is also a problem. If your users are using an external authentication method (e.g. LDAP) that could be the problem. Isolate the fault and make sure it really is Moodle before going any further.&lt;br /&gt;
* Check that your hard disk is not full or if your server is on shared hosting check that you have not reached your disk space quota. This will prevent new sessions being created and nobody will be able to log in. &lt;br /&gt;
* Carefully check the permissions in your &#039;moodledata&#039; area. The web server needs to be able to write to the &#039;sessions&#039; subdirectory. &lt;br /&gt;
* Your own computer (not your Moodle server) may have a firewall that is stripping referrer information from the browser. Here are some instructions for fixing [http://service1.symantec.com/SUPPORT/nip.nsf/46f26a2d6dafb0a788256bc7005c3fa3/b9b47ad7eddd343b88256c6b006a85a8?OpenDocument&amp;amp;src=bar_sch_nam Norton firewall products].&lt;br /&gt;
* Try deleting the &#039;&#039;sessions&#039;&#039; folder in your moodledata directory (anybody currently logged in will be thrown out)&lt;br /&gt;
* Try deleting cookies on your computer and/or try another browser or another client computer&lt;br /&gt;
* In &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; Session Handling&#039;&#039;, try setting a value for &#039;Cookie prefix&#039;. You can also do this by setting &amp;lt;code&amp;gt;$CFG-&amp;gt;sessioncookie=&#039;something&#039;;&amp;lt;/code&amp;gt; in config.php. This is especially true if you are using multiple Moodles on the same browser. &lt;br /&gt;
* Make sure you have not removed or changed the [[Password salting|Password Salt]] value(s) in config.php. If passwords were created using a salt the correct salt must be in config.php for those passwords to continue to work. This is easily done if you recreate config.php while performing an upgrade and forget to transfer the salt values. &lt;br /&gt;
* Do you have a .htaccess file in your Moodle folder (or its parent directories). If so, is there anything in there that might be causing trouble (strange redirects, access restrictions etc.)?&lt;br /&gt;
* Check the value of &#039;&#039;&#039;mnet_localhost_id&#039;&#039;&#039; in the mdl_config database table. It&#039;s normally 1 but must match the &#039;&#039;&#039;mnet_hostid&#039;&#039;&#039; field in your user records in the mdl_user table for the user to be recognised. It can sometimes get changed spuriously during upgrades or site migrations. &lt;br /&gt;
* Check config.php - it should NOT have any spaces/new lines at the end of code.&lt;br /&gt;
* You are using the correct username and password, yes?&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page. You &#039;&#039;&#039;could&#039;&#039;&#039; also try changing the admin password. Proceed as if you have lost it - see [[Administration FAQ]].&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==I log in but the login link doesn&#039;t change. I am logged in and can navigate freely.==&lt;br /&gt;
&lt;br /&gt;
Make sure the URL in your &amp;lt;code&amp;gt;$CFG-&amp;gt;wwwroot&amp;lt;/code&amp;gt; setting is exactly the same as the one you are actually using to access the site.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Uploaded files give &amp;quot;File not found&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
For example: Not Found: The requested URL /moodle/file.php/2/myfile.jpg was not found on this server.&lt;br /&gt;
&lt;br /&gt;
Your web server needs to be configured to allow the part of the URL after a script name to be passed directly to the script. This is usually enabled in Apache 1, but is usually disabled by default in Apache 2. To turn it on, add this line to your &#039;&#039;httpd.conf&#039;&#039;, or to a &#039;&#039;.htaccess&#039;&#039; file in your local directory (see [[Installing Moodle]] for more details):&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
Note, this will ONLY work for Apache versions 2.x.&lt;br /&gt;
&lt;br /&gt;
For IIS you need to configure URL rewriting. This feature is not available in IIS 6 so you need to install a 3rd party IIS extension - see http://msdn.microsoft.com/en-us/library/ms972974.aspx. &lt;br /&gt;
&lt;br /&gt;
IIS 7 now comes with the new URL Rewrite Module so a 3rd part extension is no longer required if you are running IIS 7. See http://learn.iis.net/page.aspx/734/url-rewrite-module for more details.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve got URL rewriting working the recommended rewriting rule is:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;RewriteRule&#039;&#039;&#039; ^([^\?]+?\.php)(\/.+)$ $1\?file=$2 [QSA]&lt;br /&gt;
&lt;br /&gt;
In theory you could try to use path info on IIS too, but it is not reliable, especially when using unicode file names.&lt;br /&gt;
&lt;br /&gt;
If you are unable to configure your server properly then you can switch Moodle to use an alternative method. The major disadvantages is that you will not be able to use SCORM packages at all and some Adobe Flash and Java applets will not work either.&lt;br /&gt;
&lt;br /&gt;
To use this alternative method, you should change the &#039;&#039;slasharguments&#039;&#039; variable. For moodle versions &amp;lt; 1.7, this is located in the Operating System section of &#039;&#039;Administration &amp;gt; Configuration &amp;gt; [[admin/config|Variables]]&#039;&#039;. In later versions, this option is located in &#039;&#039;Site Administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;. You should now be able to access your uploaded files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=145422 Troubleshooting Guide - 404 Errors] forum discussion.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Why are all my pages blank?==&lt;br /&gt;
&lt;br /&gt;
Check the dirroot variable in &#039;&#039;config.php&#039;&#039;. You must use complete, absolute pathnames (e.g.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dirroot = &amp;quot;/var/www/moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL (or whatever other database you are using). This is common on RedHat and OpenBSD installations. In this case, an error is generated, but since error displays are often disabled by default, all that is seen on the browser is a blank screen. To enable PHP error displays see [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | How to enable and check PHP error logs]].&lt;br /&gt;
&lt;br /&gt;
To determine if database support is your problem, insert this as the second line in your &#039;&#039;config.php&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
phpinfo();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if you chosen database is supported. If not, look for a package you are missing.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== Why is a particular page blank or incomplete? ==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your web server log files!!&#039;&#039;&#039; &lt;br /&gt;
:If a particular page is blank or incomplete (it doesn&#039;t display the footer), before you do anything else switch on [[Debugging]] and  [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your PHP error logs]]. Having established that PHP error logging is working, reproduce the error. Immediately check the error log file right at the end. Hopefully you will see a PHP error message at or very near the end of the file. This may solve your problem directly or makes it a lot easier to diagnose the problem in the Moodle forums.&lt;br /&gt;
&lt;br /&gt;
*If you are &#039;&#039;&#039;upgrading to a new version of Moodle&#039;&#039;&#039;, check that you do not have an old version of a non-standard block or module installed. Remove any such blocks or modules installed using the admin settings page and start the install process again. However, do also make sure that you have included all optional plugins that were required by your courses. This is particularly common with &amp;quot;editing on&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*If you &#039;&#039;&#039;do not see any blocks listed&#039;&#039;&#039;, turn editing on and remove any blocks that you have added to that page and try reloading.&lt;br /&gt;
&lt;br /&gt;
*You may get this error immediately after &#039;&#039;&#039;selecting a language&#039;&#039;&#039;. At this stage of the installation process your Moodle computer may need to connect to the Internet and download a language pack, so check that the computer can access the Internet by using a browser. Check also that your PHP settings are as given in the Moodle [[Installing_Moodle#Requirements | Moodle Requirements]] page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=97734 PHP configuration error] forum discussion&lt;br /&gt;
&lt;br /&gt;
==Installation hangs when setting-up database tables==&lt;br /&gt;
Sometimes the installation will hang when setting up tables, where only half the page displayed in the browser and/or other outputs are removed.  You may see truncated MySQL statements, or the “Scroll to continue” link is displayed but no “Continue” button is there. &lt;br /&gt;
&lt;br /&gt;
See [[Unexpected installation halts]] for more about solutions that involve:&lt;br /&gt;
*Checking for MySQL limits&lt;br /&gt;
*Checking the .htaccess files &lt;br /&gt;
*Code customizations issues&lt;br /&gt;
*Checking memory limit &lt;br /&gt;
*Upgrade incrementally&lt;br /&gt;
*Fix fopen function&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Why can&#039;t I upload a new image into my profile?==&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see anything on your user profile pages to let you upload user images then it&#039;s usually one of the following:&lt;br /&gt;
*The permissions associated with the role you are using are preventing you from changing your profile picture.&lt;br /&gt;
* GD is not installed, or is not enabled on your server. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going to &#039;&#039;Site Administration &amp;gt; Server &amp;gt; PHP info&#039;&#039; and looking for the gdversion setting. This setting is chosen automatically every time you visit that page. If it shows GD version 1 or version 2 then everything should be fine. Save that configuration page and go back to your user profile.&lt;br /&gt;
* GD is installed, but is in some way corrupt. For instance, [http://moodle.org/mod/forum/discuss.php?d=44271#p386194 see this discussion on empty lines or white spaces in config files.]&lt;br /&gt;
GD is a library that allows image processing. For example, when all is well with your system, and you upload a new profile image, GD compresses the image and produces two thumbnails, one is 100x100 pixels, and the other is 35x35 pixels.&lt;br /&gt;
&lt;br /&gt;
If Moodle thinks GD is not installed, then you will need to &#039;&#039;&#039;install the GD library&#039;&#039;&#039;. &lt;br /&gt;
*On Unix you may need to re-compile PHP with arguments something like this:&lt;br /&gt;
&lt;br /&gt;
 ./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --with-gd &lt;br /&gt;
 --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-ttf --enable-gd-native-ttf &lt;br /&gt;
 --enable-magic-quotes --with-mysql --enable-sockets --enable-track-vars &lt;br /&gt;
 --enable-versioning --with-zlib&lt;br /&gt;
&lt;br /&gt;
* On Windows this is usually a matter of &amp;quot;turning on&amp;quot; the extension in PHP by editing your php.ini file. To do this remove the semicolon for the php_gd2.dll extension - check that this file is actually present in your php extensions  folder first (search your php.ini for extension_dir to determine where this points to on your hard disk). You should then have a line that looks like this:&lt;br /&gt;
 extension=php_gd2.dll&lt;br /&gt;
&lt;br /&gt;
:Windows users should see the [[Installing AMP|installation instructions]] for further help. &lt;br /&gt;
&lt;br /&gt;
3. Remember to &#039;&#039;&#039;restart your webserver&#039;&#039;&#039; (if possible) and re-visit the Moodle configuration page after making any changes to PHP so it can pick up the correct version of GD.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;: Using Moodle forum discussion [http://moodle.org/mod/forum/discuss.php?d=44271 Profile pictures] for additional information.&lt;br /&gt;
&lt;br /&gt;
== Why doesn&#039;t my Moodle site display the time and date correctly? ==&lt;br /&gt;
&lt;br /&gt;
Each language requires a specific language code (called a &#039;&#039;&#039;locale&#039;&#039;&#039; code) to allow dates to be displayed correctly. The language packs contain default standard codes, but sometimes these don&#039;t work on Windows servers.&lt;br /&gt;
&lt;br /&gt;
You can find the correct locale codes for Windows on these two pages: [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp Language codes] and [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_country_strings.asp Country/region] codes (e.g. &amp;quot;esp_esp&amp;quot; for spanish)&lt;br /&gt;
&lt;br /&gt;
These new locale codes can be entered on the Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]] page, where they override the ones in the currently chosen language pack.&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
== How do I uninstall Moodle?==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Webhost/manual installation&#039;&#039;&#039;: If you have installed Moodle manually or have installed onto a webhost, follow these steps:&lt;br /&gt;
*Delete the moodle database using this mysql command (or delete using your mysql client, e.g. PHPMyAdmin):&lt;br /&gt;
&amp;lt;pre&amp;gt;sql&amp;gt;DROP DATABASE moodle;&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the above example replace &#039;moodle&#039; with the name of the moodle database you created when installing.&lt;br /&gt;
*Delete the moodledata directory. If you, or your users, have uploaded materials into this directory take a copy of these before deleting this directory.&lt;br /&gt;
*Delete the moodle directory itself. This will delete all of the moodle PHP script files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XAMPP windows installation&#039;&#039;&#039;: If you have installed Moodle on windows through the XAMPP package, follow these steps:&lt;br /&gt;
*Open cmd.exe and navigate to this directory within your installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;server/mysql/bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Run this command, replacing USERNAME with your database username (the default is &amp;quot;root&amp;quot;) and DATABASE with your database name (the default is &amp;quot;moodle&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;mysqladmin.exe -u USERNAME -p drop DATABASE&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Enter your database password at the prompt (the default is &amp;quot;&amp;quot; [blank]).&lt;br /&gt;
*Enter &amp;quot;y&amp;quot; to confirm the database drop.&lt;br /&gt;
*Delete the moodledata directory. If you, or your users, have uploaded materials into this directory take a copy of these before deleting this directory.&lt;br /&gt;
*Delete the moodle directory itself. This will delete all of the moodle PHP script files.&lt;br /&gt;
&lt;br /&gt;
==Migrating Moodle to a new site or server==&lt;br /&gt;
Migrating Moodle means that you have to move the current installation to a new server, and so may have to change IP addresses or DNS entries. To do this you will need to change the $CFG-&amp;gt;wwwroot value in the config.php on the new server. You will also have to change any absolute links stored in the database backup file (before restoring the file on the new server) either using the admin/replace.php script, your text editor or another &amp;quot;search and replace&amp;quot; tool, e.g. sed. For more details see the [[Moodle_migration | Moodle Migration]] page.&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Why does my new installation display correctly on the server, but when I view it from a different machine, styles and images are missing?==&lt;br /&gt;
In the installation instructions, one of the suggested settings for &#039;webroot&#039; is &#039;localhost&#039;. This is fine if all you want to do is some local testing of your new Moodle installation. If, however, you want to view your new installation from another machine on the same local area network, or view your site on the internet, you will have to change this setting:&lt;br /&gt;
*For local testing, &#039;localhost&#039; is fine for the webroot ($CFG-&amp;gt;wwwroot in config.php). &lt;br /&gt;
*If you want to test your site from other machines on the same local area network (LAN), then you will have to use the private ip address of the serving machine, (e.g. 192.168.1.2/moodle) or the network name of the serving computer (e.g. network_name_of_serving_machine/moodle) as the web root. Depending on your LAN setup, it may be better to use the network name of the computer rather than its (private) ip address, because the ip address can and will change from time to time. If you don&#039;t want to use the network name, then you will have to speak to your network administrator and have them assign a permanent ip address to the serving machine.&lt;br /&gt;
*Finally, if you want to test your new installation across the internet, you will have to use either a domain name or a permanent (public) ip address/moodle as your web root. To handle both types of access, see [https://docs.moodle.org/en/masquerading masquerading].&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
==Maximum upload file size - how to change it?==&lt;br /&gt;
There are several places to change the maximum file upload size. The first place to check is the Administration block.   Security -&amp;gt; Site Policies -&amp;gt; and look for &amp;quot;Maximum Uploaded File Size&amp;quot;.  This is the &amp;quot;maxbyte&amp;quot; variable found in older versions of Moodle (under Admin &amp;gt; Variables). Teachers may also set the maximum file size by the [[Course_settings#Maximum_upload_size|course administration block]].&lt;br /&gt;
&lt;br /&gt;
If the above does not provide a large enough figure you will need to make changes in your server settings. The usual place is in your php.ini file (go to Site administration &amp;gt; Server &amp;gt; PHPinfo and check a few lines down for its location). Look for settings &#039;&#039;&#039;upload_max_filesize&#039;&#039;&#039; and &#039;&#039;&#039;post_max_size&#039;&#039;&#039;, setting them both to your desired new value (e.g. &#039;64MB&#039;). You will need to restart the web server for these changes to take effect - e.g. on Linux, &#039;&#039;&#039;/etc/init.d/apache2 force-reload&#039;&#039;&#039;. Check your documentation or just reboot the server. &lt;br /&gt;
&lt;br /&gt;
For more help see:&lt;br /&gt;
*[[Administration_FAQ#How_do_the_limits_on_uploaded_files_work.3F]]&lt;br /&gt;
*[[Installing_Moodle#Recheck_PHP_settings]]&lt;br /&gt;
*[[Installing_Moodle#Using_a_.htaccess_file_for_webserver_and_PHP_settings]]&lt;br /&gt;
*[[Site_policies#Maximum_uploaded_file_size]]&lt;br /&gt;
*These forum posts: http://moodle.org/mod/forum/discuss.php?d=63840#287960 and http://moodle.org/mod/forum/discuss.php?d=93882#p414650&lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
==Moodle claims PHP float handling is not compatible==&lt;br /&gt;
&lt;br /&gt;
The symptom is that when you try to install or upgrade your Moodle, you get a message &amp;quot;Detected unexpected problem in handling of PHP float numbers&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[http://moodle.org/mod/forum/discuss.php?d=114945 This forum thread] and MDL-18253 have more information. In short, this problem should not happen, you can help us by telling posting information about exactly which version of PHP, and OS you are using. That may let us find a way to work around this problem.&lt;br /&gt;
&lt;br /&gt;
You may be able to solve this issue by installing a more recent PHP versions. If you compile PHP yourself from source, changing the compilation options may help. However, since we don&#039;t understand the cause, we don&#039;t really know. If you do find a solution that works for you, please do tell us about it.&lt;br /&gt;
&lt;br /&gt;
Update: we have a guess that the problem may be the [http://au2.php.net/manual/en/ini.core.php#ini.precision &#039;precision&#039; setting in your php.ini file]. In a default PHP install this is set of 14. On at least one server that exhibited this problem it had been changed to a smaller value. So, if you see this problem, please try adding &lt;br /&gt;
 ini_set(&#039;precision&#039;, 14);&lt;br /&gt;
to your config.php file, and report your success in MDL-18253.&lt;br /&gt;
&lt;br /&gt;
==When upgrading Moodle claims my database is not UTF8 when I&#039;m sure it is==&lt;br /&gt;
&lt;br /&gt;
The symptom is that you are upgrading a post-1.6 Moodle to a newer version. The Environment check tells you that your database is not UTF8 and refuses to upgrade. &lt;br /&gt;
&lt;br /&gt;
The database may not have it&#039;s character encoding set quite correctly. You can safely try this command on the database (mySQL):&lt;br /&gt;
&lt;br /&gt;
    ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&lt;br /&gt;
&lt;br /&gt;
(Change &#039;moodle&#039; for the name of your database). You need to copy this into your MySQL client program that comes packaged with it. &lt;br /&gt;
&lt;br /&gt;
Alternatively, you maybe adding a new clean install Moodle version to an existing web server and the UTF8 check error will not allow you to proceed.  Use [[phpMyAdmin]] to help you.  This web client is available as a plugin for Moodle or through your web hosting control panel. Using this program, create an empty database (for example moodle199) and make sure &amp;quot;MySQL connection collation&amp;quot; is a utf8 entry, such as utf8_general_ci. Go back to the Moodle installation screen with the check error, hit the previous button on the bottom and make sure the databae has the same name as your new empty database (for example moodle199). &lt;br /&gt;
&lt;br /&gt;
If your Moodle site is version 1.5 or older then it&#039;s telling the truth. &lt;br /&gt;
&lt;br /&gt;
[[#top|Top]]&lt;br /&gt;
&lt;br /&gt;
== How do I run multiple instances of Moodle without duplicating base code? ==&lt;br /&gt;
&lt;br /&gt;
See [http://moodle.org/mod/forum/discuss.php?d=13211 this thread] for a detailed explanation by [[User:Martin_Langhoff| Martin Langhoff]].&lt;br /&gt;
&lt;br /&gt;
== What is FreeTDS and how can I use it in my installation? ==&lt;br /&gt;
[[FreeTDS]] is an open source implementation of the Tabular Data Stream protocol used by Microsoft SQL Server and Sybase for their databases. Unfortunately, Microsoft servers don&#039;t usually accept TDS 5.0 connections. FreeTDS allows your Unix/Linux applications to talk to these other database products and import and export data between different systems successfully.&lt;br /&gt;
&lt;br /&gt;
== How do I install a plugin? ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Installing plugins]].&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t enable a plugin on the Plugins overview page because the icon is not clickable==&lt;br /&gt;
The open and closed eye icon on the Plugins overview page is simply there to show whether or not a plugin is enabled. You can&#039;t edit plugins from this screen. If you wish to enable a plugin, to to the appropriate page for managing the type of plugin you need, for instance &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Repositories&amp;gt;Manage repositories&#039;&#039; or &#039;&#039;Settings&amp;gt;Site administration&amp;gt;Plugins&amp;gt;Activity modules&amp;gt;Manage activities.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* [[Beginning_Moodle_2.0_Administration|Beginning Moodle 2.0 Administration FAQ]]&lt;br /&gt;
* [https://docs.moodle.org/24/en/Install_Moodle2.2_on_godaddy Installing on GoDaddy]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[de:Installation FAQ]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
</feed>