<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/21/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hccrle</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/21/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hccrle"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/Special:Contributions/Hccrle"/>
	<updated>2026-04-14T18:30:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=48943</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=48943"/>
		<updated>2009-01-15T20:35:39Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Using the command line */ clarified the distinction between MySQL and PostgreSQL instructions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Firstly, don&#039;t panic! :-)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install Moodle for the first time. For some of these steps it goes into a lot of detail to try and cover the majority of possible web server setups, so this page may look long and complicated. Don&#039;t panic, once you know how to do it you can install Moodle in minutes!&lt;br /&gt;
&lt;br /&gt;
If you have problems please read this page carefully - most common issues are answered in here. If you still have trouble, you can seek help from the Moodle community via  [http://moodle.org/course/view.php?id=5 moodle.org Using Moodle].&lt;br /&gt;
&lt;br /&gt;
Another option is to contact a [http://moodle.com/hosting/ Moodle Partner providing Moodle hosting] who can completely maintain Moodle for you, so that you can ignore all this and get straight into educating! A Moodle partner is the preferred option but if you decide to choose a hosting company that has cpanel then [http://ic.eflclasses.org/tutorials/settingupmoodleonhostingwitholdcpanel.swf this tutorial will guide you]  through the process of choosing a host and setting up moodle via the old cpanel. If you have the new cpanel please use this link [http://ic.eflclasses.org/tutorials/settingupmoodleoncpanel.swf this tutorial will guide you].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; some hosting companies offer one-click moodle install options such as fantastico, which whilst sometimes effective, usually use old (sometimes years old) versions of moodle and sometimes simply don&#039;t work. If one of these goes wrong, your best bet is often to start from scratch following the instructions here yourself. Its almost certainly quicker.&lt;br /&gt;
&lt;br /&gt;
If you want to run Moodle on your own computer and this page looks a bit daunting, then please see our guides on how to install one of Moodle&#039;s complete [[Complete install packages for Windows|Windows packages]], [[Complete Install Packages for Mac OS X|Mac OS packages]] or [[Installing AMP |Installing Apache, MySQL and PHP(AMP)]]. They provide alternative instructions to install all this on most popular platforms.&lt;br /&gt;
&lt;br /&gt;
==Table of Contents==&lt;br /&gt;
__TOC__&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), but is also regularly tested with Windows XP/2000/2003 (WAMP), Solaris 10 (Sparc and x64), Mac OS X and Netware 6 operating systems. Support for PostgreSQL, Oracle and Microsoft SQL Server is also available.&lt;br /&gt;
&lt;br /&gt;
The procedure for installing Moodle on the Windows platform (e.g. Windows Server, IIS and MSSQL) varies slightly to the procedure for the LAMP platform. See [[Installation for Windows 2003 with IIS]] for more details.&lt;br /&gt;
&lt;br /&gt;
[[Installing Moodle on Windows Vista]] might help with &#039;&#039;&#039;Blank page problem while installing Moodle on Windows Vista&#039;&#039;&#039; .&lt;br /&gt;
&lt;br /&gt;
The requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
===Hardware === &lt;br /&gt;
* Disk space: 160MB free (min). You will require more free space to store your teaching materials.&lt;br /&gt;
* Memory: 256MB (min), 1GB (recommended). The general rule of thumb is that Moodle can support 50 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination. &lt;br /&gt;
** &#039;&#039;&#039;Note if you are using a hosted account:&#039;&#039;&#039; Most hosted accounts on commercial sites will meet Disk and Memory requirements. However, you should contact your web host&#039;s support desk to check that this is the case before signing-up with them. It is especially important to &#039;&#039;&#039;ask about any PHP memory limits or MySQL question limits&#039;&#039;&#039;. If your prospective host does not provide a service which meets these requirements, or you are already signed up with them, ask them why and consider taking your business elsewhere if they do not change.&lt;br /&gt;
&lt;br /&gt;
===Software===&lt;br /&gt;
* Web server software. Most people use [[Apache]], but Moodle should work fine under any web server that supports [[PHP]], such as [[IIS]] on Windows platforms. PHP does impose requirements on versions of web servers, however these are complex and the general advice is to use the newest version possible of your chosen web server. &lt;br /&gt;
* PHP scripting language. (Please note that there have been issues installing Moodle with [http://www.php-accelerator.co.uk PHP-Accelerator]). There are currently two versions (or branches) of PHP available: PHP4 and PHP5 and the version requirements are listed below.&lt;br /&gt;
** For Moodle version 1.4 or later: PHP4 (version 4.1.0 or later) or PHP5 (version 5.1.0 or later) are supported.&lt;br /&gt;
** For Moodle version 1.6 or later: the PHP4 (version 4.3.0 or later) or PHP5 (version 5.1.0 or later) are supported. &lt;br /&gt;
** Future Moodle versions 2.0 or later will not support PHP4 and will require PHP5 (version 5.2.4 or later).&lt;br /&gt;
** PHP Settings. 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. &lt;br /&gt;
*** &#039;&#039;register_globals&#039;&#039; &#039;&#039;&#039;MUST&#039;&#039;&#039; be OFF&lt;br /&gt;
*** &#039;&#039;safe_mode&#039;&#039; needs to be OFF.&lt;br /&gt;
*** &#039;&#039;memory_limit&#039;&#039; should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.&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 ON. (It will be recommended to turn it off in 2.0.)&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.&lt;br /&gt;
** PHP Extensions and libraries&lt;br /&gt;
*** The mbstring extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** The iconv extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** [http://www.libgd.org/ GD library] and the [http://www.freetype.org/ FreeType 2] library and extensions are needed to be able to look at the dynamic graphs that the logs pages make. (Freetype support is available as part of the GD extension for the 5.x versions of PHP)&lt;br /&gt;
*** The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.&lt;br /&gt;
*** The pgsql extension is required if you are using the PostgreSQL database.&lt;br /&gt;
*** The pdo and pdo_sqlite extensions are required for the (experimental) SQLite 3 database support.&lt;br /&gt;
*** The curl extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The tokenizer extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).&lt;br /&gt;
*** The xmlrpc extension is required for the Moodle network functionality (Moodle 1.8 or later).&lt;br /&gt;
*** The ctype extension is recommended for Moodle 1.8 or later. &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;
* A working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is &#039;&#039;the&#039;&#039; choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment.&lt;br /&gt;
** For Moodle 1.5, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later). &lt;br /&gt;
** For Moodle 1.6, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).&lt;br /&gt;
** For Moodle 1.7, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
** For Moodle 1.8 or later, MySQL (version 4.1.12 or later), PostgreSQL (8.0 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
: MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting &amp;quot;strict mode&amp;quot; must be OFF (set to &amp;quot;&amp;quot; or &amp;quot;MYSQL40&amp;quot;) in the MySQL configuration file. &lt;br /&gt;
: PostgreSQL Notes: PostgreSQL 7.4 is recommended for earlier Moodle versions, since Moodle 1.8 only PostgreSQL 8.0 and above are supported.&lt;br /&gt;
* For showcases or low to medium-sized installations, Moodle 2.0 also includes (experimental) support for SQLite 3 database. This setup requires no database server, as the database file is stored in a local directory on the server.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== How many users? ==&lt;br /&gt;
&lt;br /&gt;
In addition to the hardware and software requirements, you will also need to think about the capacity of your Moodle installation in terms of the number of users it can handle. There are two numbers to plan for:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Browsing users&#039;&#039;&#039;: the maximum number of users able to browse your Moodle site. This is the number of computers in your organization or on your course (whichever is greater).&lt;br /&gt;
:&#039;&#039;&#039;Concurrent database users&#039;&#039;&#039;: the maximum number of concurrent database users (needed for Moodle activities such as quizzes). This is the number of users who will be using Moodle at the same time. In an educational institution, use your timetable/roster to obtain this figure.&lt;br /&gt;
&lt;br /&gt;
Once you know these figures for your users, you can start work out if your Moodle installation can support this capacity. The exact number of users depends on your hardware/software/network combination. Usually the amount of memory installed (RAM) is the deciding factor but a faster overall processor speed will also help in reducing waiting times for pages to load. &lt;br /&gt;
&lt;br /&gt;
The general rule of thumb for a single server is that the approx max concurrent users = RAM (GB) * 50 and the approx max browsing users = Approx max concurrent users * 5. As an example, a university with 500 total computers on campus and 100 concurrent users at any time will need approx 2GB of RAM on the one server to support the number of concurrent users.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Ask your provider what limits are placed on the number of concurrent database connections and the processor load. This will give a good estimate of the number of users your Moodle install can manage.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note:&#039;&#039;&#039; As of August 31, 2007, Moodle 1.8.2+ is not recommended for large installations, especially if you have large number (e.g. 20,000+) of courses. The main reason is the codes related to ROLES are still not fully optimized with database queries and still need some work. If you are planning to use 1.8.x codes for a larger institution, please make sure that you have sufficient time to do your own testing and performance profiling.  Upgrade to Moodle 1.9!!&lt;br /&gt;
&lt;br /&gt;
[Update|Updating from a previous version] of Moodle has been improved quite a bit from 1.8.3+ version (see this thread discussion: http://moodle.org/mod/forum/discuss.php?d=83281).  Moodle 1.9 has even more improvements in all areas and is the recommended version.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to get Moodle, either as a compressed package or via [[CVS for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
=== Download from compressed packages===&lt;br /&gt;
There are two types of compressed packages at the [http://download.moodle.org/ download.moodle.org page:] which offer a variety of version, operating systems and compression types.&lt;br /&gt;
#The &amp;quot;Standard Distribution&amp;quot; (with Moodle only files) and &lt;br /&gt;
#Several operating system &amp;quot;Complete Install Packages&amp;quot; (which contains programs to create a Moodle in a web environment). Please see [[Complete install packages]] for more information.  &lt;br /&gt;
&lt;br /&gt;
Most of these instructions are for the standard distribution, &lt;br /&gt;
Download a compressed package and then unpack the archive into your file structure using either of these two commands:&lt;br /&gt;
 tar -zxvf [filename]&lt;br /&gt;
 unzip [filename]&lt;br /&gt;
&lt;br /&gt;
===Download from CVS===&lt;br /&gt;
To use CVS, helpful instructions are available at the [[CVS_for_Administrators | CVS for Administrators]] page. The full [http://cvs.moodle.org/moodle/ Moodle CVS repository] is also available for browsing. &lt;br /&gt;
&lt;br /&gt;
If you are using CVS, run the CVS Checkout command.&lt;br /&gt;
&lt;br /&gt;
===Directory created placement===&lt;br /&gt;
After either of the above processes, you will now have with a directory called &amp;quot;moodle&amp;quot;, containing a number of files and folders.&lt;br /&gt;
&lt;br /&gt;
For the standard package, 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;.&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 web site, it is usually better to upload the whole archive as one file, and then do the unpacking on the server. Even web hosting interfaces like cPanel allow you to uncompress archives in the &amp;quot;File Manager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Structure of moodle directory ===&lt;br /&gt;
&lt;br /&gt;
You can safely skip this section, but here is a quick summary of the contents of the Moodle folder, to help get you oriented:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;config.php&#039;&#039; - contains basic settings. This file does not come with Moodle - you will create it by executing install.php or manually.&lt;br /&gt;
:&#039;&#039;install.php&#039;&#039; - the script you will run to create config.php&lt;br /&gt;
:&#039;&#039;version.php&#039;&#039; - defines the current version of Moodle code&lt;br /&gt;
:&#039;&#039;index.php&#039;&#039; - the front page of the site&lt;br /&gt;
:&#039;&#039;admin/&#039;&#039; - code to administrate the whole server&lt;br /&gt;
:&#039;&#039;auth/&#039;&#039; - plugin modules to authenticate users&lt;br /&gt;
:&#039;&#039;blocks/&#039;&#039; - plugin modules for the little side blocks on many pages&lt;br /&gt;
:&#039;&#039;calendar/&#039;&#039; - all the code for managing and displaying calendars&lt;br /&gt;
:&#039;&#039;course/&#039;&#039; - code to display and manage courses&lt;br /&gt;
:&#039;&#039;doc/&#039;&#039; - help documentation for Moodle (eg this page)&lt;br /&gt;
:&#039;&#039;files/&#039;&#039; - code to display and manage uploaded files&lt;br /&gt;
:&#039;&#039;lang/&#039;&#039; - texts in different languages, one directory per language&lt;br /&gt;
:&#039;&#039;lib/&#039;&#039; - libraries of core Moodle code&lt;br /&gt;
:&#039;&#039;login/&#039;&#039; - code to handle login and account creation&lt;br /&gt;
:&#039;&#039;mod/&#039;&#039; - all the main Moodle course modules are in here&lt;br /&gt;
:&#039;&#039;pix/&#039;&#039; - generic site graphics&lt;br /&gt;
:&#039;&#039;theme/&#039;&#039; - theme packs/skins to change the look of the site.&lt;br /&gt;
:&#039;&#039;user/&#039;&#039; - code to display and manage users&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Setting-up your system==&lt;br /&gt;
To ensure that Moodle will install successfully, you need to check that the web server settings are correct, then create a blank database for Moodle to use and finally create a directory on your hard disk for Moodle to save your materials and other files you upload into your courses.&lt;br /&gt;
&lt;br /&gt;
=== Check web server settings ===&lt;br /&gt;
&lt;br /&gt;
*Firstly, make sure that your web server is set up to use index.php as a default page (perhaps in addition to index.html, default.htm and so on). In Apache, this is done using a DirectoryIndex parameter in your httpd.conf file. Mine usually looks like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
:Just make sure index.php is in the list (and preferably towards the start of the list, for efficiency).&lt;br /&gt;
&lt;br /&gt;
*Secondly, &#039;&#039;&#039;if you are using Apache 2&#039;&#039;&#039;, then you should turn on the &#039;&#039;AcceptPathInfo&#039;&#039; variable, which allows scripts to be passed arguments like &amp;lt;nowiki&amp;gt;http://server/file.php/arg1/arg2&amp;lt;/nowiki&amp;gt;. This is essential to allow relative links between your resources, and also provides a performance boost for people using your Moodle web site. You can turn this on by adding these lines to your httpd.conf file. (NB: This setting, or any equivalent, is not required in Apache 1)&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
=== Recheck PHP settings ===&lt;br /&gt;
Moodle requires a number of PHP settings to be active for it to work. These were given in the Requirements section and &#039;&#039;&#039;On most servers these will already be the default settings&#039;&#039;&#039;.  However, some PHP servers (and some of the more recent PHP versions) may have things set differently, so it is useful to double-check that the settings are correct. These are defined in PHP&#039;s configuration file (usually called &#039;&#039;&#039;php.ini&#039;&#039;&#039;) or in the Apache &#039;&#039;&#039;.htaccess&#039;&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
 register_globals = 0         ;(necessary)&lt;br /&gt;
 safe_mode = 0                ;(necessary)&lt;br /&gt;
 memory_limit = 40M           ;(varies: minimum 16M, 32M Moodle v1.7, 40M Moodle v1.8, 128M large sites)&lt;br /&gt;
 session.save_handler = files ;(unless you are using another handler, e.g. mm)   &lt;br /&gt;
 magic_quotes_gpc = 1         ;(preferred but not necessary, 0 will be highly recommended in 2.0)&lt;br /&gt;
 magic_quotes_runtime = 0     ;(necessary)&lt;br /&gt;
 file_uploads = 1&lt;br /&gt;
 session.auto_start = 0       ;(necessary)&lt;br /&gt;
 session.bug_compat_warn = 0&lt;br /&gt;
&lt;br /&gt;
You may also want to set other, optional php.ini file settings while you are already editing it. For instance, you may want to reset the maximum upload size of file attachments, which usually defaults to 2M(egabytes). For instance, to set these to 16 Megabytes:&lt;br /&gt;
 &lt;br /&gt;
 post_max_size = 16M&lt;br /&gt;
 upload_max_filesize = 16M&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Using a .htaccess file for webserver and PHP settings ===&lt;br /&gt;
&lt;br /&gt;
Use the above if you can directly edit your server&#039;s files, but if you are setting-up Moodle on a webhost, or don&#039;t have access to &#039;&#039;&#039;httpd.conf&#039;&#039;&#039; or &#039;&#039;&#039;php.ini&#039;&#039;&#039; on your server, or you have Moodle on a server with other applications that require different settings, then don&#039;t worry, you can often still override the default settings. This only works on Apache servers and only when Overrides have been allowed in the main Apache configuration. Moodle is supplied with a htaccess file which you can use, or you can create your own file manually.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Use the default htaccess file&#039;&#039;&#039;. The easiest thing to do is just copy the sample file from moodle/lib/htaccess and edit it to suit your needs. It contains further instructions. For example, in a Unix shell:&lt;br /&gt;
&lt;br /&gt;
 cd moodle&lt;br /&gt;
 cp moodle/lib/htaccess .htaccess&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Create your own file&#039;&#039;&#039;. Alternatively you can create your own file called &#039;&#039;&#039;.htaccess&#039;&#039;&#039; in Moodle&#039;s main directory that contains lines like the following. &lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
 php_value memory_limit 40M (adjust to your version of Moodle)&lt;br /&gt;
 php_flag magic_quotes_gpc 1&lt;br /&gt;
 php_flag magic_quotes_runtime 0&lt;br /&gt;
 php_flag file_uploads 1&lt;br /&gt;
 php_flag session.auto_start 0&lt;br /&gt;
 php_flag session.bug_compat_warn 0&lt;br /&gt;
&lt;br /&gt;
:If you have Apache version 2 installed, add these lines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IfDefine APACHE2&amp;gt;&lt;br /&gt;
     AcceptPathInfo on&lt;br /&gt;
 &amp;lt;/IfDefine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Otherwise add this single line:&lt;br /&gt;
&lt;br /&gt;
 AcceptPathInfo on&lt;br /&gt;
&lt;br /&gt;
:Optionally, you can also do things like define the maximum size for uploaded files, etc by adding these lines:&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 0&lt;br /&gt;
 php_value upload_max_filesize 2M&lt;br /&gt;
 php_value post_max_size 2M&lt;br /&gt;
&lt;br /&gt;
:The value given in these lines is 2M. You may want to change this at a later date to allow uploading of larger files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Some shared hosts do not allow .htaccess files&#039;&#039;&#039;. In this case, it may be necessary to place a php.ini file within each sub-directory of the site. To do this, you use your editor to create a php.ini file in the main moodle directory and later copy it to all sub-directories. The syntax for the php.ini file is different than the one used in .htaccess - you do not use the php_value and php_flag prefixes. See the example below:&lt;br /&gt;
 upload_max_filesize = 2M&lt;br /&gt;
 post_max_size = 2M&lt;br /&gt;
:After creating the php.ini file with all of the statements you need, run the script http://tips-scripts.com/php_ini_copy or copy php.ini manually to all sub-directories.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Some shared hosts use suPHP, which requires a slightly different configuration&#039;&#039;&#039;. If everything else fails, try creating the following two files and uploading to your moodle root directory&lt;br /&gt;
:php.ini (sample):&lt;br /&gt;
 register_globals = 0&lt;br /&gt;
 display_errors = 0&lt;br /&gt;
&lt;br /&gt;
:.htaccess (sample):&lt;br /&gt;
 suPHP_ConfigPath /home/cPanelName/public_html/moodle&lt;br /&gt;
&lt;br /&gt;
Change the above path to the actual path to your moodle install.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note&#039;&#039;&#039;: Use a .htaccess file only [http://httpd.apache.org/docs/1.3/howto/htaccess.html#when as a last resort] as it can have an impact on the performance of your Moodle site and cause pages to load slowly on your browser.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating an empty database ===&lt;br /&gt;
&lt;br /&gt;
You need to create an empty database (eg &amp;quot;&#039;&#039;moodle&#039;&#039;&amp;quot;) in your database system along with a special user (eg &amp;quot;moodleuser&amp;quot;) that has access to that database (and that database only). You could use the &amp;quot;root&amp;quot; user if you wanted to for a test server, but this is not recommended for a production system: if hackers manage to discover the password then your whole database system would be at risk, rather than just one database.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Warning&#039;&#039;&#039;: Bear in mind that, as of Moodle version 1.5.x, Moodle doesn&#039;t work with MySQL 5.x&#039;s strict mode setting (STRICT_TRANS_TABLES and/or STRICT_ALL_TABLES) -- see [http://moodle.org/mod/forum/discuss.php?d=58552 forum discussion]. So if you are using MySQL 5.x, edit MySQL&#039;s configuration file (called &amp;quot;my.ini&amp;quot; in Windows and &amp;quot;my.cnf&amp;quot; on Unix/Linux) and comment out that option or set it to &amp;lt;code&amp;gt;sql-mode=&#039;&#039;&amp;lt;/code&amp;gt;. You have to restart MySQL after changing this setting. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; If you do not have access to your server, use PHPMyAdmin (or another MySQL client) and enter the command &amp;lt;code&amp;gt;SET @@global.sql_mode=&#039;&#039;;&amp;lt;/code&amp;gt; (be sure to use single quotes, and don&#039;t forget the semicolon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
====Using a hosted server====&lt;br /&gt;
If you are using a webhost, they will probably have a control panel web interface for you to create your database.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;[http://www.cpanel.com/ cPanel]&#039;&#039;&#039; system is one of the most popular of these. &lt;br /&gt;
To create a database using cPanel:&lt;br /&gt;
&lt;br /&gt;
# Click on the &#039;&#039;&#039;MySQL Databases&#039;&#039;&#039; icon.&lt;br /&gt;
# Type &#039;&#039;&#039;moodle&#039;&#039;&#039; in the New Database field and click &#039;&#039;&#039;Create Database&#039;&#039;&#039;.&lt;br /&gt;
# Type a &#039;&#039;username&#039;&#039; and &#039;&#039;password&#039;&#039; (not one you use elsewhere) in the respective fields and click &#039;&#039;&#039;Create  User&#039;&#039;&#039;.&amp;lt;br&amp;gt;Note that the &#039;&#039;username&#039;&#039; and &#039;&#039;database&#039;&#039; names may be prefixed by your cPanel account name and an underscore, and truncated to 16 characters. When entering this information into the Moodle installer - use the full names.&lt;br /&gt;
# Now use the &#039;&#039;&#039;Add Users to Databases&#039;&#039;&#039; button and give this new user account &#039;&#039;&#039;ALL&#039;&#039;&#039; rights to the new database.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#Creating_the_data_directory |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Using a SQLite database====&lt;br /&gt;
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.&lt;br /&gt;
&lt;br /&gt;
Moodle 2.0 offers support for SQLite3 database installations. In this case, no database setup is required. The database file will be created by the installation script. By default, the database file will be store in Moodle&#039;s data directory (see [[Installing_Moodle#Creating_the_data_directory |Creating the data directory]]). During install, the web server must have write access on the directory where the database file will be stored. After installation, the web server must have read-write access to the database file.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#Creating_the_data_directory |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Using the command line====&lt;br /&gt;
&lt;br /&gt;
If you have access to Unix or Windows command lines then you can do the same sort of thing by typing commands. You should do this, if you want to use a MySQL database, using the MySQL Client program as follows (commands which you type-in are shown in bold):&lt;br /&gt;
&lt;br /&gt;
- Start the MySQL Client program:&lt;br /&gt;
 #&#039;&#039;&#039;mysql -u root -p&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;
 Your MySQL connection id is 2 to server version: 5.0.22-log&lt;br /&gt;
 &lt;br /&gt;
 Type &#039;help;&#039; or &#039;\h&#039; for help. Type &#039;\c&#039; to clear the buffer.&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The prompt changes to &amp;quot;mysql&amp;gt;&amp;quot; to indicate that you are now working in the MySQL Client program. When working in MySQL, all commands which you type-in must end in a semi-colon. (If you hit the Enter key without the final semi-colon, you&#039;ll get the line continuation symbol &#039;-&amp;gt;&#039;; this is your second chance to type the semi-colon and hit Enter.) &lt;br /&gt;
&lt;br /&gt;
- Begin by checking for any existing databases called &amp;quot;moodle&amp;quot; - if there are any you should change the name in all the commands which follow:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;SHOW DATABASES;&#039;&#039;&#039;&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | Database                |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | information_schema      |&lt;br /&gt;
 | mysql                   |&lt;br /&gt;
 | test                    |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 3 rows in set (0.03 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a database to store the Moodle tables. We&#039;ll call this &amp;quot;moodle&amp;quot;, as there are none with that name already in the above list, but change it if you need to.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;CREATE DATABASE moodle;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Change the default character set and collation of the &amp;quot;moodle&amp;quot; database to UTF8. Leave this out if you are installing Moodle 1.5 or earlier):&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a username and password to access the database &amp;quot;moodle&amp;quot; and grant database access permissions. We&#039;ll call the user &amp;quot;moodleuser&amp;quot; and set the password as &amp;quot;yourpassword&amp;quot;. It&#039;s a good idea to change these for your installation however most people keep the username as &amp;quot;moodleuser&amp;quot;. Remember the username and password you have set, as you&#039;ll need it in the configuration screens later. This is a long command so has been split over several lines by pressing the Return key.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;DROP,INDEX,ALTER ON moodle.*&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 0 rows affected (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Security Warnings&#039;&#039;&#039;: Never leave the password as the one shown here. Make sure you have a strong password (a mixture of letters and numbers, upper and lower case). Avoid granting &amp;quot;ALL&amp;quot; permissions on the database.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: For MySQL 4.0.1 or earlier, you don&#039;t need the CREATE TEMPORARY TABLES permission. &lt;br /&gt;
&lt;br /&gt;
- Exit the MySQL Client program:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;QUIT&#039;&#039;&#039;&lt;br /&gt;
 Bye&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
- Reload the grant tables using the mysqladmin program:&lt;br /&gt;
 #&#039;&#039;&#039;mysqladmin -u root -p reload&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
And some example command lines for those who wish to use a PostgreSQL database:&lt;br /&gt;
&lt;br /&gt;
   # su - postgres&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create user moodleuser createdb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser with encrypted password &#039;yourpassword&#039;;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create database moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;with encoding &#039;unicode&#039;&amp;lt;/font&amp;gt;;&amp;quot; -U moodleuser template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser nocreatedb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; su - root&lt;br /&gt;
   # /etc/init.d/postgresql reload&lt;br /&gt;
&lt;br /&gt;
If the Postgres create database command above (&amp;gt;psql -c &amp;quot;create database moodle...&amp;quot;) gives an error message you may want to try:&lt;br /&gt;
 psql -c &amp;quot;create database moodle with template=template1 encoding = &#039;unicode&#039; owner =  moodleuser &amp;lt;br&amp;gt;     location = &#039;/var/mydata&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the create database command asks you for a password, run the line containing &#039;encrypted password&#039; first before proceeding.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
* Step-by-step instructions on  [https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Ubuntu installation for Ubuntu(Debian)]&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating the data directory  ===&lt;br /&gt;
&lt;br /&gt;
Moodle will also need some space on your server&#039;s hard disk to store uploaded files, such as course documents and user pictures. The Moodle installer tries hard to create the &#039;&#039;&#039;moodledata&#039;&#039;&#039; directory for you but if it fails then you will have to create a directory for this purpose manually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Security warning&#039;&#039;&#039;: For security purposes, it is &#039;&#039;&#039;CRITICAL&#039;&#039;&#039; that this directory is &#039;&#039;&#039;NOT&#039;&#039;&#039; accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web site root directory (it is the folder that the main part of your URL -that is, the part up to the first single / - points to; for example, in &amp;lt;nowiki&amp;gt;http://your.domain.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;, it is &amp;lt;nowiki&amp;gt;http://your.domain.com/&amp;lt;/nowiki&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
But if you must have it in the web directory (and you are using Apache AND the web server configuration allows .htaccess files to restrict access to directories) then protect it by creating a file in the data directory called &#039;&#039;&#039;.htaccess&#039;&#039;&#039;, containing these lines:&lt;br /&gt;
&lt;br /&gt;
 order deny,allow&lt;br /&gt;
 deny from all&lt;br /&gt;
&lt;br /&gt;
If you are using IIS, you need to edit the properties of the data directory (from the Internet Information Services Manager console) and deny access to that folder to everybody from the web.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;If you don&#039;t protect the data directory from direct web access, anybody will be able to impersonate any user of your Moodle site (including the admin user!!!), and all of your course materials will be available to the web at large.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ownership &amp;amp; Permissions&#039;&#039;&#039;: To make sure that Moodle can save uploaded files in this directory, check that the web server software has permission to read, write and execute in this directory. On Unix machines, this means setting the owner of the directory to be something like &amp;quot;nobody&amp;quot; or &amp;quot;apache&amp;quot;, and then giving that user read, write and execute permissions. As an example, to change the owner to &amp;quot;nobody&amp;quot; you could use:&lt;br /&gt;
&lt;br /&gt;
 chown -R nobody:apache moodledata&lt;br /&gt;
&lt;br /&gt;
To change the permissions so that the owner has read,write and execute permissions, use something like this:&lt;br /&gt;
&lt;br /&gt;
 chmod -R 0770 moodledata&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are receiving permission denied messages, try &#039;&#039;chmod -R 0770 moodledata&#039;&#039; and then adjust the settings so that they are more secure. A more secure setting is &#039;&#039;chmod -R 0750 moodledata&#039;&#039;. According to the comments in config-dist.php, &amp;quot;On hosting systems you might need to make sure that your group has no permissions at all while others have full permissions.&amp;quot; To do this you could use &#039;&#039;chmod -R 707 moodledata&#039;&#039;. See also the [[Security | security page]].&lt;br /&gt;
&lt;br /&gt;
Remember that by default moodle will issue a warning about moodle data directories created inside the web directory, but otherwise this directory can be located where you wish. You can later move or change the location of this directory, but if you do, be sure to edit the setting in the &#039;&#039;&#039;config.php&#039;&#039;&#039; file that sets this; e.g. if moodledata is under a directory called data, then it would look like this:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dataroot  = &#039;/data/moodledata&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CPanel and webhosts&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On cPanel systems you can use the &amp;quot;File Manager&amp;quot; to find the folder, click on it, then choose &amp;quot;Change Permissions&amp;quot;. On many shared hosting servers, you will probably need to restrict all file access to your &amp;quot;group&amp;quot; (to prevent other webhost customers from looking at or changing your files), but provide full read/write access to everyone else (which will allow the web server to access your files). Speak to your server administrator if you are having trouble setting this up securely. In particular it will not be possible to create a usable data directory on sites that use a PHP feature known as &amp;quot;&#039;&#039;&#039;Safe Mode&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Run the installer script to create config.php ==&lt;br /&gt;
&lt;br /&gt;
To run the installer script (install.php), just try to access your Moodle main URL using a web browser, or access &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourserver/install.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; directly.&lt;br /&gt;
&lt;br /&gt;
(The Installer will try to set a session cookie. If you get a popup warning in your browser make sure you accept that cookie!)&lt;br /&gt;
&lt;br /&gt;
Moodle will detect that configuration is necessary and will lead you through some screens to help you create a new configuration file called &#039;&#039;&#039;config.php&#039;&#039;&#039;. At the end of the process Moodle will try and write the file into the right location, otherwise you can press a button to download it from the installer and then upload &#039;&#039;&#039;config.php&#039;&#039;&#039; into the main Moodle directory on the server.&lt;br /&gt;
&lt;br /&gt;
Along the way the installer will test your server environment and give you suggestions about how to fix any problems. For most common issues these suggestions should be sufficient, but if you get stuck, check in the Installation Forum for more help.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Go to the admin page to continue configuration ==&lt;br /&gt;
&lt;br /&gt;
Once the basic config.php has been correctly created in the previous step, trying to access the front page of your site will take you to the &amp;quot;admin&amp;quot; page for the rest of the configuration.&lt;br /&gt;
&lt;br /&gt;
The first time you access this admin page, you will be presented with a GPL &amp;quot;shrink wrap&amp;quot; agreement with which you must agree before you can continue with the setup.&lt;br /&gt;
&lt;br /&gt;
Now Moodle will start setting up your database and creating tables to store data. Firstly, the main database tables are created. You should see a number of SQL statements followed by status messages that look like this:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE course (&lt;br /&gt;
    id int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
    category int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    password varchar(50) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    fullname varchar(254) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    shortname varchar(15) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    summary text NOT NULL,&lt;br /&gt;
    format tinyint(4) NOT NULL default &#039;1&#039;,&lt;br /&gt;
    teacher varchar(100) NOT NULL default &#039;Teacher&#039;,&lt;br /&gt;
    startdate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    enddate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    timemodified int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    PRIMARY KEY (id)&lt;br /&gt;
 ) TYPE=MyISAM;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;SUCCESS&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and so on, followed by: &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Main databases set up successfully.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see these, then there must have been some problem with the database or the configuration settings you defined in config.php. Check that PHP isn&#039;t in a restricted &amp;quot;Safe Mode&amp;quot; (commercial web hosts sometimes have safe mode turned on). You can check PHP variables by creating a little file containing &#039;&#039;&#039;&amp;lt;?php phpinfo() ?&amp;gt;&#039;&#039;&#039; and looking at it through a browser. Check all these and try this page again.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
You should now see a form where you can define more configuration variables for your installation, such as the default language, SMTP hosts and so on. Don&#039;t worry too much about getting everything right just now - you can always come back and edit these later on using the admin interface. The defaults are designed to be useful and secure for most sites. Scroll down to the bottom and click &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If (and only if) you find yourself getting stuck on this page, unable to continue, then your server probably has what I call the &amp;quot;buggy referrer&amp;quot; problem. This is easy to fix: just turn off the &amp;quot;secureforms&amp;quot; setting, then try to continue again.&lt;br /&gt;
&lt;br /&gt;
Next you will see more pages that print lots of status messages as they set up all the tables required by the various Moodle module. As before, they should all be &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;green&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
The next page is a form where you can define parameters for your Moodle site and the front page, such as the name, format, description and so on. Fill this out (you can always come back and change these later) and then press &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finally, you will then be asked to create a top-level administration user for future access to the admin pages. Fill out the details with your own name, email etc and then click &amp;quot;Save changes&amp;quot;. Not all the fields are required, but if you miss any important fields you&#039;ll be re-prompted for them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure you remember the username and password you chose for the administration user account, as they will be necessary to access the administration page in future.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(If for any reason your install is interrupted, or there is a system error of some kind that prevents you from logging in using the admin account, you can usually log in using the default username of &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;, with password &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Once successful, you will be returned to the home page of your new site! Note the administration links that appear down the left hand side of the page (these items also appear on a separate Admin page) - these items are only visible to you because you are logged in as the admin user. All your further administration of Moodle can now be done using this menu, such as:&lt;br /&gt;
&lt;br /&gt;
* creating and deleting courses&lt;br /&gt;
* creating and editing user accounts&lt;br /&gt;
* administering teacher accounts&lt;br /&gt;
* changing site-wide settings like themes etc&lt;br /&gt;
&lt;br /&gt;
But you are not done installing yet! There is one very important thing still to do (see the next section on cron).&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Installing Moodle Using Command Line ==&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
&lt;br /&gt;
Installing Moodle Using command line is just as easy as installing Moodle using web browser. &lt;br /&gt;
* First Go to the moodle root directory and then to admin directory inside the moodle root. &lt;br /&gt;
&lt;br /&gt;
 $cd /var/www/html/moodle/admin&lt;br /&gt;
&lt;br /&gt;
* Then simply use the following syntax to run the moodle command line installer (this is a long command which has been split over 3 lines, so type as one line)&lt;br /&gt;
 $php cliupgrade.php --lang=en --webaddr=&amp;lt;nowiki&amp;gt;http://www.example.com&amp;lt;/nowiki&amp;gt; --moodledir=/var/www/html/moodle &lt;br /&gt;
                     --datadir=/var/moodledata --dbtype=mysql --dbhost=localhost --dbname=moodle &lt;br /&gt;
                     --dbuser=root --prefix=mdl --verbose=1 --interactivelevel=2 &lt;br /&gt;
&lt;br /&gt;
More information about the options can be found using &lt;br /&gt;
$php cliupgrad.php --help&lt;br /&gt;
&lt;br /&gt;
Then you will see the following list of available options&lt;br /&gt;
&lt;br /&gt;
 --lang		 		Valid installed language for installation. Default is English(en)&lt;br /&gt;
 --webaddr			Web address for the Moodle site&lt;br /&gt;
 --moodledir			Location of the moodle web folder&lt;br /&gt;
 --datadir			Location of the moodle data folder (should not be web visible)&lt;br /&gt;
 --dbtype			Database type. Default it mysql&lt;br /&gt;
 --dbhost			Database host. Default localhost&lt;br /&gt;
 --dbname			Database name. Default is moodle&lt;br /&gt;
 --dbuser			Database user. Default is blank&lt;br /&gt;
 --dbpass			Database password. Default is blank&lt;br /&gt;
 --prefix			        Table prefix for above database tables. Default is mdl&lt;br /&gt;
 --verbose			0 No output, 1 Summarized output(Default), 2 Detailed output&lt;br /&gt;
 --interactivelevel	        0 Non interactive, 1 Semi interactive(Default), 2 Interactive&lt;br /&gt;
 --help				print out this help&lt;br /&gt;
&lt;br /&gt;
When you choose non interactive mode without any options all the default values are assumed.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Set up cron ==&lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
== Set up backups ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Backup settings| backup instructions]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Create a new course ==&lt;br /&gt;
&lt;br /&gt;
Now that Moodle is running properly, you can try creating a new course to play with.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Create a new course&amp;quot; from the Admin page (or the admin links on the home page).&lt;br /&gt;
&lt;br /&gt;
Fill out the form, paying special attention to the course format. You don&#039;t have to worry about the details too much at this stage, as everything can be changed later by the teacher. Note that the yellow help icons are everywhere to provide contextual help on any aspect.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;Save changes&amp;quot;, and you will be taken to a new form where you can assign teachers to the course. You can only add existing user accounts from this form - if you want to create a new teacher account then either ask the teacher to create one for themselves (see the login page), or create one for them using the &amp;quot;Add a new user&amp;quot; on the Admin page.&lt;br /&gt;
&lt;br /&gt;
Once done, the course is ready to customize, and is accessible via the &amp;quot;Courses&amp;quot; link on the home page.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
* [[Complete install packages]] might be an easier first time installs on some systems&lt;br /&gt;
* Help forum:  [http://moodle.org/mod/forum/view.php?id=28 Installation problems]&lt;br /&gt;
* [[Installing Apache, MySQL and PHP]] - Open source programs that can run Moodle on the web or on a desktop&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=42688 Selecting a web host for Moodle] forum discussion&lt;br /&gt;
* [[masquerading|Masquerading]] - Running Moodle behind a masquerading/NAT firewall&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[cs:Instalace]]&lt;br /&gt;
[[de:Installieren von Moodle]]&lt;br /&gt;
[[es:Instalación de moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;br /&gt;
[[nl:Installatiegids]]&lt;br /&gt;
[[pl:Instalacja Moodle]]&lt;br /&gt;
[[pt:Instalação do Moodle]]&lt;br /&gt;
[[ru:Установка Moodle]]&lt;br /&gt;
[[sk:Inštalácia]]&lt;br /&gt;
[[zh:安装Moodlezh:]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=48414</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=48414"/>
		<updated>2008-12-21T23:06:36Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: Added references to forum posts on increasing max. upload size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;?PHP phpinfo() ?&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;
== 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. Use this template to copy and paste into your post:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* Browser name (version also if possible):&lt;br /&gt;
* Moodle version:&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached?(Y/N):&lt;br /&gt;
* Phpinfo attached? (Y/N):&lt;br /&gt;
&lt;br /&gt;
For the last two items, try to include the following in your post as an attachment:&lt;br /&gt;
* A copy of your phpinfo output as shown in your browser (see the instructions above for an explanation of how to obtain this, or see [[phpinfo]]).&lt;br /&gt;
* A copy of the Moodle configuration file (with secret info like database password deleted, of course). This is located in the main Moodle directory (by default called moodle), and is named config.php&lt;br /&gt;
&lt;br /&gt;
Copy and paste both of these into a single text file (using vi, Notepad, etc) and attach this to your post. If your PC is a Windows box and config.php looks messy (line breaks missing or in the wrong places) in Notepad, try Wordpad.&lt;br /&gt;
&lt;br /&gt;
If you cannot provide your phpinfo, try to copy &amp;amp; paste and complete these in your post:&lt;br /&gt;
* Webserver (e.g. Apache/IIS) version:&lt;br /&gt;
* Database server (e.g. MySQL, PostgreSQL) version:&lt;br /&gt;
* PHP version:&lt;br /&gt;
&lt;br /&gt;
For installation on web hosting accounts: contact your support desk who should be able to tell you this information.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Security Warning&#039;&#039;&#039;: Make sure you edit any files and delete any passwords before posting onto the forum.&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. Please remember that manually editing the file is not recommended and may lead to blank pages, especially if there are additional spaces and/or lines after the final php closing tag &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
* &#039;&#039;&#039;Generic Packages&#039;&#039;&#039;: If your server does not meet the [[Installing_Moodle#Requirements | requirements]] for the current version of Moodle, 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 http://download.moodle.org/stable15. 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, or alternatively use these URLs for zip or tgz downloads:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].tgz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Changes made in the version in the last month are listed in the &amp;quot;CHANGES&amp;quot; file in the directory listing. The files you download contain Moodle code and are not the Windows or Mac packages - so you need to have a webserver, a database server and PHP already installed. The earliest version available is Moodle 1.3.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download previous releases of the 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 previous releases of the Mac pacakges, 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;
* &#039;&#039;&#039;Using CVS&#039;&#039;&#039;: You can also use CVS to download older releases and incremental releases of the Moodle generic packages, e.g. Moodle 1.5.4 - see the [[CVS_for_Administrators | CVS documentation]].&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. &lt;br /&gt;
* &#039;&#039;&#039;Using the php.ini file&#039;&#039;&#039;: The log settings are contained in the php.ini file stored on the server. If you don&#039;t know where that is, edit your Moodle &#039;&#039;config.php&#039;&#039; and add the following as the second line&lt;br /&gt;
&lt;br /&gt;
  phpinfo();&lt;br /&gt;
&lt;br /&gt;
:then reload the web page. Look for the entry &#039;&#039;&#039;Configuration File (php.ini) Path&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:When you have located php.ini open it in your favorite text editor. Find the &#039;&#039;&#039;Error handling and logging&#039;&#039;&#039; section of the php.ini file. Make sure that both &#039;&#039;&#039;display_errors = On&#039;&#039;&#039;, &#039;&#039;&#039;display_startup_errors = On&#039;&#039;&#039; and &#039;&#039;&#039;log_errors = On&#039;&#039;&#039; are present and uncommented. Check the value of &#039;&#039;&#039;error_log&#039;&#039;&#039; - this tells you the location of the file errors are logged to. If it is commented out then errors will be sent to the web server error log file. Remember, if you make any changes to this file you will need to restart the web server (or just reboot the server).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Using ini_set commands&#039;&#039;&#039;: If you are using Moodle 1.7 or higher, the previous steps are not enough. In those versions error logging parameters are dependant on certain administrative settings that you specify in the debugging section. The problem is that if you can&#039;t access the administrative pages, you can&#039;t set the debugging options. So the only way to modify them is by adding the following lines to your config.php file, just before the last line (the one containing a single&#039;?&amp;gt;&#039; only):&lt;br /&gt;
&lt;br /&gt;
  ini_set (&#039;display_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;log_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;display_startup_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;error_reporting&#039;, E_ALL);&lt;br /&gt;
  $CFG-&amp;gt;debug = DEBUG_ALL;&lt;br /&gt;
&lt;br /&gt;
:This will enable the same settings specified above even if Moodle sets them otherwise. &lt;br /&gt;
:&#039;&#039;&#039;Important&#039;&#039;&#039;: Remember to put them just before the last line of config.php.&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.&lt;br /&gt;
&lt;br /&gt;
Basically, you need to set up a process to regularly call the script &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://yoursite/admin/cron.php&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Try the default settings in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039;. This generally works.&lt;br /&gt;
*Make sure that &#039;&#039;allowuseremailcharset&#039;&#039; in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039; is set to No. Setting this to Yes can cause a problem in some versions of Moodle.&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;
The most common cause for this is that your own computer (not your Moodle server) has 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;
&lt;br /&gt;
Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script &amp;lt;nowiki&amp;gt;http://yourserver/moodle/lib/session-test.php&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page.&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;
==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;
If you are not using Apache 2 and you still have this problem (unlikely) then you can switch Moodle to use an alternative method. The disadvantages are a slight loss of performance for your users and you won&#039;t be able to use relative links within HTML resources.&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;
==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;
 $CFG-&amp;gt;dirroot = &amp;quot;d:\inetpub\sites\www.yoursite.com\web\moodle&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL. 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 MySQL 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;
 phpinfo();&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if MySQL is supported. If not look for a package you are missing.&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 [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your 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. &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. This will be an abrupt hang with half the page displayed in the browser and/or other outputs removed. Examples are:&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Truncated MySQL statements&#039;&#039;&#039;:&lt;br /&gt;
 &lt;br /&gt;
 (mysql): SET NAMES &#039;utf8&#039;&lt;br /&gt;
 --------------------------------------------------------------------------------&lt;br /&gt;
 (mysql): SHOW LOCAL VARIABLES LIKE &#039;character_set_database&#039;&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 (no more statements are displayed)   &lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Missing Continue button&#039;&#039;&#039;: The “Scroll to continue” link is displayed but no “Continue” button is there. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: There is an exception to this when upgrading an existing database and the installation may appear to hang at the roles generation phase. This process can take a very long time - so please be patient.&lt;br /&gt;
&lt;br /&gt;
Below are some solutions you can try to overcome this problem:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check for MySQL limits&#039;&#039;&#039;. This is often a MySQL error and not a php error. Check that there is no limit placed on your mysql database, e.g. a &amp;quot;questions&amp;quot; limit. See [http://dev.mysql.com/doc/refman/5.0/en/user-resources.html Limiting Account Resources in the MySQL manual].&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your .htaccess files&#039;&#039;&#039;. If the install is on a webhost, adding the following line to the .htaccess file in the Moodle directory has been known to solve the problem.&lt;br /&gt;
 AddType x-mapp-php5 .php&lt;br /&gt;
&lt;br /&gt;
:Try also renaming the .htaccess file so that it is disabled.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Code customizations&#039;&#039;&#039;. You may also want to look and see if you&#039;ve customized any of your code.  Look at the last successful table, and then look at the block, mod, or other code that is referenced by that table.  For example, if your install hangs and continues to say that the forum tables were successful as the last message, look at /mod/forum/ for any custom code.  If you have customized code, backup those files and replace with the correct files.  You can then restart the install by renaming config.php or reinstalling your database from the backup.  If your install is successful, you can make your code changes back into the stock Moodle code.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your memory limit&#039;&#039;&#039;. It may also be that the &amp;quot;memory_limit&amp;quot; in your php.ini is set too low. Please check your php.ini file and allocate the recommended amount (see [https://docs.moodle.org/en/Installing_Moodle#Requirements Moodle requirements]). For Moodle version 1.8 and above at least 40MB is  recommended.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Upgrade incrementally&#039;&#039;&#039;. To avoid this problem when upgrading, it is recommended to upgrade via each version of Moodle, for example 1.7 -&amp;gt; 1.8 -&amp;gt; 1.9 (with the exception of upgrading from 1.5 or 1.6, when it is recommended that 1.7 be skipped, in other words upgrade 1.5 -&amp;gt; 1.6 -&amp;gt; 1.8 -&amp;gt; 1.9).&lt;br /&gt;
&lt;br /&gt;
A work-around to this problem is to setup a working Moodle system on your local PC or server using the [http://download.moodle.org Moodle Packages]. Once you have a running Moodle, [https://docs.moodle.org/en/Upgrading_Moodle#Backup_important_data backup the database] and import to your webhost. Then backup the Moodle code itself (the &amp;quot;moodle&amp;quot; directory on your PC) and copy this to your webhost using (for example) FTP. Finally, edit the moodle/config.php file for the new settings that have to be changed for the webhost.&lt;br /&gt;
&lt;br /&gt;
Some Moodlers have found the suggestion in http://moodle.org/mod/forum/discuss.php?d=65786#p297433 helpful, for some unknown reason. It claims that it is because the fopen function in the line (now line 426 instead of 406) was not being given a string as the first argument, but that&#039;s not true. It was a string; after the edit it is a string whose first and last characters are single quote marks. The amazing thing is that it works at all after that edit. What&#039;s even more amazing is that it fixes the problem, at least for some users. Go figure.&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 because GD is not enabled on your server. GD is a library that allows image processing.&lt;br /&gt;
&lt;br /&gt;
1. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going into Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[Variables]] 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;
&lt;br /&gt;
2. 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;
&lt;br /&gt;
==How do I uninstall Moodle?==&lt;br /&gt;
&#039;&#039;&#039;Moodle package installation&#039;&#039;&#039;: If you have downloaded a Moodle package, simply uninstall using your system commands. On Windows PCs, you should access the Control Panel -&amp;gt; Add/Remove Programs. Select the package name and click Change or Remove Programs.&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;
==How do I upgrade Moodle? Do I just overwrite the files?==&lt;br /&gt;
Do not overwrite files, it may cause strange errors. You should read the [[Upgrade]] documentation before proceeding.&lt;br /&gt;
&lt;br /&gt;
==I obtain the message &amp;quot;Upgrade already running in this session, please wait!&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
Most likely you refreshed the page before the completion message. If you are absolutely sure that there are no upgrade processes active (php and/or mysql), you can click on &amp;quot;!!!&amp;quot; and restart the upgrade.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Note&#039;&#039;: If you click on &amp;quot;&#039;!!!&amp;quot; or try to restart the upgrade from another browser, there is a chance that your data in the database could be corrupted. If this happens, you will need to restore the database from sql dump and then restart the upgrade and wait - the process can take several hours on large sites.&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;
==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;
==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;
The second place to check are the server files.  The php.ini file has a limit which will override any other setting. (Hint: remember to restart your server for changes to take effect).  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;
&lt;br /&gt;
==How do I install Moodle on Windows Vista?==&lt;br /&gt;
&lt;br /&gt;
See [[Installing Moodle on Windows Vista]].&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;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[nl:Installatie FAQ]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[ru:Установка FAQ]]&lt;br /&gt;
[[pl:Instalacja FAQ]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=47878</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=47878"/>
		<updated>2008-12-08T22:59:49Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: Requirements/Software corrected spelling of a PHP extension&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Firstly, don&#039;t panic! :-)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install Moodle for the first time. For some of these steps it goes into a lot of detail to try and cover the majority of possible web server setups, so this page may look long and complicated. Don&#039;t panic, once you know how to do it you can install Moodle in minutes!&lt;br /&gt;
&lt;br /&gt;
If you have problems please read this page carefully - most common issues are answered in here. If you still have trouble, you can seek help from the Moodle community via  [http://moodle.org/course/view.php?id=5 moodle.org Using Moodle].&lt;br /&gt;
&lt;br /&gt;
Another option is to contact a [http://moodle.com/hosting/ Moodle Partner providing Moodle hosting] who can completely maintain Moodle for you, so that you can ignore all this and get straight into educating! A Moodle partner is the preferred option but if you decide to choose a hosting company that has cpanel then [http://ic.eflclasses.org/tutorials/settingupmoodleonhostingwitholdcpanel.swf this tutorial will guide you]  through the process of choosing a host and setting up moodle via the old cpanel. If you have the new cpanel please use this link [http://ic.eflclasses.org/tutorials/settingupmoodleoncpanel.swf this tutorial will guide you].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; some hosting companies offer one-click moodle install options such as fantastico, which whilst sometimes effective, usually use old (sometimes years old) versions of moodle and sometimes simply don&#039;t work. If one of these goes wrong, your best bet is often to start from scratch following the instructions here yourself. Its almost certainly quicker.&lt;br /&gt;
&lt;br /&gt;
If you want to run Moodle on your own computer and this page looks a bit daunting, then please see our guides on how to install one of Moodle&#039;s complete [[Complete install packages for Windows|Windows packages]], [[Complete Install Packages for Mac OS X|Mac OS packages]] or [[Installing AMP |Installing Apache, MySQL and PHP(AMP)]]. They provide alternative instructions to install all this on most popular platforms.&lt;br /&gt;
&lt;br /&gt;
==Table of Contents==&lt;br /&gt;
__TOC__&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), but is also regularly tested with Windows XP/2000/2003 (WAMP), Solaris 10 (Sparc and x64), Mac OS X and Netware 6 operating systems. Support for PostgreSQL, Oracle and Microsoft SQL Server is also available.&lt;br /&gt;
&lt;br /&gt;
The procedure for installing Moodle on the Windows platform (e.g. Windows Server, IIS and MSSQL) varies slightly to the procedure for the LAMP platform. See [[Installation for Windows 2003 with IIS]] for more details.&lt;br /&gt;
&lt;br /&gt;
[[Installing Moodle on Windows Vista]] might help with &#039;&#039;&#039;Blank page problem while installing Moodle on Windows Vista&#039;&#039;&#039; .&lt;br /&gt;
&lt;br /&gt;
The requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
===Hardware === &lt;br /&gt;
* Disk space: 160MB free (min). You will require more free space to store your teaching materials.&lt;br /&gt;
* Memory: 256MB (min), 1GB (recommended). The general rule of thumb is that Moodle can support 50 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination. &lt;br /&gt;
** &#039;&#039;&#039;Note if you are using a hosted account:&#039;&#039;&#039; Most hosted accounts on commercial sites will meet Disk and Memory requirements. However, you should contact your web host&#039;s support desk to check that this is the case before signing-up with them. It is especially important to &#039;&#039;&#039;ask about any PHP memory limits or MySQL question limits&#039;&#039;&#039;. If your prospective host does not provide a service which meets these requirements, or you are already signed up with them, ask them why and consider taking your business elsewhere if they do not change.&lt;br /&gt;
&lt;br /&gt;
===Software===&lt;br /&gt;
* Web server software. Most people use [[Apache]], but Moodle should work fine under any web server that supports [[PHP]], such as [[IIS]] on Windows platforms. PHP does impose requirements on versions of web servers, however these are complex and the general advice is to use the newest version possible of your chosen web server. &lt;br /&gt;
* PHP scripting language. (Please note that there have been issues installing Moodle with [http://www.php-accelerator.co.uk PHP-Accelerator]). There are currently two versions (or branches) of PHP available: PHP4 and PHP5 and the version requirements are listed below.&lt;br /&gt;
** For Moodle version 1.4 or later: PHP4 (version 4.1.0 or later) or PHP5 (version 5.1.0 or later) are supported.&lt;br /&gt;
** For Moodle version 1.6 or later: the PHP4 (version 4.3.0 or later) or PHP5 (version 5.1.0 or later) are supported. &lt;br /&gt;
** Future Moodle versions 2.0 or later will not support PHP4 and will require PHP5 (version 5.2.4 or later).&lt;br /&gt;
** PHP Settings. 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. &lt;br /&gt;
*** &#039;&#039;safe_mode&#039;&#039; needs to be OFF.&lt;br /&gt;
*** &#039;&#039;memory_limit&#039;&#039; should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.&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 ON. (It will be recommended to turn it off in 2.0.)&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.&lt;br /&gt;
** PHP Extensions and libraries&lt;br /&gt;
*** The mbstring extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** The iconv extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** [http://www.libgd.org/ GD library] and the [http://www.freetype.org/ FreeType 2] library and extensions are needed to be able to look at the dynamic graphs that the logs pages make. (Freetype support is available as part of the GD extension for the 5.x versions of PHP)&lt;br /&gt;
*** The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.&lt;br /&gt;
*** The pgsql extension is required if you are using the PostgreSQL database.&lt;br /&gt;
*** The pdo and pdo_sqlite extensions are required for the (experimental) SQLite 3 database support.&lt;br /&gt;
*** The curl extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The tokenizer extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).&lt;br /&gt;
*** The xmlrpc extension is required for the Moodle network functionality (Moodle 1.8 or later).&lt;br /&gt;
*** The ctype extension is recommended for Moodle 1.8 or later. &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;
* A working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is &#039;&#039;the&#039;&#039; choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment.&lt;br /&gt;
** For Moodle 1.5, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later). &lt;br /&gt;
** For Moodle 1.6, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).&lt;br /&gt;
** For Moodle 1.7, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
** For Moodle 1.8 or later, MySQL (version 4.1.12 or later), PostgreSQL (8.0 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
: MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting &amp;quot;strict mode&amp;quot; must be OFF (set to &amp;quot;&amp;quot; or &amp;quot;MYSQL40&amp;quot;) in the MySQL configuration file. &lt;br /&gt;
: PostgreSQL Notes: PostgreSQL 7.4 is recommended for earlier Moodle versions, since Moodle 1.8 only PostgreSQL 8.0 and above are supported.&lt;br /&gt;
* For showcases or low to medium-sized installations, Moodle 2.0 also includes (experimental) support for SQLite 3 database. This setup requires no database server, as the database file is stored in a local directory on the server.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== How many users? ==&lt;br /&gt;
&lt;br /&gt;
In addition to the hardware and software requirements, you will also need to think about the capacity of your Moodle installation in terms of the number of users it can handle. There are two numbers to plan for:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Browsing users&#039;&#039;&#039;: the maximum number of users able to browse your Moodle site. This is the number of computers in your organization or on your course (whichever is greater).&lt;br /&gt;
:&#039;&#039;&#039;Concurrent database users&#039;&#039;&#039;: the maximum number of concurrent database users (needed for Moodle activities such as quizzes). This is the number of users who will be using Moodle at the same time. In an educational institution, use your timetable/roster to obtain this figure.&lt;br /&gt;
&lt;br /&gt;
Once you know these figures for your users, you can start work out if your Moodle installation can support this capacity. The exact number of users depends on your hardware/software/network combination. Usually the amount of memory installed (RAM) is the deciding factor but a faster overall processor speed will also help in reducing waiting times for pages to load. &lt;br /&gt;
&lt;br /&gt;
The general rule of thumb for a single server is that the approx max concurrent users = RAM (GB) * 50 and the approx max browsing users = Approx max concurrent users * 5. As an example, a university with 500 total computers on campus and 100 concurrent users at any time will need approx 2GB of RAM on the one server to support the number of concurrent users.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Ask your provider what limits are placed on the number of concurrent database connections and the processor load. This will give a good estimate of the number of users your Moodle install can manage.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note:&#039;&#039;&#039; As of August 31, 2007, Moodle 1.8.2+ is not recommended for large installations, especially if you have large number (e.g. 20,000+) of courses. The main reason is the codes related to ROLES are still not fully optimized with database queries and still need some work. If you are planning to use 1.8.x codes for a larger institution, please make sure that you have sufficient time to do your own testing and performance profiling.  Upgrade to Moodle 1.9!!&lt;br /&gt;
&lt;br /&gt;
[Update|Updating from a previous version] of Moodle has been improved quite a bit from 1.8.3+ version (see this thread discussion: http://moodle.org/mod/forum/discuss.php?d=83281).  Moodle 1.9 has even more improvements in all areas and is the recommended version.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to get Moodle, either as a compressed package or via [[CVS for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
=== Download from compressed packages===&lt;br /&gt;
There are two types of compressed packages at the [http://download.moodle.org/ download.moodle.org page:] which offer a variety of version, operating systems and compression types.&lt;br /&gt;
#The &amp;quot;Standard Distribution&amp;quot; (with Moodle only files) and &lt;br /&gt;
#Several operating system &amp;quot;Complete Install Packages&amp;quot; (which contains programs to create a Moodle in a web environment). Please see [[Complete install packages]] for more information.  &lt;br /&gt;
&lt;br /&gt;
Most of these instructions are for the standard distribution, &lt;br /&gt;
Download a compressed package and then unpack the archive into your file structure using either of these two commands:&lt;br /&gt;
 tar -zxvf [filename]&lt;br /&gt;
 unzip [filename]&lt;br /&gt;
&lt;br /&gt;
===Download from CVS===&lt;br /&gt;
To use CVS, helpful instructions are available at the [[CVS_for_Administrators | CVS for Administrators]] page. The full [http://cvs.moodle.org/moodle/ Moodle CVS repository] is also available for browsing. &lt;br /&gt;
&lt;br /&gt;
If you are using CVS, run the CVS Checkout command.&lt;br /&gt;
&lt;br /&gt;
===Directory created placement===&lt;br /&gt;
After either of the above processes, you will now have with a directory called &amp;quot;moodle&amp;quot;, containing a number of files and folders.&lt;br /&gt;
&lt;br /&gt;
For the standard package, 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;.&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 web site, it is usually better to upload the whole archive as one file, and then do the unpacking on the server. Even web hosting interfaces like cPanel allow you to uncompress archives in the &amp;quot;File Manager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Structure of moodle directory ===&lt;br /&gt;
&lt;br /&gt;
You can safely skip this section, but here is a quick summary of the contents of the Moodle folder, to help get you oriented:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;config.php&#039;&#039; - contains basic settings. This file does not come with Moodle - you will create it by executing install.php or manually.&lt;br /&gt;
:&#039;&#039;install.php&#039;&#039; - the script you will run to create config.php&lt;br /&gt;
:&#039;&#039;version.php&#039;&#039; - defines the current version of Moodle code&lt;br /&gt;
:&#039;&#039;index.php&#039;&#039; - the front page of the site&lt;br /&gt;
:&#039;&#039;admin/&#039;&#039; - code to administrate the whole server&lt;br /&gt;
:&#039;&#039;auth/&#039;&#039; - plugin modules to authenticate users&lt;br /&gt;
:&#039;&#039;blocks/&#039;&#039; - plugin modules for the little side blocks on many pages&lt;br /&gt;
:&#039;&#039;calendar/&#039;&#039; - all the code for managing and displaying calendars&lt;br /&gt;
:&#039;&#039;course/&#039;&#039; - code to display and manage courses&lt;br /&gt;
:&#039;&#039;doc/&#039;&#039; - help documentation for Moodle (eg this page)&lt;br /&gt;
:&#039;&#039;files/&#039;&#039; - code to display and manage uploaded files&lt;br /&gt;
:&#039;&#039;lang/&#039;&#039; - texts in different languages, one directory per language&lt;br /&gt;
:&#039;&#039;lib/&#039;&#039; - libraries of core Moodle code&lt;br /&gt;
:&#039;&#039;login/&#039;&#039; - code to handle login and account creation&lt;br /&gt;
:&#039;&#039;mod/&#039;&#039; - all the main Moodle course modules are in here&lt;br /&gt;
:&#039;&#039;pix/&#039;&#039; - generic site graphics&lt;br /&gt;
:&#039;&#039;theme/&#039;&#039; - theme packs/skins to change the look of the site.&lt;br /&gt;
:&#039;&#039;user/&#039;&#039; - code to display and manage users&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Setting-up your system==&lt;br /&gt;
To ensure that Moodle will install successfully, you need to check that the web server settings are correct, then create a blank database for Moodle to use and finally create a directory on your hard disk for Moodle to save your materials and other files you upload into your courses.&lt;br /&gt;
&lt;br /&gt;
=== Check web server settings ===&lt;br /&gt;
&lt;br /&gt;
*Firstly, make sure that your web server is set up to use index.php as a default page (perhaps in addition to index.html, default.htm and so on). In Apache, this is done using a DirectoryIndex parameter in your httpd.conf file. Mine usually looks like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
:Just make sure index.php is in the list (and preferably towards the start of the list, for efficiency).&lt;br /&gt;
&lt;br /&gt;
*Secondly, &#039;&#039;&#039;if you are using Apache 2&#039;&#039;&#039;, then you should turn on the &#039;&#039;AcceptPathInfo&#039;&#039; variable, which allows scripts to be passed arguments like &amp;lt;nowiki&amp;gt;http://server/file.php/arg1/arg2&amp;lt;/nowiki&amp;gt;. This is essential to allow relative links between your resources, and also provides a performance boost for people using your Moodle web site. You can turn this on by adding these lines to your httpd.conf file. (NB: This setting, or any equivalent, is not required in Apache 1)&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
=== Recheck PHP settings ===&lt;br /&gt;
Moodle requires a number of PHP settings to be active for it to work. These were given in the Requirements section and &#039;&#039;&#039;On most servers these will already be the default settings&#039;&#039;&#039;.  However, some PHP servers (and some of the more recent PHP versions) may have things set differently, so it is useful to double-check that the settings are correct. These are defined in PHP&#039;s configuration file (usually called &#039;&#039;&#039;php.ini&#039;&#039;&#039;) or in the Apache &#039;&#039;&#039;.htaccess&#039;&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
 safe_mode = 0 (necessary)&lt;br /&gt;
 memory_limit = 40M (varies: minimum 16M, 32M Moodle v1.7, 40M Moodle v1.8, 128M large sites)&lt;br /&gt;
 session.save_handler = files (unless you are using another handler, e.g. mm)   &lt;br /&gt;
 magic_quotes_gpc = 1    (preferred but not necessary, 0 will be recommended in 2.0)&lt;br /&gt;
 magic_quotes_runtime = 0    (necessary)&lt;br /&gt;
 file_uploads = 1&lt;br /&gt;
 session.auto_start = 0&lt;br /&gt;
 session.bug_compat_warn = 0&lt;br /&gt;
&lt;br /&gt;
You may also want to set other, optional php.ini file settings while you are already editing it. For instance, you may want to reset the maximum upload size of file attachments, which usually defaults to 2M(egabytes). For instance, to set these to 16 Megabytes:&lt;br /&gt;
 &lt;br /&gt;
 post_max_size = 16M&lt;br /&gt;
 upload_max_filesize = 16M&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Using a .htaccess file for webserver and PHP settings ===&lt;br /&gt;
&lt;br /&gt;
Use the above if you can directly edit your server&#039;s files, but if you are setting-up Moodle on a webhost, or don&#039;t have access to &#039;&#039;&#039;httpd.conf&#039;&#039;&#039; or &#039;&#039;&#039;php.ini&#039;&#039;&#039; on your server, or you have Moodle on a server with other applications that require different settings, then don&#039;t worry, you can often still override the default settings. This only works on Apache servers and only when Overrides have been allowed in the main Apache configuration. Moodle is supplied with a htaccess file which you can use, or you can create your own file manually.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Use the default htaccess file&#039;&#039;&#039;. The easiest thing to do is just copy the sample file from moodle/lib/htaccess and edit it to suit your needs. It contains further instructions. For example, in a Unix shell:&lt;br /&gt;
&lt;br /&gt;
 cd moodle&lt;br /&gt;
 cp moodle/lib/htaccess .htaccess&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Create your own file&#039;&#039;&#039;. Alternatively you can create your own file called &#039;&#039;&#039;.htaccess&#039;&#039;&#039; in Moodle&#039;s main directory that contains lines like the following. &lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
 php_value memory_limit 40M (adjust to your version of Moodle)&lt;br /&gt;
 php_flag magic_quotes_gpc 1&lt;br /&gt;
 php_flag magic_quotes_runtime 0&lt;br /&gt;
 php_flag file_uploads 1&lt;br /&gt;
 php_flag session.auto_start 0&lt;br /&gt;
 php_flag session.bug_compat_warn 0&lt;br /&gt;
&lt;br /&gt;
:If you have Apache version 2 installed, add these lines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IfDefine APACHE2&amp;gt;&lt;br /&gt;
     AcceptPathInfo on&lt;br /&gt;
 &amp;lt;/IfDefine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Otherwise add this single line:&lt;br /&gt;
&lt;br /&gt;
 AcceptPathInfo on&lt;br /&gt;
&lt;br /&gt;
:Optionally, you can also do things like define the maximum size for uploaded files, etc by adding these lines:&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 0&lt;br /&gt;
 php_value upload_max_filesize 2M&lt;br /&gt;
 php_value post_max_size 2M&lt;br /&gt;
&lt;br /&gt;
:The value given in these lines is 2M. You may want to change this at a later date to allow uploading of larger files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Some shared hosts do not allow .htaccess files&#039;&#039;&#039;. In this case, it may be necessary to place a php.ini file within each sub-directory of the site. To do this, you use your editor to create a php.ini file in the main moodle directory and later copy it to all sub-directories. The syntax for the php.ini file is different than the one used in .htaccess - you do not use the php_value and php_flag prefixes. See the example below:&lt;br /&gt;
 upload_max_filesize = 2M&lt;br /&gt;
 post_max_size = 2M&lt;br /&gt;
:After creating the php.ini file with all of the statements you need, run the script http://tips-scripts.com/php_ini_copy or copy php.ini manually to all sub-directories.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Some shared hosts use suPHP, which requires a slightly different configuration&#039;&#039;&#039;. If everything else fails, try creating the following two files and uploading to your moodle root directory&lt;br /&gt;
:php.ini (sample):&lt;br /&gt;
 register_globals = 0&lt;br /&gt;
 display_errors = 0&lt;br /&gt;
&lt;br /&gt;
:.htaccess (sample):&lt;br /&gt;
 suPHP_ConfigPath /home/cPanelName/public_html/moodle&lt;br /&gt;
&lt;br /&gt;
Change the above path to the actual path to your moodle install.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note&#039;&#039;&#039;: Use a .htaccess file only [http://httpd.apache.org/docs/1.3/howto/htaccess.html#when as a last resort] as it can have an impact on the performance of your Moodle site and cause pages to load slowly on your browser.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating an empty database ===&lt;br /&gt;
&lt;br /&gt;
You need to create an empty database (eg &amp;quot;&#039;&#039;moodle&#039;&#039;&amp;quot;) in your database system along with a special user (eg &amp;quot;moodleuser&amp;quot;) that has access to that database (and that database only). You could use the &amp;quot;root&amp;quot; user if you wanted to for a test server, but this is not recommended for a production system: if hackers manage to discover the password then your whole database system would be at risk, rather than just one database.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Warning&#039;&#039;&#039;: Bear in mind that, as of Moodle version 1.5.x, Moodle doesn&#039;t work with MySQL 5.x&#039;s strict mode setting (STRICT_TRANS_TABLES and/or STRICT_ALL_TABLES) -- see [http://moodle.org/mod/forum/discuss.php?d=58552 forum discussion]. So if you are using MySQL 5.x, edit MySQL&#039;s configuration file (called &amp;quot;my.ini&amp;quot; in Windows and &amp;quot;my.cnf&amp;quot; on Unix/Linux) and comment out that option or set it to &amp;lt;code&amp;gt;sql-mode=&#039;&#039;&amp;lt;/code&amp;gt;. You have to restart MySQL after changing this setting. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; If you do not have access to your server, use PHPMyAdmin (or another MySQL client) and enter the command &amp;lt;code&amp;gt;SET @@global.sql_mode=&#039;&#039;;&amp;lt;/code&amp;gt; (be sure to use single quotes, and don&#039;t forget the semicolon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
====Using a hosted server====&lt;br /&gt;
If you are using a webhost, they will probably have a control panel web interface for you to create your database.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;[http://www.cpanel.com/ cPanel]&#039;&#039;&#039; system is one of the most popular of these. &lt;br /&gt;
To create a database using cPanel:&lt;br /&gt;
&lt;br /&gt;
# Click on the &#039;&#039;&#039;MySQL Databases&#039;&#039;&#039; icon.&lt;br /&gt;
# Type &#039;&#039;&#039;moodle&#039;&#039;&#039; in the New Database field and click &#039;&#039;&#039;Create Database&#039;&#039;&#039;.&lt;br /&gt;
# Type a &#039;&#039;username&#039;&#039; and &#039;&#039;password&#039;&#039; (not one you use elsewhere) in the respective fields and click &#039;&#039;&#039;Create  User&#039;&#039;&#039;.&amp;lt;br&amp;gt;Note that the &#039;&#039;username&#039;&#039; and &#039;&#039;database&#039;&#039; names may be prefixed by your cPanel account name and an underscore, and truncated to 16 characters. When entering this information into the Moodle installer - use the full names.&lt;br /&gt;
# Now use the &#039;&#039;&#039;Add Users to Databases&#039;&#039;&#039; button and give this new user account &#039;&#039;&#039;ALL&#039;&#039;&#039; rights to the new database.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#Creating_the_data_directory |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Using a SQLite database====&lt;br /&gt;
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.&lt;br /&gt;
&lt;br /&gt;
Moodle 2.0 offers support for SQLite3 database installations. In this case, no database setup is required. The database file will be created by the installation script. By default, the database file will be store in Moodle&#039;s data directory (see [[Installing_Moodle#Creating_the_data_directory |Creating the data directory]]). During install, the web server must have write access on the directory where the database file will be stored. After installation, the web server must have read-write access to the database file.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#Creating_the_data_directory |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Using the command line====&lt;br /&gt;
&lt;br /&gt;
If you have access to Unix or Windows command lines then you can do the same sort of thing by typing commands. You should do this using the MySQL Client program as follows (commands which you type-in are shown in bold):&lt;br /&gt;
&lt;br /&gt;
- Start the MySQL Client program:&lt;br /&gt;
 #&#039;&#039;&#039;mysql -u root -p&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;
 Your MySQL connection id is 2 to server version: 5.0.22-log&lt;br /&gt;
 &lt;br /&gt;
 Type &#039;help;&#039; or &#039;\h&#039; for help. Type &#039;\c&#039; to clear the buffer.&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The prompt changes to &amp;quot;mysql&amp;gt;&amp;quot; to indicate that you are now working in the MySQL Client program. When working in MySQL, all commands which you type-in must end in a semi-colon. (If you hit the Enter key without the final semi-colon, you&#039;ll get the line continuation symbol &#039;-&amp;gt;&#039;; this is your second chance to type the semi-colon and hit Enter.) &lt;br /&gt;
&lt;br /&gt;
- Begin by checking for any existing databases called &amp;quot;moodle&amp;quot; - if there are any you should change the name in all the commands which follow:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;SHOW DATABASES;&#039;&#039;&#039;&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | Database                |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | information_schema      |&lt;br /&gt;
 | mysql                   |&lt;br /&gt;
 | test                    |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 3 rows in set (0.03 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a database to store the Moodle tables. We&#039;ll call this &amp;quot;moodle&amp;quot;, as there are none with that name already in the above list, but change it if you need to.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;CREATE DATABASE moodle;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Change the default character set and collation of the &amp;quot;moodle&amp;quot; database to UTF8. Leave this out if you are installing Moodle 1.5 or earlier):&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a username and password to access the database &amp;quot;moodle&amp;quot; and grant database access permissions. We&#039;ll call the user &amp;quot;moodleuser&amp;quot; and set the password as &amp;quot;yourpassword&amp;quot;. It&#039;s a good idea to change these for your installation however most people keep the username as &amp;quot;moodleuser&amp;quot;. Remember the username and password you have set, as you&#039;ll need it in the configuration screens later. This is a long command so has been split over several lines by pressing the Return key.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;DROP,INDEX,ALTER ON moodle.*&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 0 rows affected (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Security Warnings&#039;&#039;&#039;: Never leave the password as the one shown here. Make sure you have a strong password (a mixture of letters and numbers, upper and lower case). Avoid granting &amp;quot;ALL&amp;quot; permissions on the database.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: For MySQL 4.0.1 or earlier, you don&#039;t need the CREATE TEMPORARY TABLES permission. &lt;br /&gt;
&lt;br /&gt;
- Exit the MySQL Client program:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;QUIT&#039;&#039;&#039;&lt;br /&gt;
 Bye&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
- Reload the grant tables using the mysqladmin program:&lt;br /&gt;
 #&#039;&#039;&#039;mysqladmin -u root -p reload&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
And some example command lines for PostgreSQL:&lt;br /&gt;
&lt;br /&gt;
   # su - postgres&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create user moodleuser createdb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser with encrypted password &#039;yourpassword&#039;;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create database moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;with encoding &#039;unicode&#039;&amp;lt;/font&amp;gt;;&amp;quot; -U moodleuser template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser nocreatedb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; su - root&lt;br /&gt;
   # /etc/init.d/postgresql reload&lt;br /&gt;
&lt;br /&gt;
If the Postgres create database command above (&amp;gt;psql -c &amp;quot;create database moodle...&amp;quot;) gives an error message you may want to try:&lt;br /&gt;
 psql -c &amp;quot;create database moodle with template=template1 encoding = &#039;unicode&#039; owner =  moodleuser &amp;lt;br&amp;gt;     location = &#039;/var/mydata&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the create database command asks you for a password, run the line containing &#039;encrypted password&#039; first before proceeding.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
* Step-by-step instructions on  [https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Ubuntu installation for Ubuntu(Debian)]&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating the data directory  ===&lt;br /&gt;
&lt;br /&gt;
Moodle will also need some space on your server&#039;s hard disk to store uploaded files, such as course documents and user pictures. The Moodle installer tries hard to create the &#039;&#039;&#039;moodledata&#039;&#039;&#039; directory for you but if it fails then you will have to create a directory for this purpose manually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Security warning&#039;&#039;&#039;: For security purposes, it is &#039;&#039;&#039;CRITICAL&#039;&#039;&#039; that this directory is &#039;&#039;&#039;NOT&#039;&#039;&#039; accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web site root directory (it is the folder that the main part of your URL -that is, the part up to the first single / - points to; for example, in &amp;lt;nowiki&amp;gt;http://your.domain.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;, it is &amp;lt;nowiki&amp;gt;http://your.domain.com/&amp;lt;/nowiki&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
But if you must have it in the web directory (and you are using Apache AND the web server configuration allows .htaccess files to restrict access to directories) then protect it by creating a file in the data directory called &#039;&#039;&#039;.htaccess&#039;&#039;&#039;, containing these lines:&lt;br /&gt;
&lt;br /&gt;
 order deny,allow&lt;br /&gt;
 deny from all&lt;br /&gt;
&lt;br /&gt;
If you are using IIS, you need to edit the properties of the data directory (from the Internet Information Services Manager console) and deny access to that folder to everybody from the web.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;If you don&#039;t protect the data directory from direct web access, anybody will be able to impersonate any user of your Moodle site (including the admin user!!!), and all of your course materials will be available to the web at large.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ownership &amp;amp; Permissions&#039;&#039;&#039;: To make sure that Moodle can save uploaded files in this directory, check that the web server software has permission to read, write and execute in this directory. On Unix machines, this means setting the owner of the directory to be something like &amp;quot;nobody&amp;quot; or &amp;quot;apache&amp;quot;, and then giving that user read, write and execute permissions. As an example, to change the owner to &amp;quot;nobody&amp;quot; you could use:&lt;br /&gt;
&lt;br /&gt;
 chown -R nobody:apache moodledata&lt;br /&gt;
&lt;br /&gt;
To change the permissions so that the owner has read,write and execute permissions, use something like this:&lt;br /&gt;
&lt;br /&gt;
 chmod -R 0770 moodledata&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are receiving permission denied messages, try &#039;&#039;chmod -R 0770 moodledata&#039;&#039; and then adjust the settings so that they are more secure. A more secure setting is &#039;&#039;chmod -R 0750 moodledata&#039;&#039;. According to the comments in config-dist.php, &amp;quot;On hosting systems you might need to make sure that your group has no permissions at all while others have full permissions.&amp;quot; To do this you could use &#039;&#039;chmod -R 707 moodledata&#039;&#039;. See also the [[Security | security page]].&lt;br /&gt;
&lt;br /&gt;
Remember that by default moodle will issue a warning about moodle data directories created inside the web directory, but otherwise this directory can be located where you wish. You can later move or change the location of this directory, but if you do, be sure to edit the setting in the &#039;&#039;&#039;config.php&#039;&#039;&#039; file that sets this; e.g. if moodledata is under a directory called data, then it would look like this:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dataroot  = &#039;/data/moodledata&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CPanel and webhosts&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On cPanel systems you can use the &amp;quot;File Manager&amp;quot; to find the folder, click on it, then choose &amp;quot;Change Permissions&amp;quot;. On many shared hosting servers, you will probably need to restrict all file access to your &amp;quot;group&amp;quot; (to prevent other webhost customers from looking at or changing your files), but provide full read/write access to everyone else (which will allow the web server to access your files). Speak to your server administrator if you are having trouble setting this up securely. In particular it will not be possible to create a usable data directory on sites that use a PHP feature known as &amp;quot;&#039;&#039;&#039;Safe Mode&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Run the installer script to create config.php ==&lt;br /&gt;
&lt;br /&gt;
To run the installer script (install.php), just try to access your Moodle main URL using a web browser, or access &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourserver/install.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; directly.&lt;br /&gt;
&lt;br /&gt;
(The Installer will try to set a session cookie. If you get a popup warning in your browser make sure you accept that cookie!)&lt;br /&gt;
&lt;br /&gt;
Moodle will detect that configuration is necessary and will lead you through some screens to help you create a new configuration file called &#039;&#039;&#039;config.php&#039;&#039;&#039;. At the end of the process Moodle will try and write the file into the right location, otherwise you can press a button to download it from the installer and then upload &#039;&#039;&#039;config.php&#039;&#039;&#039; into the main Moodle directory on the server.&lt;br /&gt;
&lt;br /&gt;
Along the way the installer will test your server environment and give you suggestions about how to fix any problems. For most common issues these suggestions should be sufficient, but if you get stuck, check in the Installation Forum for more help.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Go to the admin page to continue configuration ==&lt;br /&gt;
&lt;br /&gt;
Once the basic config.php has been correctly created in the previous step, trying to access the front page of your site will take you to the &amp;quot;admin&amp;quot; page for the rest of the configuration.&lt;br /&gt;
&lt;br /&gt;
The first time you access this admin page, you will be presented with a GPL &amp;quot;shrink wrap&amp;quot; agreement with which you must agree before you can continue with the setup.&lt;br /&gt;
&lt;br /&gt;
Now Moodle will start setting up your database and creating tables to store data. Firstly, the main database tables are created. You should see a number of SQL statements followed by status messages that look like this:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE course (&lt;br /&gt;
    id int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
    category int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    password varchar(50) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    fullname varchar(254) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    shortname varchar(15) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    summary text NOT NULL,&lt;br /&gt;
    format tinyint(4) NOT NULL default &#039;1&#039;,&lt;br /&gt;
    teacher varchar(100) NOT NULL default &#039;Teacher&#039;,&lt;br /&gt;
    startdate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    enddate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    timemodified int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    PRIMARY KEY (id)&lt;br /&gt;
 ) TYPE=MyISAM;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;SUCCESS&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and so on, followed by: &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Main databases set up successfully.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see these, then there must have been some problem with the database or the configuration settings you defined in config.php. Check that PHP isn&#039;t in a restricted &amp;quot;Safe Mode&amp;quot; (commercial web hosts sometimes have safe mode turned on). You can check PHP variables by creating a little file containing &#039;&#039;&#039;&amp;lt;?php phpinfo() ?&amp;gt;&#039;&#039;&#039; and looking at it through a browser. Check all these and try this page again.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
You should now see a form where you can define more configuration variables for your installation, such as the default language, SMTP hosts and so on. Don&#039;t worry too much about getting everything right just now - you can always come back and edit these later on using the admin interface. The defaults are designed to be useful and secure for most sites. Scroll down to the bottom and click &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If (and only if) you find yourself getting stuck on this page, unable to continue, then your server probably has what I call the &amp;quot;buggy referrer&amp;quot; problem. This is easy to fix: just turn off the &amp;quot;secureforms&amp;quot; setting, then try to continue again.&lt;br /&gt;
&lt;br /&gt;
Next you will see more pages that print lots of status messages as they set up all the tables required by the various Moodle module. As before, they should all be &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;green&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
The next page is a form where you can define parameters for your Moodle site and the front page, such as the name, format, description and so on. Fill this out (you can always come back and change these later) and then press &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finally, you will then be asked to create a top-level administration user for future access to the admin pages. Fill out the details with your own name, email etc and then click &amp;quot;Save changes&amp;quot;. Not all the fields are required, but if you miss any important fields you&#039;ll be re-prompted for them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure you remember the username and password you chose for the administration user account, as they will be necessary to access the administration page in future.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(If for any reason your install is interrupted, or there is a system error of some kind that prevents you from logging in using the admin account, you can usually log in using the default username of &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;, with password &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Once successful, you will be returned to the home page of your new site! Note the administration links that appear down the left hand side of the page (these items also appear on a separate Admin page) - these items are only visible to you because you are logged in as the admin user. All your further administration of Moodle can now be done using this menu, such as:&lt;br /&gt;
&lt;br /&gt;
* creating and deleting courses&lt;br /&gt;
* creating and editing user accounts&lt;br /&gt;
* administering teacher accounts&lt;br /&gt;
* changing site-wide settings like themes etc&lt;br /&gt;
&lt;br /&gt;
But you are not done installing yet! There is one very important thing still to do (see the next section on cron).&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Installing Moodle Using Command Line ==&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
&lt;br /&gt;
Installing Moodle Using command line is just as easy as installing Moodle using web browser. &lt;br /&gt;
* First Go to the moodle root directory and then to admin directory inside the moodle root. &lt;br /&gt;
&lt;br /&gt;
 $cd /var/www/html/moodle/admin&lt;br /&gt;
&lt;br /&gt;
* Then simply use the following syntax to run the moodle command line installer (this is a long command which has been split over 3 lines, so type as one line)&lt;br /&gt;
 $php cliupgrade.php --lang=en --webaddr=&amp;lt;nowiki&amp;gt;http://www.example.com&amp;lt;/nowiki&amp;gt; --moodledir=/var/www/html/moodle &lt;br /&gt;
                     --datadir=/var/moodledata --dbtype=mysql --dbhost=localhost --dbname=moodle &lt;br /&gt;
                     --dbuser=root --prefix=mdl --verbose=1 --interactivelevel=2 &lt;br /&gt;
&lt;br /&gt;
More information about the options can be found using &lt;br /&gt;
$php cliupgrad.php --help&lt;br /&gt;
&lt;br /&gt;
Then you will see the following list of available options&lt;br /&gt;
&lt;br /&gt;
 --lang		 		Valid installed language for installation. Default is English(en)&lt;br /&gt;
 --webaddr			Web address for the Moodle site&lt;br /&gt;
 --moodledir			Location of the moodle web folder&lt;br /&gt;
 --datadir			Location of the moodle data folder (should not be web visible)&lt;br /&gt;
 --dbtype			Database type. Default it mysql&lt;br /&gt;
 --dbhost			Database host. Default localhost&lt;br /&gt;
 --dbname			Database name. Default is moodle&lt;br /&gt;
 --dbuser			Database user. Default is blank&lt;br /&gt;
 --dbpass			Database password. Default is blank&lt;br /&gt;
 --prefix			        Table prefix for above database tables. Default is mdl&lt;br /&gt;
 --verbose			0 No output, 1 Summarized output(Default), 2 Detailed output&lt;br /&gt;
 --interactivelevel	        0 Non interactive, 1 Semi interactive(Default), 2 Interactive&lt;br /&gt;
 --help				print out this help&lt;br /&gt;
&lt;br /&gt;
When you choose non interactive mode without any options all the default values are assumed.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Set up cron ==&lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
== Set up backups ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Backup settings| backup instructions]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Create a new course ==&lt;br /&gt;
&lt;br /&gt;
Now that Moodle is running properly, you can try creating a new course to play with.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Create a new course&amp;quot; from the Admin page (or the admin links on the home page).&lt;br /&gt;
&lt;br /&gt;
Fill out the form, paying special attention to the course format. You don&#039;t have to worry about the details too much at this stage, as everything can be changed later by the teacher. Note that the yellow help icons are everywhere to provide contextual help on any aspect.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;Save changes&amp;quot;, and you will be taken to a new form where you can assign teachers to the course. You can only add existing user accounts from this form - if you want to create a new teacher account then either ask the teacher to create one for themselves (see the login page), or create one for them using the &amp;quot;Add a new user&amp;quot; on the Admin page.&lt;br /&gt;
&lt;br /&gt;
Once done, the course is ready to customize, and is accessible via the &amp;quot;Courses&amp;quot; link on the home page.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
* [[Complete install packages]] might be an easier first time installs on some systems&lt;br /&gt;
* Help forum:  [http://moodle.org/mod/forum/view.php?id=28 Installation problems]&lt;br /&gt;
* [[Installing Apache, MySQL and PHP]] - Open source programs that can run Moodle on the web or on a desktop&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=42688 Selecting a web host for Moodle] forum discussion&lt;br /&gt;
* [[masquerading|Masquerading]] - Running Moodle behind a masquerading/NAT firewall&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[cs:Instalace]]&lt;br /&gt;
[[de:Installieren von Moodle]]&lt;br /&gt;
[[es:Instalación de moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;br /&gt;
[[nl:Installatiegids]]&lt;br /&gt;
[[pl:Instalacja Moodle]]&lt;br /&gt;
[[pt:Instalação do Moodle]]&lt;br /&gt;
[[ru:Установка Moodle]]&lt;br /&gt;
[[sk:Inštalácia]]&lt;br /&gt;
[[zh:安装Moodlezh:]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Email_setup_gmail&amp;diff=46990</id>
		<title>Email setup gmail</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Email_setup_gmail&amp;diff=46990"/>
		<updated>2008-11-21T00:10:05Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Tips and tricks */  clarification&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google&#039;s mail servers can be set up as the SMTP server for Moodle.  This reduces or eliminates the need for an email service on a server and is especially useful if [http://www.google.com/apps/ Google Apps] is used by the institution using Moodle.  &lt;br /&gt;
&lt;br /&gt;
This will require a hack to the code.&lt;br /&gt;
&lt;br /&gt;
== [[Email settings]] ==&lt;br /&gt;
Location: &#039;&#039;Administration &amp;gt; Server &amp;gt; [[Email settings|Email]]&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SMTP hosts:&#039;&#039;&#039; smtp.gmail.com:465   &#039;&#039;NOTE: Leave out the port (:465) in 1.9.2 or lower&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SMTP username:&#039;&#039;&#039; Your email address @gmail.com or your own domain if using Google Apps&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SMTP password:&#039;&#039;&#039; password for the above email account&lt;br /&gt;
&lt;br /&gt;
== Code Modification ==&lt;br /&gt;
In your Moodle site go to &amp;lt;tt&amp;gt;/lib/phpmailer/&amp;lt;/tt&amp;gt; and modify the following file:&lt;br /&gt;
&lt;br /&gt;
=== class.smtp.php ===&lt;br /&gt;
Around line 83 DIRECTLY after the &#039;&#039;&#039;Connect&#039;&#039;&#039; function header, insert this line immediately after the &amp;quot;{&amp;quot; :&lt;br /&gt;
 $host = &#039;ssl://&#039; . $host;&lt;br /&gt;
&lt;br /&gt;
== Code Modification (1.9.2 or lower) == &lt;br /&gt;
These two additional modifications need to be made in 1.9.2 or lower as the &#039;&#039;&#039;SMTP hosts&#039;&#039;&#039; setting above will not allow the port to be included.&lt;br /&gt;
&lt;br /&gt;
=== class.phpmailer.php ===&lt;br /&gt;
around line 162 &lt;br /&gt;
*Change &amp;lt;tt&amp;gt;var $Port = 25;&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;var $Port = 465;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== class.smtp.php ===&lt;br /&gt;
around line 30&lt;br /&gt;
*Change &amp;lt;tt&amp;gt;var $SMTP_PORT = 25;&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;var $SMTP_PORT = 465;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
* Some sites may need the additional step of un-commenting the &#039;&#039;&#039;php_openssl.dll&#039;&#039;&#039; extension in &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== See also==&lt;br /&gt;
[[Email settings]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Email_setup_gmail&amp;diff=46989</id>
		<title>Email setup gmail</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Email_setup_gmail&amp;diff=46989"/>
		<updated>2008-11-21T00:08:18Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Code Modification */ grammar corrections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Google&#039;s mail servers can be set up as the SMTP server for Moodle.  This reduces or eliminates the need for an email service on a server and is especially useful if [http://www.google.com/apps/ Google Apps] is used by the institution using Moodle.  &lt;br /&gt;
&lt;br /&gt;
This will require a hack to the code.&lt;br /&gt;
&lt;br /&gt;
== [[Email settings]] ==&lt;br /&gt;
Location: &#039;&#039;Administration &amp;gt; Server &amp;gt; [[Email settings|Email]]&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SMTP hosts:&#039;&#039;&#039; smtp.gmail.com:465   &#039;&#039;NOTE: Leave out the port (:465) in 1.9.2 or lower&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SMTP username:&#039;&#039;&#039; Your email address @gmail.com or your own domain if using Google Apps&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SMTP password:&#039;&#039;&#039; password for the above email account&lt;br /&gt;
&lt;br /&gt;
== Code Modification ==&lt;br /&gt;
In your Moodle site go to &amp;lt;tt&amp;gt;/lib/phpmailer/&amp;lt;/tt&amp;gt; and modify the following file:&lt;br /&gt;
&lt;br /&gt;
=== class.smtp.php ===&lt;br /&gt;
Around line 83 DIRECTLY after the &#039;&#039;&#039;Connect&#039;&#039;&#039; function header, insert this line immediately after the &amp;quot;{&amp;quot; :&lt;br /&gt;
 $host = &#039;ssl://&#039; . $host;&lt;br /&gt;
&lt;br /&gt;
== Code Modification (1.9.2 or lower) == &lt;br /&gt;
These two additional modifications need to be made in 1.9.2 or lower as the &#039;&#039;&#039;SMTP hosts&#039;&#039;&#039; setting above will not allow the port to be included.&lt;br /&gt;
&lt;br /&gt;
=== class.phpmailer.php ===&lt;br /&gt;
around line 162 &lt;br /&gt;
*Change &amp;lt;tt&amp;gt;var $Port = 25;&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;var $Port = 465;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== class.smtp.php ===&lt;br /&gt;
around line 30&lt;br /&gt;
*Change &amp;lt;tt&amp;gt;var $SMTP_PORT = 25;&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;var $SMTP_PORT = 465;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
* Some sites may need an additional step to un-comment the &#039;&#039;&#039;php_openssl.dll&#039;&#039;&#039; extension in &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== See also==&lt;br /&gt;
[[Email settings]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=46942</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=46942"/>
		<updated>2008-11-19T09:53:54Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Installation hangs when setting-up database tables */  added another work-around&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;?PHP phpinfo() ?&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;
== 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. Use this template to copy and paste into your post:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* Browser name (version also if possible):&lt;br /&gt;
* Moodle version:&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached?(Y/N):&lt;br /&gt;
* Phpinfo attached? (Y/N):&lt;br /&gt;
&lt;br /&gt;
For the last two items, try to include the following in your post as an attachment:&lt;br /&gt;
* A copy of your phpinfo output as shown in your browser (see the instructions above for an explanation of how to obtain this, or see [[phpinfo]]).&lt;br /&gt;
* A copy of the Moodle configuration file (with secret info like database password deleted, of course). This is located in the main Moodle directory (by default called moodle), and is named config.php&lt;br /&gt;
&lt;br /&gt;
Copy and paste both of these into a single text file (using vi, Notepad, etc) and attach this to your post. If your PC is a Windows box and config.php looks messy (line breaks missing or in the wrong places) in Notepad, try Wordpad.&lt;br /&gt;
&lt;br /&gt;
If you cannot provide your phpinfo, try to copy &amp;amp; paste and complete these in your post:&lt;br /&gt;
* Webserver (e.g. Apache/IIS) version:&lt;br /&gt;
* Database server (e.g. MySQL, PostgreSQL) version:&lt;br /&gt;
* PHP version:&lt;br /&gt;
&lt;br /&gt;
For installation on web hosting accounts: contact your support desk who should be able to tell you this information.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Security Warning&#039;&#039;&#039;: Make sure you edit any files and delete any passwords before posting onto the forum.&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. Please remember that manually editing the file is not recommended and may lead to blank pages, especially if there are additional spaces and/or lines after the final php closing tag &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
* &#039;&#039;&#039;Generic Packages&#039;&#039;&#039;: If your server does not meet the [[Installing_Moodle#Requirements | requirements]] for the current version of Moodle, 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 http://download.moodle.org/stable15. 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, or alternatively use these URLs for zip or tgz downloads:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].tgz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Changes made in the version in the last month are listed in the &amp;quot;CHANGES&amp;quot; file in the directory listing. The files you download contain Moodle code and are not the Windows or Mac packages - so you need to have a webserver, a database server and PHP already installed. The earliest version available is Moodle 1.3.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download previous releases of the 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 previous releases of the Mac pacakges, 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;
* &#039;&#039;&#039;Using CVS&#039;&#039;&#039;: You can also use CVS to download older releases and incremental releases of the Moodle generic packages, e.g. Moodle 1.5.4 - see the [[CVS_for_Administrators | CVS documentation]].&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. &lt;br /&gt;
* &#039;&#039;&#039;Using the php.ini file&#039;&#039;&#039;: The log settings are contained in the php.ini file stored on the server. If you don&#039;t know where that is, edit your Moodle &#039;&#039;config.php&#039;&#039; and add the following as the second line&lt;br /&gt;
&lt;br /&gt;
  phpinfo();&lt;br /&gt;
&lt;br /&gt;
:then reload the web page. Look for the entry &#039;&#039;&#039;Configuration File (php.ini) Path&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:When you have located php.ini open it in your favorite text editor. Find the &#039;&#039;&#039;Error handling and logging&#039;&#039;&#039; section of the php.ini file. Make sure that both &#039;&#039;&#039;display_errors = On&#039;&#039;&#039;, &#039;&#039;&#039;display_startup_errors = On&#039;&#039;&#039; and &#039;&#039;&#039;log_errors = On&#039;&#039;&#039; are present and uncommented. Check the value of &#039;&#039;&#039;error_log&#039;&#039;&#039; - this tells you the location of the file errors are logged to. If it is commented out then errors will be sent to the web server error log file. Remember, if you make any changes to this file you will need to restart the web server (or just reboot the server).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Using ini_set commands&#039;&#039;&#039;: If you are using Moodle 1.7 or higher, the previous steps are not enough. In those versions error logging parameters are dependant on certain administrative settings that you specify in the debugging section. The problem is that if you can&#039;t access the administrative pages, you can&#039;t set the debugging options. So the only way to modify them is by adding the following lines to your config.php file, just before the last line (the one containing a single&#039;?&amp;gt;&#039; only):&lt;br /&gt;
&lt;br /&gt;
  ini_set (&#039;display_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;log_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;display_startup_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;error_reporting&#039;, E_ALL);&lt;br /&gt;
  $CFG-&amp;gt;debug = DEBUG_ALL;&lt;br /&gt;
&lt;br /&gt;
:This will enable the same settings specified above even if Moodle sets them otherwise. &lt;br /&gt;
:&#039;&#039;&#039;Important&#039;&#039;&#039;: Remember to put them just before the last line of config.php.&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.&lt;br /&gt;
&lt;br /&gt;
Basically, you need to set up a process to regularly call the script &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://yoursite/admin/cron.php&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Try the default settings in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039;. This generally works.&lt;br /&gt;
*Make sure that &#039;&#039;allowuseremailcharset&#039;&#039; in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039; is set to No. Setting this to Yes can cause a problem in some versions of Moodle.&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;
The most common cause for this is that your own computer (not your Moodle server) has 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;
&lt;br /&gt;
Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script &amp;lt;nowiki&amp;gt;http://yourserver/moodle/lib/session-test.php&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page.&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;
==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;
If you are not using Apache 2 and you still have this problem (unlikely) then you can switch Moodle to use an alternative method. The disadvantages are a slight loss of performance for your users and you won&#039;t be able to use relative links within HTML resources.&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;
==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;
 $CFG-&amp;gt;dirroot = &amp;quot;d:\inetpub\sites\www.yoursite.com\web\moodle&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL. 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 MySQL 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;
 phpinfo();&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if MySQL is supported. If not look for a package you are missing.&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 [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your 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. &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. This will be an abrupt hang with half the page displayed in the browser and/or other outputs removed. Examples are:&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Truncated MySQL statements&#039;&#039;&#039;:&lt;br /&gt;
 &lt;br /&gt;
 (mysql): SET NAMES &#039;utf8&#039;&lt;br /&gt;
 --------------------------------------------------------------------------------&lt;br /&gt;
 (mysql): SHOW LOCAL VARIABLES LIKE &#039;character_set_database&#039;&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 (no more statements are displayed)   &lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Missing Continue button&#039;&#039;&#039;: The “Scroll to continue” link is displayed but no “Continue” button is there. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: There is an exception to this when upgrading an existing database and the installation may appear to hang at the roles generation phase. This process can take a very long time - so please be patient.&lt;br /&gt;
&lt;br /&gt;
Below are some solutions you can try to overcome this problem:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check for MySQL limits&#039;&#039;&#039;. This is often a MySQL error and not a php error. Check that there is no limit placed on your mysql database, e.g. a &amp;quot;questions&amp;quot; limit. See [http://dev.mysql.com/doc/refman/5.0/en/user-resources.html Limiting Account Resources in the MySQL manual].&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your .htaccess files&#039;&#039;&#039;. If the install is on a webhost, adding the following line to the .htaccess file in the Moodle directory has been known to solve the problem.&lt;br /&gt;
 AddType x-mapp-php5 .php&lt;br /&gt;
&lt;br /&gt;
:Try also renaming the .htaccess file so that it is disabled.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Code customizations&#039;&#039;&#039;. You may also want to look and see if you&#039;ve customized any of your code.  Look at the last successful table, and then look at the block, mod, or other code that is referenced by that table.  For example, if your install hangs and continues to say that the forum tables were successful as the last message, look at /mod/forum/ for any custom code.  If you have customized code, backup those files and replace with the correct files.  You can then restart the install by renaming config.php or reinstalling your database from the backup.  If your install is successful, you can make your code changes back into the stock Moodle code.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your memory limit&#039;&#039;&#039;. It may also be that the &amp;quot;memory_limit&amp;quot; in your php.ini is set too low. Please check your php.ini file and allocate the recommended amount (see [https://docs.moodle.org/en/Installing_Moodle#Requirements Moodle requirements]). For Moodle version 1.8 and above at least 40MB is  recommended.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Upgrade incrementally&#039;&#039;&#039;. To avoid this problem when upgrading, it is recommended to upgrade via each version of Moodle, for example 1.7 -&amp;gt; 1.8 -&amp;gt; 1.9 (with the exception of upgrading from 1.5 or 1.6, when it is recommended that 1.7 be skipped, in other words upgrade 1.5 -&amp;gt; 1.6 -&amp;gt; 1.8 -&amp;gt; 1.9).&lt;br /&gt;
&lt;br /&gt;
A work-around to this problem is to setup a working Moodle system on your local PC or server using the [http://download.moodle.org Moodle Packages]. Once you have a running Moodle, [https://docs.moodle.org/en/Upgrading_Moodle#Backup_important_data backup the database] and import to your webhost. Then backup the Moodle code itself (the &amp;quot;moodle&amp;quot; directory on your PC) and copy this to your webhost using (for example) FTP. Finally, edit the moodle/config.php file for the new settings that have to be changed for the webhost.&lt;br /&gt;
&lt;br /&gt;
Some Moodlers have found the suggestion in http://moodle.org/mod/forum/discuss.php?d=65786#p297433 helpful, for some unknown reason. It claims that it is because the fopen function in the line (now line 426 instead of 406) was not being given a string as the first argument, but that&#039;s not true. It was a string; after the edit it is a string whose first and last characters are single quote marks. The amazing thing is that it works at all after that edit. What&#039;s even more amazing is that it fixes the problem, at least for some users. Go figure.&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 because GD is not enabled on your server. GD is a library that allows image processing.&lt;br /&gt;
&lt;br /&gt;
1. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going into Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[Variables]] 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;
&lt;br /&gt;
2. 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;
&lt;br /&gt;
==How do I uninstall Moodle?==&lt;br /&gt;
&#039;&#039;&#039;Moodle package installation&#039;&#039;&#039;: If you have downloaded a Moodle package, simply uninstall using your system commands. On Windows PCs, you should access the Control Panel -&amp;gt; Add/Remove Programs. Select the package name and click Change or Remove Programs.&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;
==How do I upgrade Moodle? Do I just overwrite the files?==&lt;br /&gt;
Do not overwrite files, it may cause strange errors. You should read the [[Upgrade]] documentation before proceeding.&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;
==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;
==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;
The second place to check are the server files.  The php.ini file has a limit which will override any other setting. (Hint: remember to restart your server for changes to take effect).  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;
&lt;br /&gt;
==How do I install Moodle on Windows Vista?==&lt;br /&gt;
&lt;br /&gt;
See [[Installing Moodle on Windows Vista]].&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;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[nl:Installatie FAQ]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[ru:Установка FAQ]]&lt;br /&gt;
[[pl:Instalacja FAQ]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=46480</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=46480"/>
		<updated>2008-11-08T01:10:55Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* System information needed for Installation problems forum */ added clarifications&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;?PHP phpinfo() ?&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;
== 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. Use this template to copy and paste into your post:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* Browser name (version also if possible):&lt;br /&gt;
* Moodle version:&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached?(Y/N):&lt;br /&gt;
* Phpinfo attached? (Y/N):&lt;br /&gt;
&lt;br /&gt;
For the last two items, try to include the following in your post as an attachment:&lt;br /&gt;
* A copy of your phpinfo output as shown in your browser (see the instructions above for an explanation of how to obtain this, or see [[phpinfo]]).&lt;br /&gt;
* A copy of the Moodle configuration file (with secret info like database password deleted, of course). This is located in the main Moodle directory (by default called moodle), and is named config.php&lt;br /&gt;
&lt;br /&gt;
Copy and paste both of these into a single text file (using vi, Notepad, etc) and attach this to your post. If your PC is a Windows box and config.php looks messy (line breaks missing or in the wrong places) in Notepad, try Wordpad.&lt;br /&gt;
&lt;br /&gt;
If you cannot provide your phpinfo, try to copy &amp;amp; paste and complete these in your post:&lt;br /&gt;
* Webserver (e.g. Apache/IIS) version:&lt;br /&gt;
* Database server (e.g. MySQL, PostgreSQL) version:&lt;br /&gt;
* PHP version:&lt;br /&gt;
&lt;br /&gt;
For installation on web hosting accounts: contact your support desk who should be able to tell you this information.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Security Warning&#039;&#039;&#039;: Make sure you edit any files and delete any passwords before posting onto the forum.&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. Please remember that manually editing the file is not recommended and may lead to blank pages, especially if there are additional spaces and/or lines after the final php closing tag &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
* &#039;&#039;&#039;Generic Packages&#039;&#039;&#039;: If your server does not meet the [[Installing_Moodle#Requirements | requirements]] for the current version of Moodle, 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 http://download.moodle.org/stable15. 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, or alternatively use these URLs for zip or tgz downloads:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].tgz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Changes made in the version in the last month are listed in the &amp;quot;CHANGES&amp;quot; file in the directory listing. The files you download contain Moodle code and are not the Windows or Mac packages - so you need to have a webserver, a database server and PHP already installed. The earliest version available is Moodle 1.3.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download previous releases of the 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 previous releases of the Mac pacakges, 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;
* &#039;&#039;&#039;Using CVS&#039;&#039;&#039;: You can also use CVS to download older releases and incremental releases of the Moodle generic packages, e.g. Moodle 1.5.4 - see the [[CVS_for_Administrators | CVS documentation]].&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. &lt;br /&gt;
* &#039;&#039;&#039;Using the php.ini file&#039;&#039;&#039;: The log settings are contained in the php.ini file stored on the server. If you don&#039;t know where that is, edit your Moodle &#039;&#039;config.php&#039;&#039; and add the following as the second line&lt;br /&gt;
&lt;br /&gt;
  phpinfo();&lt;br /&gt;
&lt;br /&gt;
:then reload the web page. Look for the entry &#039;&#039;&#039;Configuration File (php.ini) Path&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:When you have located php.ini open it in your favorite text editor. Find the &#039;&#039;&#039;Error handling and logging&#039;&#039;&#039; section of the php.ini file. Make sure that both &#039;&#039;&#039;display_errors = On&#039;&#039;&#039;, &#039;&#039;&#039;display_startup_errors = On&#039;&#039;&#039; and &#039;&#039;&#039;log_errors = On&#039;&#039;&#039; are present and uncommented. Check the value of &#039;&#039;&#039;error_log&#039;&#039;&#039; - this tells you the location of the file errors are logged to. If it is commented out then errors will be sent to the web server error log file. Remember, if you make any changes to this file you will need to restart the web server (or just reboot the server).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Using ini_set commands&#039;&#039;&#039;: If you are using Moodle 1.7 or higher, the previous steps are not enough. In those versions error logging parameters are dependant on certain administrative settings that you specify in the debugging section. The problem is that if you can&#039;t access the administrative pages, you can&#039;t set the debugging options. So the only way to modify them is by adding the following lines to your config.php file, just before the last line (the one containing a single&#039;?&amp;gt;&#039; only):&lt;br /&gt;
&lt;br /&gt;
  ini_set (&#039;display_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;log_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;display_startup_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;error_reporting&#039;, E_ALL);&lt;br /&gt;
  $CFG-&amp;gt;debug = DEBUG_ALL;&lt;br /&gt;
&lt;br /&gt;
:This will enable the same settings specified above even if Moodle sets them otherwise. &lt;br /&gt;
:&#039;&#039;&#039;Important&#039;&#039;&#039;: Remember to put them just before the last line of config.php.&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.&lt;br /&gt;
&lt;br /&gt;
Basically, you need to set up a process to regularly call the script &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://yoursite/admin/cron.php&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Try the default settings in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039;. This generally works.&lt;br /&gt;
*Make sure that &#039;&#039;allowuseremailcharset&#039;&#039; in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039; is set to No. Setting this to Yes can cause a problem in some versions of Moodle.&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;
The most common cause for this is that your own computer (not your Moodle server) has 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;
&lt;br /&gt;
Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script &amp;lt;nowiki&amp;gt;http://yourserver/moodle/lib/session-test.php&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page.&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;
==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;
If you are not using Apache 2 and you still have this problem (unlikely) then you can switch Moodle to use an alternative method. The disadvantages are a slight loss of performance for your users and you won&#039;t be able to use relative links within HTML resources.&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;
==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;
 $CFG-&amp;gt;dirroot = &amp;quot;d:\inetpub\sites\www.yoursite.com\web\moodle&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL. 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 MySQL 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;
 phpinfo();&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if MySQL is supported. If not look for a package you are missing.&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 [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your 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. &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. This will be an abrupt hang with half the page displayed in the browser and/or other outputs removed. Examples are:&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Truncated MySQL statements&#039;&#039;&#039;:&lt;br /&gt;
 &lt;br /&gt;
 (mysql): SET NAMES &#039;utf8&#039;&lt;br /&gt;
 --------------------------------------------------------------------------------&lt;br /&gt;
 (mysql): SHOW LOCAL VARIABLES LIKE &#039;character_set_database&#039;&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 (no more statements are displayed)   &lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Missing Continue button&#039;&#039;&#039;: The “Scroll to continue” link is displayed but no “Continue” button is there. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: There is an exception to this when upgrading an existing database and the installation may appear to hang at the roles generation phase. This process can take a very long time - so please be patient.&lt;br /&gt;
&lt;br /&gt;
Below are some solutions you can try to overcome this problem:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check for MySQL limits&#039;&#039;&#039;. This is often a MySQL error and not a php error. Check that there is no limit placed on your mysql database, e.g. a &amp;quot;questions&amp;quot; limit. See [http://dev.mysql.com/doc/refman/5.0/en/user-resources.html Limiting Account Resources in the MySQL manual].&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your .htaccess files&#039;&#039;&#039;. If the install is on a webhost, adding the following line to the .htaccess file in the Moodle directory has been known to solve the problem.&lt;br /&gt;
 AddType x-mapp-php5 .php&lt;br /&gt;
&lt;br /&gt;
:Try also renaming the .htaccess file so that it is disabled.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Code customizations&#039;&#039;&#039;. You may also want to look and see if you&#039;ve customized any of your code.  Look at the last successful table, and then look at the block, mod, or other code that is referenced by that table.  For example, if your install hangs and continues to say that the forum tables were successful as the last message, look at /mod/forum/ for any custom code.  If you have customized code, backup those files and replace with the correct files.  You can then restart the install by renaming config.php or reinstalling your database from the backup.  If your install is successful, you can make your code changes back into the stock Moodle code.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your memory limit&#039;&#039;&#039;. It may also be that the &amp;quot;memory_limit&amp;quot; in your php.ini is set too low. Please check your php.ini file and allocate the recommended amount (see [https://docs.moodle.org/en/Installing_Moodle#Requirements Moodle requirements]). For Moodle version 1.8 and above at least 40MB is  recommended.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Upgrade incrementally&#039;&#039;&#039;. To avoid this problem when upgrading, it is recommended to upgrade via each version of Moodle, for example 1.7 -&amp;gt; 1.8 -&amp;gt; 1.9 (with the exception of upgrading from 1.5 or 1.6, when it is recommended that 1.7 be skipped, in other words upgrade 1.5 -&amp;gt; 1.6 -&amp;gt; 1.8 -&amp;gt; 1.9).&lt;br /&gt;
&lt;br /&gt;
A work-around to this problem is to setup a working Moodle system on your local PC or server using the [http://download.moodle.org Moodle Packages]. Once you have a running Moodle, [https://docs.moodle.org/en/Upgrading_Moodle#Backup_important_data backup the database] and import to your webhost. Then backup the Moodle code itself (the &amp;quot;moodle&amp;quot; directory on your PC) and copy this to your webhost using (for example) FTP. Finally, edit the moodle/config.php file for the new settings that have to be changed for the webhost.&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 because GD is not enabled on your server. GD is a library that allows image processing.&lt;br /&gt;
&lt;br /&gt;
1. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going into Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[Variables]] 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;
&lt;br /&gt;
2. 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;
&lt;br /&gt;
==How do I uninstall Moodle?==&lt;br /&gt;
&#039;&#039;&#039;Moodle package installation&#039;&#039;&#039;: If you have downloaded a Moodle package, simply uninstall using your system commands. On Windows PCs, you should access the Control Panel -&amp;gt; Add/Remove Programs. Select the package name and click Change or Remove Programs.&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;
==How do I upgrade Moodle? Do I just overwrite the files?==&lt;br /&gt;
Do not overwrite files, it may cause strange errors. You should read the [[Upgrade]] documentation before proceeding.&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;
==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;
==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;
The second place to check are the server files.  The php.ini file has a limit which will override any other setting. (Hint: remember to restart your server for changes to take effect).  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;
&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;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[nl:Installatie FAQ]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[ru:Установка FAQ]]&lt;br /&gt;
[[pl:Instalacja FAQ]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_Moodle_on_Windows_Vista&amp;diff=46034</id>
		<title>Installing Moodle on Windows Vista</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_Moodle_on_Windows_Vista&amp;diff=46034"/>
		<updated>2008-11-02T12:59:34Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: corrected grammar and typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Many people tried to install Moodle on Windows Vista, but got a blank screen after database config. This is due to some Vista permission issue.&lt;br /&gt;
This method is from a Moodle forum and might help Moodle installation.&lt;br /&gt;
&lt;br /&gt;
1. Create a &amp;quot;moodledata&amp;quot; directory somewhere on your PC ( May be c:\wwwroot\moodledata  )&lt;br /&gt;
Not sure if this step is needed, but it worked.&lt;br /&gt;
&lt;br /&gt;
   1. Right-click on the folder moodledata, select Properties, then select the Security tab.&lt;br /&gt;
   2. Click on &amp;quot;Everyone&amp;quot; (&amp;quot;Users&amp;quot; on some machines) in the top window (Group or User Names)&lt;br /&gt;
 then click Edit.&lt;br /&gt;
   3. Check to allow read and write permissions for Everyone (List folder contents and Read &amp;amp;&lt;br /&gt;
 Execute should already be checked)&lt;br /&gt;
&lt;br /&gt;
2. Create config.php in your main Moodle directory&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;?php /// Moodle Configuration File&lt;br /&gt;
   &lt;br /&gt;
   unset($CFG);&lt;br /&gt;
   &lt;br /&gt;
   $CFG-&amp;gt;dbtype = &#039;mysql&#039;; //Database Type&lt;br /&gt;
   $CFG-&amp;gt;dbhost = &#039;localhost&#039;; //Database Host&lt;br /&gt;
   $CFG-&amp;gt;dbname = &#039;moodle&#039;; //Database Name&lt;br /&gt;
   $CFG-&amp;gt;dbuser = &#039;root&#039;; //Database User&lt;br /&gt;
   $CFG-&amp;gt;dbpass = &#039;&#039;; //Database Password&lt;br /&gt;
   $CFG-&amp;gt;dbpersist = false;&lt;br /&gt;
   $CFG-&amp;gt;prefix = &#039;mdl_&#039;; //Table Prefix&lt;br /&gt;
   &lt;br /&gt;
   $CFG-&amp;gt;wwwroot = &amp;lt;nowiki&amp;gt;&#039;http://localhost/moodle&#039;&amp;lt;/nowiki&amp;gt;; //Location where moodle is accessed&lt;br /&gt;
   $CFG-&amp;gt;dirroot = &#039;C:\wwwroot\moodle&#039;; //Directory of Moodle&lt;br /&gt;
   $CFG-&amp;gt;dataroot = &#039;C:\moodledata&#039;; //Directory of moodledata folder (Created in step 1,&lt;br /&gt;
                                     //should be inaccessible through HTTP)&lt;br /&gt;
   $CFG-&amp;gt;admin = &#039;admin&#039;;&lt;br /&gt;
   &lt;br /&gt;
   $CFG-&amp;gt;directorypermissions = 00777; // try 02777 on a server in Safe Mode&lt;br /&gt;
   &lt;br /&gt;
   $CFG-&amp;gt;unicodedb = true; // If Database is utf8&lt;br /&gt;
   &lt;br /&gt;
   require_once(&amp;quot;$CFG-&amp;gt;dirroot/lib/setup.php&amp;quot;);&lt;br /&gt;
   // MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,&lt;br /&gt;
   // RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.&lt;br /&gt;
   ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Go to your browser and type your moodle URL. You should get a screen that allows you to continue installation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Alternative Installation method ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have had any issues installing Moodle on Windows Vista this may be a solution for you.&lt;br /&gt;
This was performed on a Vista Laptop running the Business Edition of Vista.&lt;br /&gt;
&lt;br /&gt;
This solution uses XAMPP.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Go to this URL and download the latest version for Windows: http://download.moodle.org/windows/&lt;br /&gt;
&lt;br /&gt;
2. This package includes XAMPP. I unzipped my package into C:\moodle19\ . Then start Moodle by going to C:\Moodle19\ and selecting &amp;quot;Start Moodle&amp;quot;. After it completes, select &amp;quot;Stop Moodle&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
One thing I have noted, after you do this the first time, is that it is easier on further occasions to create a shortcut on the desktop to &amp;quot;xampp-control&amp;quot; and another to &amp;quot;xampp_stop&amp;quot; (both in the server folder). You use xampp-control to start Apache and Mysql. You can use xampp_stop, should anything fall over (which occasionally does on my version.. Suspect it is a problem with Vista and Xampp??)&lt;br /&gt;
&lt;br /&gt;
3. Start Apache and MySql and then go to your browser and type : &amp;lt;nowiki&amp;gt;http://127.0.0.1/&amp;lt;/nowiki&amp;gt; . Follow the online guide. (This is how I got around the permissions issue described in the instructions above). &lt;br /&gt;
&lt;br /&gt;
4. Once setup is complete, modify the file located in Server/moodle  called config.php. Adjust the line&lt;br /&gt;
&lt;br /&gt;
    $CFG-&amp;gt;wwwroot = &amp;lt;nowiki&amp;gt;&#039;http://127.0.0.1&#039;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to &lt;br /&gt;
&lt;br /&gt;
    $CFG-&amp;gt;wwwroot = &amp;lt;nowiki&amp;gt;&#039;http://localhost&#039;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. I noted on my install the following: From the Xampp Control Panel, it shows a &#039;Directory Mismatch error&#039;.&lt;br /&gt;
This is fixed by using the guide provided here:&lt;br /&gt;
&lt;br /&gt;
   All you have to do is open the registry editor (start ---&amp;gt; run ---&amp;gt; type regedit then&lt;br /&gt;
 enter). Navigate to HKEY_LOCAL_MACHINE\SOFTWARE.    &lt;br /&gt;
   Right-click on SOFTWARE and Choose New ---&amp;gt; Key. Then, type XAMPP, then click OK. Navigate&lt;br /&gt;
 to the XAMPP Key you just created, then right  click on the right column (anywhere in the&lt;br /&gt;
 big white space) then again, New ---&amp;gt; String Value. Name it Install_Dir (probably case&lt;br /&gt;
 sensitive!) then hit Enter. Double click this value and in the appropriate box, type the&lt;br /&gt;
 path of your current XAMPP installation (E:\xampp in our case).  &lt;br /&gt;
   Close the registry and restart the Control Panel and you&#039;re ready to start. &lt;br /&gt;
&lt;br /&gt;
6. Finally, to ensure you site gets all the images, Site Administration -&amp;gt; Miscellaneous -&amp;gt; Experimental -&amp;gt; Smart Pix Search (Selected)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=73852 Installing on Windows Vista] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Installation sur Windows Vista]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=45446</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=45446"/>
		<updated>2008-10-17T06:53:20Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Installation hangs when setting-up database tables */ corrected grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;?PHP phpinfo() ?&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;
== 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. Use this template to copy and paste into your post:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* Browser name (version also if possible):&lt;br /&gt;
* Moodle version:&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached?(Y/N):&lt;br /&gt;
* Phpinfo attached? (Y/N):&lt;br /&gt;
&lt;br /&gt;
For the last two items, try to include the following in your post as an attachment:&lt;br /&gt;
* A copy of your phpinfo output as shown in your browser (see the instructions above for an explanation of how to obtain this).&lt;br /&gt;
* A copy of the Moodle configuration file. This is located in the directory moodle and is named config.php&lt;br /&gt;
&lt;br /&gt;
Copy and paste both of these into a single text file (using vi, Notepad, etc) and attach this to your post.&lt;br /&gt;
&lt;br /&gt;
If you cannot provide your phpinfo, try to copy &amp;amp; paste and complete these in your post:&lt;br /&gt;
* Webserver (e.g. Apache/IIS) version:&lt;br /&gt;
* Database server (e.g. MySQL, PostgreSQL) version:&lt;br /&gt;
* PHP version:&lt;br /&gt;
&lt;br /&gt;
For installation on web hosting accounts: contact your support desk who should be able to tell you this information.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Security Warning&#039;&#039;&#039;: Make sure you edit any files and delete any passwords before posting onto the forum.&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. Please remember that manually editing the file is not recommended and may lead to blank pages, especially if there are additional spaces and/or lines after the final php closing tag &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
* &#039;&#039;&#039;Generic Packages&#039;&#039;&#039;: If your server does not meet the [[Installing_Moodle#Requirements | requirements]] for the current version of Moodle, 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 http://download.moodle.org/stable15. 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, or alternatively use these URLs for zip or tgz downloads:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].tgz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Changes made in the version in the last month are listed in the &amp;quot;CHANGES&amp;quot; file in the directory listing. The files you download contain Moodle code and are not the Windows or Mac packages - so you need to have a webserver, a database server and PHP already installed. The earliest version available is Moodle 1.3.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download previous releases of the 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 previous releases of the Mac pacakges, 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;
* &#039;&#039;&#039;Using CVS&#039;&#039;&#039;: You can also use CVS to download older releases and incremental releases of the Moodle generic packages, e.g. Moodle 1.5.4 - see the [[CVS_for_Administrators | CVS documentation]].&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. &lt;br /&gt;
* &#039;&#039;&#039;Using the php.ini file&#039;&#039;&#039;: The log settings are contained in the php.ini file stored on the server. If you don&#039;t know where that is, edit your Moodle &#039;&#039;config.php&#039;&#039; and add the following as the second line&lt;br /&gt;
&lt;br /&gt;
  phpinfo();&lt;br /&gt;
&lt;br /&gt;
:then reload the web page. Look for the entry &#039;&#039;&#039;Configuration File (php.ini) Path&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:When you have located php.ini open it in your favorite text editor. Find the &#039;&#039;&#039;Error handling and logging&#039;&#039;&#039; section of the php.ini file. Make sure that both &#039;&#039;&#039;display_errors = On&#039;&#039;&#039;, &#039;&#039;&#039;display_startup_errors = On&#039;&#039;&#039; and &#039;&#039;&#039;log_errors = On&#039;&#039;&#039; are present and uncommented. Check the value of &#039;&#039;&#039;error_log&#039;&#039;&#039; - this tells you the location of the file errors are logged to. If it is commented out then errors will be sent to the web server error log file. Remember, if you make any changes to this file you will need to restart the web server (or just reboot the server).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Using ini_set commands&#039;&#039;&#039;: If you are using Moodle 1.7 or higher, the previous steps are not enough. In those versions error logging parameters are dependant on certain administrative settings that you specify in the debugging section. The problem is that if you can&#039;t access the administrative pages, you can&#039;t set the debugging options. So the only way to modify them is by adding the following lines to your config.php file, just before the last line (the one containing a single&#039;?&amp;gt;&#039; only):&lt;br /&gt;
&lt;br /&gt;
  ini_set (&#039;display_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;log_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;display_startup_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;error_reporting&#039;, E_ALL);&lt;br /&gt;
  $CFG-&amp;gt;debug = DEBUG_ALL;&lt;br /&gt;
&lt;br /&gt;
:This will enable the same settings specified above even if Moodle sets them otherwise. &lt;br /&gt;
:&#039;&#039;&#039;Important&#039;&#039;&#039;: Remember to put them just before the last line of config.php.&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.&lt;br /&gt;
&lt;br /&gt;
Basically, you need to set up a process to regularly call the script &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://yoursite/admin/cron.php&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Try the default settings in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039;. This generally works.&lt;br /&gt;
*Make sure that &#039;&#039;allowuseremailcharset&#039;&#039; in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039; is set to No. Setting this to Yes can cause a problem in some versions of Moodle.&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;
The most common cause for this is that your own computer (not your Moodle server) has 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;
&lt;br /&gt;
Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script &amp;lt;nowiki&amp;gt;http://yourserver/moodle/lib/session-test.php&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page.&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;
==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;
If you are not using Apache 2 and you still have this problem (unlikely) then you can switch Moodle to use an alternative method. The disadvantages are a slight loss of performance for your users and you won&#039;t be able to use relative links within HTML resources.&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;
==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;
 $CFG-&amp;gt;dirroot = &amp;quot;d:\inetpub\sites\www.yoursite.com\web\moodle&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL. 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 MySQL 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;
 phpinfo();&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if MySQL is supported. If not look for a package you are missing.&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 [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your 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. &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. This will be an abrupt hang with half the page displayed in the browser and/or other outputs removed. Examples are:&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Truncated MySQL statements&#039;&#039;&#039;:&lt;br /&gt;
 &lt;br /&gt;
 (mysql): SET NAMES &#039;utf8&#039;&lt;br /&gt;
 --------------------------------------------------------------------------------&lt;br /&gt;
 (mysql): SHOW LOCAL VARIABLES LIKE &#039;character_set_database&#039;&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 (no more statements are displayed)   &lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Missing Continue button&#039;&#039;&#039;: The “Scroll to continue” link is displayed but no “Continue” button is there. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: There is an exception to this when upgrading an existing database and the installation may appear to hang at the roles generation phase. This process can take a very long time - so please be patient.&lt;br /&gt;
&lt;br /&gt;
Below are some solutions you can try to overcome this problem:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check for MySQL limits&#039;&#039;&#039;. This is often a MySQL error and not a php error. Check that there is no limit placed on your mysql database, e.g. a &amp;quot;questions&amp;quot; limit. See [http://dev.mysql.com/doc/refman/5.0/en/user-resources.html Limiting Account Resources in the MySQL manual].&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your .htaccess files&#039;&#039;&#039;. If the install is on a webhost, adding the following line to the .htaccess file in the Moodle directory has been known to solve the problem.&lt;br /&gt;
 AddType x-mapp-php5 .php&lt;br /&gt;
&lt;br /&gt;
:Try also renaming the .htaccess file so that it is disabled.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Code customizations&#039;&#039;&#039;. You may also want to look and see if you&#039;ve customized any of your code.  Look at the last successful table, and then look at the block, mod, or other code that is referenced by that table.  For example, if your install hangs and continues to say that the forum tables were successful as the last message, look at /mod/forum/ for any custom code.  If you have customized code, backup those files and replace with the correct files.  You can then restart the install by renaming config.php or reinstalling your database from the backup.  If your install is successful, you can make your code changes back into the stock Moodle code.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your memory limit&#039;&#039;&#039;. It may also be that the &amp;quot;memory_limit&amp;quot; in your php.ini is set too low. Please check your php.ini file and allocate the recommended amount (see [https://docs.moodle.org/en/Installing_Moodle#Requirements Moodle requirements]). For Moodle version 1.8 and above at least 40MB is  recommended.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Upgrade incrementally&#039;&#039;&#039;. To avoid this problem when upgrading, it is recommended to upgrade via each version of Moodle, for example 1.7 -&amp;gt; 1.8 -&amp;gt; 1.9 (with the exception of upgrading from 1.5 or 1.6, when it is recommended that 1.7 be skipped, in other words upgrade 1.5 -&amp;gt; 1.6 -&amp;gt; 1.8 -&amp;gt; 1.9).&lt;br /&gt;
&lt;br /&gt;
A work-around to this problem is to setup a working Moodle system on your local PC or server using the [http://download.moodle.org Moodle Packages]. Once you have a running Moodle, [https://docs.moodle.org/en/Upgrading_Moodle#Backup_important_data backup the database] and import to your webhost. Then backup the Moodle code itself (the &amp;quot;moodle&amp;quot; directory on your PC) and copy this to your webhost using (for example) FTP. Finally, edit the moodle/config.php file for the new settings that have to be changed for the webhost.&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 because GD is not enabled on your server. GD is a library that allows image processing.&lt;br /&gt;
&lt;br /&gt;
1. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going into Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[Variables]] 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;
&lt;br /&gt;
2. 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;
&lt;br /&gt;
==How do I uninstall Moodle?==&lt;br /&gt;
&#039;&#039;&#039;Moodle package installation&#039;&#039;&#039;: If you have downloaded a Moodle package, simply uninstall using your system commands. On Windows PCs, you should access the Control Panel -&amp;gt; Add/Remove Programs. Select the package name and click Change or Remove Programs.&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;
==How do I upgrade Moodle? Do I just overwrite the files?==&lt;br /&gt;
Do not overwrite files, it may cause strange errors. You should read the [[Upgrade]] documentation before proceeding.&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;
==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;
==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;
The second place to check are the server files.  The php.ini file has a limit which will override any other setting. (Hint: remember to restart your server for changes to take effect).  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;
&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;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[nl:Installatie FAQ]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[ru:Установка FAQ]]&lt;br /&gt;
[[pl:Instalacja FAQ]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=44787</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=44787"/>
		<updated>2008-10-05T02:29:27Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Installation hangs when setting-up database tables */  add link to MySQL manual&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;?PHP phpinfo() ?&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;
== 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. Use this template to copy and paste into your post:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* Browser name (version also if possible):&lt;br /&gt;
* Moodle version:&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached?(Y/N):&lt;br /&gt;
* Phpinfo attached? (Y/N):&lt;br /&gt;
&lt;br /&gt;
For the last two items, try to include the following in your post as an attachment:&lt;br /&gt;
* A copy of your phpinfo output as shown in your browser (see the instructions above for an explanation of how to obtain this).&lt;br /&gt;
* A copy of the Moodle configuration file. This is located in the directory moodle and is named config.php&lt;br /&gt;
&lt;br /&gt;
Copy and paste both of these into a single text file (using vi, Notepad, etc) and attach this to your post.&lt;br /&gt;
&lt;br /&gt;
If you cannot provide your phpinfo, try to copy &amp;amp; paste and complete these in your post:&lt;br /&gt;
* Webserver (e.g. Apache/IIS) version:&lt;br /&gt;
* Database server (e.g. MySQL, PostgreSQL) version:&lt;br /&gt;
* PHP version:&lt;br /&gt;
&lt;br /&gt;
For installation on web hosting accounts: contact your support desk who should be able to tell you this information.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Security Warning&#039;&#039;&#039;: Make sure you edit any files and delete any passwords before posting onto the forum.&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. Please remember that manually editing the file is not recommended and may lead to blank pages, especially if there are additional spaces and/or lines after the final php closing tag &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
* &#039;&#039;&#039;Generic Packages&#039;&#039;&#039;: If your server does not meet the [[Installing_Moodle#Requirements | requirements]] for the current version of Moodle, 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 http://download.moodle.org/stable15. 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, or alternatively use these URLs for zip or tgz downloads:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].tgz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Changes made in the version in the last month are listed in the &amp;quot;CHANGES&amp;quot; file in the directory listing. The files you download contain Moodle code and are not the Windows or Mac packages - so you need to have a webserver, a database server and PHP already installed. The earliest version available is Moodle 1.3.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download previous releases of the 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 previous releases of the Mac pacakges, 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;
* &#039;&#039;&#039;Using CVS&#039;&#039;&#039;: You can also use CVS to download older releases and incremental releases of the Moodle generic packages, e.g. Moodle 1.5.4 - see the [[CVS_for_Administrators | CVS documentation]].&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. &lt;br /&gt;
* &#039;&#039;&#039;Using the php.ini file&#039;&#039;&#039;: The log settings are contained in the php.ini file stored on the server. If you don&#039;t know where that is, edit your Moodle &#039;&#039;config.php&#039;&#039; and add the following as the second line&lt;br /&gt;
&lt;br /&gt;
  phpinfo();&lt;br /&gt;
&lt;br /&gt;
:then reload the web page. Look for the entry &#039;&#039;&#039;Configuration File (php.ini) Path&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:When you have located php.ini open it in your favorite text editor. Find the &#039;&#039;&#039;Error handling and logging&#039;&#039;&#039; section of the php.ini file. Make sure that both &#039;&#039;&#039;display_errors = On&#039;&#039;&#039;, &#039;&#039;&#039;display_startup_errors = On&#039;&#039;&#039; and &#039;&#039;&#039;log_errors = On&#039;&#039;&#039; are present and uncommented. Check the value of &#039;&#039;&#039;error_log&#039;&#039;&#039; - this tells you the location of the file errors are logged to. If it is commented out then errors will be sent to the web server error log file. Remember, if you make any changes to this file you will need to restart the web server (or just reboot the server).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Using ini_set commands&#039;&#039;&#039;: If you are using Moodle 1.7 or higher, the previous steps are not enough. In those versions error logging parameters are dependant on certain administrative settings that you specify in the debugging section. The problem is that if you can&#039;t access the administrative pages, you can&#039;t set the debugging options. So the only way to modify them is by adding the following lines to your config.php file, just before the last line (the one containing a single&#039;?&amp;gt;&#039; only):&lt;br /&gt;
&lt;br /&gt;
  ini_set (&#039;display_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;log_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;display_startup_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;error_reporting&#039;, E_ALL);&lt;br /&gt;
  $CFG-&amp;gt;debug = DEBUG_ALL;&lt;br /&gt;
&lt;br /&gt;
:This will enable the same settings specified above even if Moodle sets them otherwise. &lt;br /&gt;
:&#039;&#039;&#039;Important&#039;&#039;&#039;: Remember to put them just before the last line of config.php.&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.&lt;br /&gt;
&lt;br /&gt;
Basically, you need to set up a process to regularly call the script &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://yoursite/admin/cron.php&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Try the default settings in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039;. This generally works.&lt;br /&gt;
*Make sure that &#039;&#039;allowuseremailcharset&#039;&#039; in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039; is set to No. Setting this to Yes can cause a problem in some versions of Moodle.&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;
The most common cause for this is that your own computer (not your Moodle server) has 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;
&lt;br /&gt;
The server admin can also fix this for everyone by changing the &#039;&#039;secureforms&#039;&#039; variable to &#039;No&#039; in the security section of Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]].&lt;br /&gt;
&lt;br /&gt;
Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script &amp;lt;nowiki&amp;gt;http://yourserver/moodle/lib/session-test.php&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page.&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;
==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;
If you are not using Apache 2 and you still have this problem (unlikely) then you can switch Moodle to use an alternative method. The disadvantages are a slight loss of performance for your users and you won&#039;t be able to use relative links within HTML resources.&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;
==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;
 $CFG-&amp;gt;dirroot = &amp;quot;d:\inetpub\sites\www.yoursite.com\web\moodle&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL. 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 MySQL 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;
 phpinfo();&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if MySQL is supported. If not look for a package you are missing.&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 [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your 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. &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. This will be an abrupt hang with half the page displayed in the browser and/or other outputs removed. Examples are:&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Truncated mysql statements&#039;&#039;&#039;:&lt;br /&gt;
 &lt;br /&gt;
 (mysql): SET NAMES &#039;utf8&#039;&lt;br /&gt;
 --------------------------------------------------------------------------------&lt;br /&gt;
 (mysql): SHOW LOCAL VARIABLES LIKE &#039;character_set_database&#039;&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 (no more statements are displayed)   &lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Missing Continue button&#039;&#039;&#039;: The “Scroll to continue” link is displayed but no “Continue” button is there. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: There is an exception to this when upgrading an existing database and the installation may appear to hang at the roles generation phase. This process can take a very long time - so please be patient.&lt;br /&gt;
&lt;br /&gt;
Below are some solutions you can try to overcome this problem:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check for mysql limits&#039;&#039;&#039;. This is often a mysql error and not a php error. Check that there is no limit placed on your mysql database, e.g. a &amp;quot;questions&amp;quot; limit. See [http://dev.mysql.com/doc/refman/5.0/en/user-resources.html the mysql manual].&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your .htaccess files&#039;&#039;&#039;. If the install is on a webhost, adding the following line to the .htaccess file in the moodle directory has been known to solve the problem.&lt;br /&gt;
 AddType x-mapp-php5 .php&lt;br /&gt;
&lt;br /&gt;
:Try also renaming the .htaccess file so that it is disabled.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Code customizations&#039;&#039;&#039;. You may also want to look and see if you&#039;ve customized any of your code.  Look at the last successful table, and then look at the block, mod, or other code that is referenced by that table.  For example, if your install hangs and continues to say that the forum tables were successful as the last message, look at /mod/forum/ for any custom code.  If you have customized code, backup those files and replace with the correct files.  You can then restart the install by renaming config.php or reinstalling your database from the backup.  If your install is successful, you can make your code changes back into the stock Moodle code.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your memory limit&#039;&#039;&#039;. It may also be that the &amp;quot;memory_limit&amp;quot; in your php.ini is set too low. Please check your php.ini file and allocate the recommended amount (see [https://docs.moodle.org/en/Installing_Moodle#Requirements Moodle requirements]). For Moodle version 1.8 and above at least 40MB is  recommended.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Upgrade incrementally&#039;&#039;&#039;. To avoid this problem when upgrading, it is recommended to upgrade via each version of Moodle, for example 1.7 -&amp;gt; 1.8 -&amp;gt; 1.9 (with the exception of upgrading from 1.5 or 1.6, when it is recommended that 1.7 is skipped, in other words upgrade 1.5 -&amp;gt; 1.6 -&amp;gt; 1.8 -&amp;gt; 1.9).&lt;br /&gt;
&lt;br /&gt;
A work-around to this problem is to setup a working Moodle system on your local PC or server using the [http://download.moodle.org Moodle Packages]. Once you have a running Moodle, [https://docs.moodle.org/en/Upgrading_Moodle#Backup_important_data backup the database] and import to your webhost. Then backup the Moodle code itself (the &amp;quot;moodle&amp;quot; directory on your PC) and copy this to your webhost using (for example) FTP. Finally, edit the moodle/config.php file for the new settings that have to be changed for the webhost.&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 because GD is not enabled on your server. GD is a library that allows image processing.&lt;br /&gt;
&lt;br /&gt;
1. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going into Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[Variables]] 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;
&lt;br /&gt;
2. 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;
&lt;br /&gt;
==How do I uninstall Moodle?==&lt;br /&gt;
&#039;&#039;&#039;Moodle package installation&#039;&#039;&#039;: If you have downloaded a Moodle package, simply uninstall using your system commands. On Windows PCs, you should access the Control Panel -&amp;gt; Add/Remove Programs. Select the package name and click Change or Remove Programs.&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;
==How do I upgrade Moodle? Do I just overwrite the files?==&lt;br /&gt;
Do not overwrite files, it may cause strange errors. You should read the [[Upgrade]] documentation before proceeding.&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;
==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;
==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;
The second place to check are the server files.  The php.ini file has a limit which will override any other setting. (Hint: remember to restart your server for changes to take effect).  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;
&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;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[nl:Installatie FAQ]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[ru:Установка FAQ]]&lt;br /&gt;
[[pl:Instalacja FAQ]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Administrator_documentation&amp;diff=44770</id>
		<title>Administrator documentation</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Administrator_documentation&amp;diff=44770"/>
		<updated>2008-10-03T18:02:58Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* FAQs */  added link to new FAQ page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The purpose of this page is to list useful links by general topics for administrators.&lt;br /&gt;
&lt;br /&gt;
== Installation &amp;amp; Upgrading ==&lt;br /&gt;
&lt;br /&gt;
*[[Installation Quickstart]] for an overview of the installation steps&lt;br /&gt;
*[[Installing Moodle]] for detailed installation instructions&lt;br /&gt;
*[[Installation FAQ]]&lt;br /&gt;
*[[Installing AMP|Options for installing Apache, MySQL and PHP]]&lt;br /&gt;
*[[Upgrading|Upgrading Moodle]]&lt;br /&gt;
&lt;br /&gt;
== System-specific Instructions &amp;amp; Packages ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unix/Linux-based&#039;&#039;&#039;&lt;br /&gt;
* [[SUSE Linux Server 10|Automated Installation Guide for SUSE Linux Enterprise Server 10]] operating system&lt;br /&gt;
* [[RedHat Linux installation|Step by Step Installation Guide for RedHat]] operating system&lt;br /&gt;
* [[Debian GNU/Linux installation|Step by Step Installation Guide for Debian GNU/Linux]] operating system&lt;br /&gt;
* [[Step-by-step Install Guide for Ubuntu]]&lt;br /&gt;
* [[Step-by-step Install Guide for Ubuntu using apt-get]]&lt;br /&gt;
* [[Step-by-step Install Guide for Zenwalk-5.0]]&lt;br /&gt;
* [[OLPC XS installation|Step by Step Installation Guide for the One Laptop per Child XS Server (Beta)]]&lt;br /&gt;
* [[Step-by-step Install Guide for Solaris 10 with Oracle 10]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
* [[Windows installation|Windows installations with instructions for Windows NT/2000/2003 servers]]&lt;br /&gt;
* [[Windows installation using XAMPP|Windows installation using XAMPP: Apache, MySQL and PHP]]&lt;br /&gt;
* [[Development:Windows_Installer_anywhere|MoodleAnywhere]] another Windows installation package&lt;br /&gt;
* [[Installing Moodle on Windows Vista]] - how to&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mac&#039;&#039;&#039;&lt;br /&gt;
* [[Complete Install Packages for Mac OS X | Complete Install Packages for Mac OS X 10.3/10.4/10.5]]&lt;br /&gt;
* [[Step-by-step Guide for Installing Moodle on Mac OS X 10.4 Client|Step by Step Installation on a Mac OS X 10.4 Client using the internal web server]]&lt;br /&gt;
* [[Step by Step Installation on a Mac OS X 10.5 Server]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Web Hosts&#039;&#039;&#039;&lt;br /&gt;
* [[1and1_MySQL_installation | Installation on 1and1 web hosting]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Others&#039;&#039;&#039;&lt;br /&gt;
* [[Installing Oracle for PHP]]&lt;br /&gt;
&lt;br /&gt;
==Security, Performance and Roles==&lt;br /&gt;
&lt;br /&gt;
*[[Security]] contains important security procedures for a production site&lt;br /&gt;
*[[Performance | Performance and optimization]] for ideas on improving the speed of your installation&lt;br /&gt;
*[[Manage roles | Managing roles]] For Moodle 1.7 and later.&lt;br /&gt;
*[[suhosin]] is an advanced protection system for PHP installation. It was designed to protect servers and users from known and unknown flaws in PHP applications and the PHP core.&lt;br /&gt;
&lt;br /&gt;
== FAQs ==&lt;br /&gt;
&lt;br /&gt;
*[[Installation FAQ]]&lt;br /&gt;
*[[Administration FAQ]]&lt;br /&gt;
*[[Backup FAQ]]&lt;br /&gt;
*[[Errors FAQ]]&lt;br /&gt;
&lt;br /&gt;
== Configuration Settings ==&lt;br /&gt;
*[[Site administration block]] contains configuration setting links&lt;br /&gt;
*[[Notification page]] used to update versions&lt;br /&gt;
*[[Variables]]&lt;br /&gt;
*[[Site settings]]&lt;br /&gt;
*[[Themes]]&lt;br /&gt;
*[[Language]]&lt;br /&gt;
*[[Activity modules administration]]&lt;br /&gt;
*[[Blocks administration]]&lt;br /&gt;
*[[Filters]]&lt;br /&gt;
*[[Backup settings]]&lt;br /&gt;
*[[HTML editor settings]]&lt;br /&gt;
*[[Calendar settings]]&lt;br /&gt;
*[[Maintenance mode]]&lt;br /&gt;
&lt;br /&gt;
* See also: &lt;br /&gt;
**[[Location of admin settings in 1.7|Comparison between configuration settings in Moodle 1.6 &amp;amp; 1.7]]&lt;br /&gt;
&lt;br /&gt;
==User Management==&lt;br /&gt;
&lt;br /&gt;
*[[Authentication]]&lt;br /&gt;
*[[Add new user|Add a new user]] - on a site&lt;br /&gt;
*[[Upload users]] - from a file to a site, and into existing course and group, some existing user global updates&lt;br /&gt;
*[[Enrolment plugins]]&lt;br /&gt;
**[[Flat file]] - enrol existing users in a course&lt;br /&gt;
*[[Roles and capabilities|Assigning user a role]] - typical assignments include:&lt;br /&gt;
**[[Students|Enrol students in a course]]&lt;br /&gt;
**[[Courses (administrator)|Assign teachers]] - to a course&lt;br /&gt;
**[[Assign creators|Assign course creators]] - in a site&lt;br /&gt;
**[[Assign administrators]] - in a site&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
&lt;br /&gt;
*[[Courses (administrator)|Courses]] and [[Course formats|course formats]]&lt;br /&gt;
*[[Reports (administrator)]] and [[Logs]]&lt;br /&gt;
*[[Site files]]&lt;br /&gt;
*[[Moodle database|Database]]&lt;br /&gt;
*[[Environment]]&lt;br /&gt;
*[[Moodle Network]] and Moodle [[Community hub]]&lt;br /&gt;
*[[Streaming Media]]&lt;br /&gt;
*[[Case studies (administrator)]]&lt;br /&gt;
*[[Anti-virus]]&lt;br /&gt;
*[[System Monitoring and Server Statistic Software]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[:Category:Administrator | Index of all Administrator-related pages]]&lt;br /&gt;
*[[Integrations]]&lt;br /&gt;
*[[CVS for Administrators]]&lt;br /&gt;
*[[Email processing]]&lt;br /&gt;
*[[Search engine optimization]]&lt;br /&gt;
*[[Messaging]]&lt;br /&gt;
*[[Migration]]&lt;br /&gt;
*[[Metacourses]]&lt;br /&gt;
*[[Block layout]]&lt;br /&gt;
*[[Customizing Moodle]]&lt;br /&gt;
*[[Administrator do&#039;s and don&#039;ts]]&lt;br /&gt;
*[[Using Moodle book]] Chapter 16: Moodle Administration&lt;br /&gt;
*[[Administration hacks]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Administrator]]&lt;br /&gt;
[[cs:Rukověť správce]]&lt;br /&gt;
[[es:Documentación para Administradores]]&lt;br /&gt;
[[eu:Kudeatzaileentzako dokumentazioa]]&lt;br /&gt;
[[fr:Documentation administrateur]]&lt;br /&gt;
[[ja:管理者ドキュメント]]&lt;br /&gt;
[[ko:관리자 문서]]&lt;br /&gt;
[[nl:Documentatie voor beheerders]]&lt;br /&gt;
[[pt:Documentação para administradores]]&lt;br /&gt;
[[ru:Администраторам]]&lt;br /&gt;
[[sk:Dokumentácia pre správcov]]&lt;br /&gt;
[[zh:管理员文档]]&lt;br /&gt;
[[pl:Administrator documentation]]&lt;br /&gt;
[[fi:Ylläpitäjän opas]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=44488</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=44488"/>
		<updated>2008-09-29T10:34:19Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Using a hosted server */  fix broken link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Firstly, don&#039;t panic! :-)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install Moodle for the first time. For some of these steps it goes into a lot of detail to try and cover the majority of possible web server setups, so this page may look long and complicated. Don&#039;t panic, once you know how to do it you can install Moodle in minutes!&lt;br /&gt;
&lt;br /&gt;
If you have problems please read this page carefully - most common issues are answered in here. If you still have trouble, you can seek help from the Moodle community via  [http://moodle.org/course/view.php?id=5 moodle.org Using Moodle].&lt;br /&gt;
&lt;br /&gt;
Another option is to contact a [http://moodle.com/hosting/ Moodle Partner providing Moodle hosting] who can completely maintain Moodle for you, so that you can ignore all this and get straight into educating! A Moodle partner is the preferred option but if you decide to choose a hosting company that has cpanel then [http://ic.eflclasses.org/tutorials/settingupmoodleonhostingwitholdcpanel.swf this tutorial will guide you]  through the process of choosing a host and setting up moodle via the old cpanel. If you have the new cpanel please use this link [http://ic.eflclasses.org/tutorials/settingupmoodleoncpanel.swf this tutorial will guide you].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; some hosting companies offer one-click moodle install options such as fantastico, which whilst sometimes effective, usually use old (sometimes years old) versions of moodle and sometimes simply don&#039;t work. If one of these goes wrong, your best bet is often to start from scratch following the instructions here yourself. Its almost certainly quicker.&lt;br /&gt;
&lt;br /&gt;
If you want to run Moodle on your own computer and this page looks a bit daunting, then please see our guides on how to install one of Moodle&#039;s complete [[Complete install packages for Windows|Windows packages]], [[Complete Install Packages for Mac OS X|Mac OS packages]] or [[Installing AMP |Installing Apache, MySQL and PHP(AMP)]]. They provide alternative instructions to install all this on most popular platforms.&lt;br /&gt;
&lt;br /&gt;
==Table of Contents==&lt;br /&gt;
__TOC__&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), but is also regularly tested with Windows XP/2000/2003 (WAMP), Solaris 10 (Sparc and x64), Mac OS X and Netware 6 operating systems. Support for PostgreSQL, Oracle and Microsoft SQL Server is also available.&lt;br /&gt;
&lt;br /&gt;
The procedure for installing Moodle on the Windows platform (e.g. Windows Server, IIS and MSSQL) varies slightly to the procedure for the LAMP platform. See [[Installation for Windows 2003 with IIS]] for more details.&lt;br /&gt;
&lt;br /&gt;
[[Installing Moodle on Windows Vista]] might help with &#039;&#039;&#039;Blank page problem while installing Moodle on Windows Vista&#039;&#039;&#039; .&lt;br /&gt;
&lt;br /&gt;
The requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
===Hardware === &lt;br /&gt;
* Disk space: 160MB free (min). You will require more free space to store your teaching materials.&lt;br /&gt;
* Memory: 256MB (min), 1GB (recommended). The general rule of thumb is that Moodle can support 50 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination. &lt;br /&gt;
** &#039;&#039;&#039;Note if you are using a hosted account:&#039;&#039;&#039; Most hosted accounts on commercial sites will meet Disk and Memory requirements. However, you should contact your web host&#039;s support desk to check that this is the case before signing-up with them. It is especially important to &#039;&#039;&#039;ask about any PHP memory limits or MySQL question limits&#039;&#039;&#039;. If your prospective host does not provide a service which meets these requirements, or you are already signed up with them, ask them why and consider taking your business elsewhere if they do not change.&lt;br /&gt;
&lt;br /&gt;
===Software===&lt;br /&gt;
* Web server software. Most people use [[Apache]], but Moodle should work fine under any web server that supports [[PHP]], such as [[IIS]] on Windows platforms. PHP does impose requirements on versions of web servers, however these are complex and the general advice is to use the newest version possible of your chosen web server. &lt;br /&gt;
* PHP scripting language. (Please note that there have been issues installing Moodle with [http://www.php-accelerator.co.uk PHP-Accelerator]). There are currently two versions (or branches) of PHP available: PHP4 and PHP5 and the version requirements are listed below.&lt;br /&gt;
** For Moodle version 1.4 or later: PHP4 (version 4.1.0 or later) or PHP5 (version 5.1.0 or later) are supported.&lt;br /&gt;
** For Moodle version 1.6 or later: the PHP4 (version 4.3.0 or later) or PHP5 (version 5.1.0 or later) are supported. &lt;br /&gt;
** Future Moodle versions 2.0 or later will not support PHP4 and will require PHP5 (version 5.2.4 or later).&lt;br /&gt;
** PHP Settings. 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. &lt;br /&gt;
*** &#039;&#039;safe_mode&#039;&#039; needs to be OFF.&lt;br /&gt;
*** &#039;&#039;memory_limit&#039;&#039; should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.&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 ON. (It will be recommended to turn it off in 2.0.)&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.&lt;br /&gt;
** PHP Extensions and libraries&lt;br /&gt;
*** The mbstring extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** The iconv extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** [http://www.libgd.org/ GD library] and the [http://www.freetype.org/ FreeType 2] library and extensions are needed to be able to look at the dynamic graphs that the logs pages make.&lt;br /&gt;
*** The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.&lt;br /&gt;
*** The pgsql extension is required if you are using the PostgreSQL database.&lt;br /&gt;
*** The pdo and pdo_sqlite extensions are required for the (experimental) SQLite 3 database support.&lt;br /&gt;
*** The curl extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The tokenizer extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).&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;
* A working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is &#039;&#039;the&#039;&#039; choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment.&lt;br /&gt;
** For Moodle 1.5, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later). &lt;br /&gt;
** For Moodle 1.6, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).&lt;br /&gt;
** For Moodle 1.7, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
** For Moodle 1.8 or later, MySQL (version 4.1.12 or later), PostgreSQL (8.0 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
: MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting &amp;quot;strict mode&amp;quot; must be OFF (set to &amp;quot;&amp;quot; or &amp;quot;MYSQL40&amp;quot;) in the MySQL configuration file. &lt;br /&gt;
: PostgreSQL Notes: PostgreSQL 7.4 is recommended for earlier Moodle versions, since Moodle 1.8 only PostgreSQL 8.0 and above are supported.&lt;br /&gt;
* For showcases or low to medium-sized installations, Moodle 2.0 also includes (experimental) support for SQLite 3 database. This setup requires no database server, as the database file is stored in a local directory on the server.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== How many users? ==&lt;br /&gt;
&lt;br /&gt;
In addition to the hardware and software requirements, you will also need to think about the capacity of your Moodle installation in terms of the number of users it can handle. There are two numbers to plan for:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Browsing users&#039;&#039;&#039;: the maximum number of users able to browse your Moodle site. This is the number of computers in your organization or on your course (whichever is greater).&lt;br /&gt;
:&#039;&#039;&#039;Concurrent database users&#039;&#039;&#039;: the maximum number of concurrent database users (needed for Moodle activities such as quizzes). This is the number of users who will be using Moodle at the same time. In an educational institution, use your timetable/roster to obtain this figure.&lt;br /&gt;
&lt;br /&gt;
Once you know these figures for your users, you can start work out if your Moodle installation can support this capacity. The exact number of users depends on your hardware/software/network combination. Usually the amount of memory installed (RAM) is the deciding factor but a faster overall processor speed will also help in reducing waiting times for pages to load. &lt;br /&gt;
&lt;br /&gt;
The general rule of thumb for a single server is that the approx max concurrent users = RAM (GB) * 50 and the approx max browsing users = Approx max concurrent users * 5. As an example, a university with 500 total computers on campus and 100 concurrent users at any time will need approx 2GB of RAM on the one server to support the number of concurrent users.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Ask your provider what limits are placed on the number of concurrent database connections and the processor load. This will give a good estimate of the number of users your Moodle install can manage.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note:&#039;&#039;&#039; As of August 31, 2007, Moodle 1.8.2+ is not recommended for large installations, especially if you have large number (e.g. 20,000+) of courses. The main reason is the codes related to ROLES are still not fully optimized with database queries and still need some work. If you are planning to use 1.8.x codes for a larger institution, please make sure that you have sufficient time to do your own testing and performance profiling.  Upgrade to Moodle 1.9!!&lt;br /&gt;
&lt;br /&gt;
[Update|Updating from a previous version] of Moodle has been improved quite a bit from 1.8.3+ version (see this thread discussion: http://moodle.org/mod/forum/discuss.php?d=83281).  Moodle 1.9 has even more improvements in all areas and is the recommended version.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to get Moodle, either as a compressed package or via [[CVS]]. &lt;br /&gt;
&lt;br /&gt;
=== Download from compressed packages===&lt;br /&gt;
There are two types of compressed packages at the [http://download.moodle.org/ download.moodle.org page:] which offer a variety of version, operating systems and compression types.&lt;br /&gt;
#The &amp;quot;Standard Distribution&amp;quot; (with Moodle only files) and &lt;br /&gt;
#Several operating system &amp;quot;Complete Install Packages&amp;quot; (which contains programs to create a Moodle in a web environment). Please see [[Complete install packages]] for more information.  &lt;br /&gt;
&lt;br /&gt;
Most of these instructions are for the standard distribution, &lt;br /&gt;
Download a compressed package and then unpack the archive into your file structure using either of these two commands:&lt;br /&gt;
 tar -zxvf [filename]&lt;br /&gt;
 unzip [filename]&lt;br /&gt;
&lt;br /&gt;
===Download from CVS===&lt;br /&gt;
To use CVS, helpful instructions are available at the [[CVS_for_Administrators | CVS for Administrators]] page. The full [http://cvs.moodle.org/moodle/ Moodle CVS repository] is also available for browsing. &lt;br /&gt;
&lt;br /&gt;
If you are using CVS, run the CVS Checkout command.&lt;br /&gt;
&lt;br /&gt;
===Directory created placement===&lt;br /&gt;
After either of the above processes, you will now have with a directory called &amp;quot;moodle&amp;quot;, containing a number of files and folders.&lt;br /&gt;
&lt;br /&gt;
For the standard package, 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;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip&#039;&#039;&#039;: If you are downloading Moodle to your local computer and then uploading it to your web site, it is usually better to upload the whole archive as one file, and then do the unpacking on the server. Even web hosting interfaces like cPanel allow you to uncompress archives in the &amp;quot;File Manager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Structure of moodle directory ===&lt;br /&gt;
&lt;br /&gt;
You can safely skip this section, but here is a quick summary of the contents of the Moodle folder, to help get you oriented:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;config.php&#039;&#039; - contains basic settings. This file does not come with Moodle - you will create it by executing install.php or manually.&lt;br /&gt;
:&#039;&#039;install.php&#039;&#039; - the script you will run to create config.php&lt;br /&gt;
:&#039;&#039;version.php&#039;&#039; - defines the current version of Moodle code&lt;br /&gt;
:&#039;&#039;index.php&#039;&#039; - the front page of the site&lt;br /&gt;
:&#039;&#039;admin/&#039;&#039; - code to administrate the whole server&lt;br /&gt;
:&#039;&#039;auth/&#039;&#039; - plugin modules to authenticate users&lt;br /&gt;
:&#039;&#039;blocks/&#039;&#039; - plugin modules for the little side blocks on many pages&lt;br /&gt;
:&#039;&#039;calendar/&#039;&#039; - all the code for managing and displaying calendars&lt;br /&gt;
:&#039;&#039;course/&#039;&#039; - code to display and manage courses&lt;br /&gt;
:&#039;&#039;doc/&#039;&#039; - help documentation for Moodle (eg this page)&lt;br /&gt;
:&#039;&#039;files/&#039;&#039; - code to display and manage uploaded files&lt;br /&gt;
:&#039;&#039;lang/&#039;&#039; - texts in different languages, one directory per language&lt;br /&gt;
:&#039;&#039;lib/&#039;&#039; - libraries of core Moodle code&lt;br /&gt;
:&#039;&#039;login/&#039;&#039; - code to handle login and account creation&lt;br /&gt;
:&#039;&#039;mod/&#039;&#039; - all the main Moodle course modules are in here&lt;br /&gt;
:&#039;&#039;pix/&#039;&#039; - generic site graphics&lt;br /&gt;
:&#039;&#039;theme/&#039;&#039; - theme packs/skins to change the look of the site.&lt;br /&gt;
:&#039;&#039;user/&#039;&#039; - code to display and manage users&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Setting-up your system==&lt;br /&gt;
To ensure that Moodle will install successfully, you need to check that the web server settings are correct, then create a blank database for Moodle to use and finally create a directory on your hard disk for Moodle to save your materials and other files you upload into your courses.&lt;br /&gt;
&lt;br /&gt;
=== Check web server settings ===&lt;br /&gt;
&lt;br /&gt;
*Firstly, make sure that your web server is set up to use index.php as a default page (perhaps in addition to index.html, default.htm and so on). In Apache, this is done using a DirectoryIndex parameter in your httpd.conf file. Mine usually looks like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
:Just make sure index.php is in the list (and preferably towards the start of the list, for efficiency).&lt;br /&gt;
&lt;br /&gt;
*Secondly, &#039;&#039;&#039;if you are using Apache 2&#039;&#039;&#039;, then you should turn on the &#039;&#039;AcceptPathInfo&#039;&#039; variable, which allows scripts to be passed arguments like &amp;lt;nowiki&amp;gt;http://server/file.php/arg1/arg2&amp;lt;/nowiki&amp;gt;. This is essential to allow relative links between your resources, and also provides a performance boost for people using your Moodle web site. You can turn this on by adding these lines to your httpd.conf file. (NB: This setting, or any equivalent, is not required in Apache 1)&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
=== Recheck PHP settings ===&lt;br /&gt;
Moodle requires a number of PHP settings to be active for it to work. These were given in the Requirements section and &#039;&#039;&#039;On most servers these will already be the default settings&#039;&#039;&#039;.  However, some PHP servers (and some of the more recent PHP versions) may have things set differently, so it is useful to double-check that the settings are correct. These are defined in PHP&#039;s configuration file (usually called &#039;&#039;&#039;php.ini&#039;&#039;&#039;) or in the Apache &#039;&#039;&#039;.htaccess&#039;&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
 safe_mode = 0 (necessary)&lt;br /&gt;
 memory_limit = 40M (varies: minimum 16M, 32M Moodle v1.7, 40M Moodle v1.8, 128M large sites)&lt;br /&gt;
 session.save_handler = files (unless you are using another handler, e.g. mm)   &lt;br /&gt;
 magic_quotes_gpc = 1    (preferred but not necessary, 0 will be recommended in 2.0)&lt;br /&gt;
 magic_quotes_runtime = 0    (necessary)&lt;br /&gt;
 file_uploads = 1&lt;br /&gt;
 session.auto_start = 0&lt;br /&gt;
 session.bug_compat_warn = 0&lt;br /&gt;
&lt;br /&gt;
You may also want to set other, optional php.ini file settings while you are already editing it. For instance, you may want to reset the maximum upload size of file attachments, which usually defaults to 2M(egabytes). For instance, to set these to 16 Megabytes:&lt;br /&gt;
 &lt;br /&gt;
 post_max_size = 16M&lt;br /&gt;
 upload_max_filesize = 16M&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Using a .htaccess file for webserver and PHP settings ===&lt;br /&gt;
&lt;br /&gt;
Use the above if you can directly edit your server&#039;s files, but if you are setting-up Moodle on a webhost, or don&#039;t have access to &#039;&#039;&#039;httpd.conf&#039;&#039;&#039; or &#039;&#039;&#039;php.ini&#039;&#039;&#039; on your server, or you have Moodle on a server with other applications that require different settings, then don&#039;t worry, you can often still override the default settings. This only works on Apache servers and only when Overrides have been allowed in the main Apache configuration. Moodle is supplied with a htaccess file which you can use, or you can create your own file manually.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Use the default htaccess file&#039;&#039;&#039;. The easiest thing to do is just copy the sample file from moodle/lib/htaccess and edit it to suit your needs. It contains further instructions. For example, in a Unix shell:&lt;br /&gt;
&lt;br /&gt;
 cd moodle&lt;br /&gt;
 cp moodle/lib/htaccess .htaccess&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Create your own file&#039;&#039;&#039;. Alternatively you can create your own file called &#039;&#039;&#039;.htaccess&#039;&#039;&#039; in Moodle&#039;s main directory that contains lines like the following. &lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
 php_value memory_limit 40M (adjust to your version of Moodle)&lt;br /&gt;
 php_flag magic_quotes_gpc 1&lt;br /&gt;
 php_flag magic_quotes_runtime 0&lt;br /&gt;
 php_flag file_uploads 1&lt;br /&gt;
 php_flag session.auto_start 0&lt;br /&gt;
 php_flag session.bug_compat_warn 0&lt;br /&gt;
&lt;br /&gt;
:If you have Apache version 2 installed, add these lines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IfDefine APACHE2&amp;gt;&lt;br /&gt;
     AcceptPathInfo on&lt;br /&gt;
 &amp;lt;/IfDefine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Otherwise add this single line:&lt;br /&gt;
&lt;br /&gt;
 AcceptPathInfo on&lt;br /&gt;
&lt;br /&gt;
:Optionally, you can also do things like define the maximum size for uploaded files, etc by adding these lines:&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 0&lt;br /&gt;
 php_value upload_max_filesize 2M&lt;br /&gt;
 php_value post_max_size 2M&lt;br /&gt;
&lt;br /&gt;
:The value given in these lines is 2M. You may want to change this at a later date to allow uploading of larger files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Some shared hosts do not allow .htaccess files&#039;&#039;&#039;. In this case, it may be necessary to place a php.ini file within each sub-directory of the site. To do this, you use your editor to create a php.ini file in the main moodle directory and later copy it to all sub-directories. The syntax for the php.ini file is different than the one used in .htaccess - you do not use the php_value and php_flag prefixes. See the example below:&lt;br /&gt;
 upload_max_filesize = 2M&lt;br /&gt;
 post_max_size = 2M&lt;br /&gt;
:After creating the php.ini file with all of the statements you need, run the script http://tips-scripts.com/php_ini_copy or copy php.ini manually to all sub-directories.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Some shared hosts use suPHP, which requires a slightly different configuration&#039;&#039;&#039;. If everything else fails, try creating the following two files and uploading to your moodle root directory&lt;br /&gt;
:php.ini (sample):&lt;br /&gt;
 register_globals = 0&lt;br /&gt;
 display_errors = 0&lt;br /&gt;
&lt;br /&gt;
:.htaccess (sample):&lt;br /&gt;
 suPHP_ConfigPath /home/cPanelName/public_html/moodle&lt;br /&gt;
&lt;br /&gt;
Change the above path to the actual path to your moodle install.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note&#039;&#039;&#039;: Use a .htaccess file only [http://httpd.apache.org/docs/1.3/howto/htaccess.html#when as a last resort] as it can have an impact on the performance of your Moodle site and cause pages to load slowly on your browser.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating an empty database ===&lt;br /&gt;
&lt;br /&gt;
You need to create an empty database (eg &amp;quot;&#039;&#039;moodle&#039;&#039;&amp;quot;) in your database system along with a special user (eg &amp;quot;moodleuser&amp;quot;) that has access to that database (and that database only). You could use the &amp;quot;root&amp;quot; user if you wanted to for a test server, but this is not recommended for a production system: if hackers manage to discover the password then your whole database system would be at risk, rather than just one database.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Warning&#039;&#039;&#039;: Bear in mind that, as of Moodle version 1.5.x, Moodle doesn&#039;t work with MySQL 5.x&#039;s strict mode setting (STRICT_TRANS_TABLES and/or STRICT_ALL_TABLES) -- see [http://moodle.org/mod/forum/discuss.php?d=58552 forum discussion]. So if you are using MySQL 5.x, edit MySQL&#039;s configuration file (called &amp;quot;my.ini&amp;quot; in Windows and &amp;quot;my.cnf&amp;quot; on Unix/Linux) and comment out that option or set it to &amp;lt;code&amp;gt;sql-mode=&#039;&#039;&amp;lt;/code&amp;gt;. You have to restart MySQL after changing this setting. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; If you do not have access to your server, use PHPMyAdmin (or another MySQL client) and enter the command &amp;lt;code&amp;gt;SET @@global.sql_mode=&#039;&#039;;&amp;lt;/code&amp;gt; (be sure to use single quotes, and don&#039;t forget the semicolon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
====Using a hosted server====&lt;br /&gt;
If you are using a webhost, they will probably have a control panel web interface for you to create your database.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;[http://www.cpanel.com/ cPanel]&#039;&#039;&#039; system is one of the most popular of these. &lt;br /&gt;
To create a database using cPanel:&lt;br /&gt;
&lt;br /&gt;
# Click on the &#039;&#039;&#039;MySQL Databases&#039;&#039;&#039; icon.&lt;br /&gt;
# Type &#039;&#039;&#039;moodle&#039;&#039;&#039; in the New Database field and click &#039;&#039;&#039;Create Database&#039;&#039;&#039;.&lt;br /&gt;
# Type a &#039;&#039;username&#039;&#039; and &#039;&#039;password&#039;&#039; (not one you use elsewhere) in the respective fields and click &#039;&#039;&#039;Create  User&#039;&#039;&#039;.&amp;lt;br&amp;gt;Note that the &#039;&#039;username&#039;&#039; and &#039;&#039;database&#039;&#039; names may be prefixed by your cPanel account name and an underscore, and truncated to 16 characters. When entering this information into the Moodle installer - use the full names.&lt;br /&gt;
# Now use the &#039;&#039;&#039;Add Users to Databases&#039;&#039;&#039; button and give this new user account &#039;&#039;&#039;ALL&#039;&#039;&#039; rights to the new database.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#Creating_the_data_directory |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Using a SQLite database====&lt;br /&gt;
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.&lt;br /&gt;
&lt;br /&gt;
Moodle 2.0 offers support for SQLite3 database installations. In this case, no database setup is required. The database file will be created by the installation script. By default, the database file will be store in Moodle&#039;s data directory (see [[Installing_Moodle#Creating_the_data_directory |Creating the data directory]]). During install, the web server must have write access on the directory where the database file will be stored. After installation, the web server must have read-write access to the database file.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#Creating_the_data_directory |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Using the command line====&lt;br /&gt;
&lt;br /&gt;
If you have access to Unix or Windows command lines then you can do the same sort of thing by typing commands. You should do this using the MySQL Client program as follows (commands which you type-in are shown in bold):&lt;br /&gt;
&lt;br /&gt;
- Start the MySQL Client program:&lt;br /&gt;
 #&#039;&#039;&#039;mysql -u root -p&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;
 Your MySQL connection id is 2 to server version: 5.0.22-log&lt;br /&gt;
 &lt;br /&gt;
 Type &#039;help;&#039; or &#039;\h&#039; for help. Type &#039;\c&#039; to clear the buffer.&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The prompt changes to &amp;quot;mysql&amp;gt;&amp;quot; to indicate that you are now working in the MySQL Client program. When working in MySQL, all commands which you type-in must end in a semi-colon. (If you hit the Enter key without the final semi-colon, you&#039;ll get the line continuation symbol &#039;-&amp;gt;&#039;; this is your second chance to type the semi-colon and hit Enter.) &lt;br /&gt;
&lt;br /&gt;
- Begin by checking for any existing databases called &amp;quot;moodle&amp;quot; - if there are any you should change the name in all the commands which follow:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;SHOW DATABASES;&#039;&#039;&#039;&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | Database                |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | information_schema      |&lt;br /&gt;
 | mysql                   |&lt;br /&gt;
 | test                    |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 3 rows in set (0.03 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a database to store the Moodle tables. We&#039;ll call this &amp;quot;moodle&amp;quot;, as there are none with that name already in the above list, but change it if you need to.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;CREATE DATABASE moodle;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Change the default character set and collation of the &amp;quot;moodle&amp;quot; database to UTF8. Leave this out if you are installing Moodle 1.5 or earlier):&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a username and password to access the database &amp;quot;moodle&amp;quot; and grant database access permissions. We&#039;ll call the user &amp;quot;moodleuser&amp;quot; and set the password as &amp;quot;yourpassword&amp;quot;. It&#039;s a good idea to change these for your installation however most people keep the username as &amp;quot;moodleuser&amp;quot;. Remember the username and password you have set, as you&#039;ll need it in the configuration screens later. This is a long command so has been split over several lines by pressing the Return key.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;DROP,INDEX,ALTER ON moodle.*&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 0 rows affected (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Security Warnings&#039;&#039;&#039;: Never leave the password as the one shown here. Make sure you have a strong password (a mixture of letters and numbers, upper and lower case). Avoid granting &amp;quot;ALL&amp;quot; permissions on the database.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: For MySQL 4.0.1 or earlier, you don&#039;t need the CREATE TEMPORARY TABLES permission. &lt;br /&gt;
&lt;br /&gt;
- Exit the MySQL Client program:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;QUIT&#039;&#039;&#039;&lt;br /&gt;
 Bye&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
- Reload the grant tables using the mysqladmin program:&lt;br /&gt;
 #&#039;&#039;&#039;mysqladmin -u root -p reload&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
And some example command lines for PostgreSQL:&lt;br /&gt;
&lt;br /&gt;
   # su - postgres&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create user moodleuser createdb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create database moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;with encoding &#039;unicode&#039;&amp;lt;/font&amp;gt;;&amp;quot; -U moodleuser template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser nocreatedb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser with encrypted password &#039;yourpassword&#039;;&amp;quot; template1&lt;br /&gt;
   &amp;gt; su - root&lt;br /&gt;
   # /etc/init.d/postgresql reload&lt;br /&gt;
&lt;br /&gt;
If the Postgres create database command above (&amp;gt;psql -c &amp;quot;create database moodle...&amp;quot;) gives an error message you may want to try:&lt;br /&gt;
 psql -c &amp;quot;create database moodle with template=template1 encoding = &#039;unicode&#039; owner =  moodleuser &amp;lt;br&amp;gt;     location = &#039;/var/mydata&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the create database command asks you for a password, run the line containing &#039;encrypted password&#039; first before proceeding.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
* Step-by-step instructions on  [https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Ubuntu installation for Ubuntu(Debian)]&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating the data directory  ===&lt;br /&gt;
&lt;br /&gt;
Moodle will also need some space on your server&#039;s hard disk to store uploaded files, such as course documents and user pictures. The Moodle installer tries hard to create the &#039;&#039;&#039;moodledata&#039;&#039;&#039; directory for you but if it fails then you will have to create a directory for this purpose manually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Security warning&#039;&#039;&#039;: For security purposes, it is &#039;&#039;&#039;CRITICAL&#039;&#039;&#039; that this directory is &#039;&#039;&#039;NOT&#039;&#039;&#039; accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web site root directory (it is the folder that the main part of your URL -that is, the part up to the first single / - points to; for example, in &amp;lt;nowiki&amp;gt;http://your.domain.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;, it is &amp;lt;nowiki&amp;gt;http://your.domain.com/&amp;lt;/nowiki&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
But if you must have it in the web directory (and you are using Apache AND the web server configuration allows .htaccess files to restrict access to directories) then protect it by creating a file in the data directory called &#039;&#039;&#039;.htaccess&#039;&#039;&#039;, containing these lines:&lt;br /&gt;
&lt;br /&gt;
 order deny,allow&lt;br /&gt;
 deny from all&lt;br /&gt;
&lt;br /&gt;
If you are using IIS, you need to edit the properties of the data directory (from the Internet Information Services Manager console) and deny access to that folder to everybody from the web.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;If you don&#039;t protect the data directory from direct web access, anybody will be able to impersonate any user of your Moodle site (including the admin user!!!), and all of your course materials will be available to the web at large.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ownership &amp;amp; Permissions&#039;&#039;&#039;: To make sure that Moodle can save uploaded files in this directory, check that the web server software has permission to read, write and execute in this directory. On Unix machines, this means setting the owner of the directory to be something like &amp;quot;nobody&amp;quot; or &amp;quot;apache&amp;quot;, and then giving that user read, write and execute permissions. As an example, to change the owner to &amp;quot;nobody&amp;quot; you could use:&lt;br /&gt;
&lt;br /&gt;
 chown -R nobody:apache moodledata&lt;br /&gt;
&lt;br /&gt;
To change the permissions so that the owner has read,write and execute permissions, use something like this:&lt;br /&gt;
&lt;br /&gt;
 chmod -R 0770 moodledata&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are receiving permission denied messages, try &#039;&#039;chmod -R 0770 moodledata&#039;&#039; and then adjust the settings so that they are more secure. A more secure setting is &#039;&#039;chmod -R 0750 moodledata&#039;&#039;. According to the comments in config-dist.php, &amp;quot;On hosting systems you might need to make sure that your group has no permissions at all while others have full permissions.&amp;quot; To do this you could use &#039;&#039;chmod -R 707 moodledata&#039;&#039;. See also the [[Security | security page]].&lt;br /&gt;
&lt;br /&gt;
Remember that by default moodle will issue a warning about moodle data directories created inside the web directory, but otherwise this directory can be located where you wish. You can later move or change the location of this directory, but if you do, be sure to edit the setting in the &#039;&#039;&#039;config.php&#039;&#039;&#039; file that sets this; e.g. if moodledata is under a directory called data, then it would look like this:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dataroot  = &#039;/data/moodledata&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CPanel and webhosts&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On cPanel systems you can use the &amp;quot;File Manager&amp;quot; to find the folder, click on it, then choose &amp;quot;Change Permissions&amp;quot;. On many shared hosting servers, you will probably need to restrict all file access to your &amp;quot;group&amp;quot; (to prevent other webhost customers from looking at or changing your files), but provide full read/write access to everyone else (which will allow the web server to access your files). Speak to your server administrator if you are having trouble setting this up securely. In particular it will not be possible to create a usable data directory on sites that use a PHP feature known as &amp;quot;&#039;&#039;&#039;Safe Mode&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Run the installer script to create config.php ==&lt;br /&gt;
&lt;br /&gt;
To run the installer script (install.php), just try to access your Moodle main URL using a web browser, or access &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourserver/install.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; directly.&lt;br /&gt;
&lt;br /&gt;
(The Installer will try to set a session cookie. If you get a popup warning in your browser make sure you accept that cookie!)&lt;br /&gt;
&lt;br /&gt;
Moodle will detect that configuration is necessary and will lead you through some screens to help you create a new configuration file called &#039;&#039;&#039;config.php&#039;&#039;&#039;. At the end of the process Moodle will try and write the file into the right location, otherwise you can press a button to download it from the installer and then upload &#039;&#039;&#039;config.php&#039;&#039;&#039; into the main Moodle directory on the server.&lt;br /&gt;
&lt;br /&gt;
Along the way the installer will test your server environment and give you suggestions about how to fix any problems. For most common issues these suggestions should be sufficient, but if you get stuck, check in the Installation Forum for more help.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Go to the admin page to continue configuration ==&lt;br /&gt;
&lt;br /&gt;
Once the basic config.php has been correctly created in the previous step, trying to access the front page of your site will take you to the &amp;quot;admin&amp;quot; page for the rest of the configuration.&lt;br /&gt;
&lt;br /&gt;
The first time you access this admin page, you will be presented with a GPL &amp;quot;shrink wrap&amp;quot; agreement with which you must agree before you can continue with the setup.&lt;br /&gt;
&lt;br /&gt;
Now Moodle will start setting up your database and creating tables to store data. Firstly, the main database tables are created. You should see a number of SQL statements followed by status messages that look like this:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE course (&lt;br /&gt;
    id int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
    category int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    password varchar(50) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    fullname varchar(254) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    shortname varchar(15) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    summary text NOT NULL,&lt;br /&gt;
    format tinyint(4) NOT NULL default &#039;1&#039;,&lt;br /&gt;
    teacher varchar(100) NOT NULL default &#039;Teacher&#039;,&lt;br /&gt;
    startdate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    enddate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    timemodified int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    PRIMARY KEY (id)&lt;br /&gt;
 ) TYPE=MyISAM;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;SUCCESS&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and so on, followed by: &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Main databases set up successfully.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see these, then there must have been some problem with the database or the configuration settings you defined in config.php. Check that PHP isn&#039;t in a restricted &amp;quot;Safe Mode&amp;quot; (commercial web hosts sometimes have safe mode turned on). You can check PHP variables by creating a little file containing &#039;&#039;&#039;&amp;lt;?php phpinfo() ?&amp;gt;&#039;&#039;&#039; and looking at it through a browser. Check all these and try this page again.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
You should now see a form where you can define more configuration variables for your installation, such as the default language, SMTP hosts and so on. Don&#039;t worry too much about getting everything right just now - you can always come back and edit these later on using the admin interface. The defaults are designed to be useful and secure for most sites. Scroll down to the bottom and click &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If (and only if) you find yourself getting stuck on this page, unable to continue, then your server probably has what I call the &amp;quot;buggy referrer&amp;quot; problem. This is easy to fix: just turn off the &amp;quot;secureforms&amp;quot; setting, then try to continue again.&lt;br /&gt;
&lt;br /&gt;
Next you will see more pages that print lots of status messages as they set up all the tables required by the various Moodle module. As before, they should all be &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;green&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
The next page is a form where you can define parameters for your Moodle site and the front page, such as the name, format, description and so on. Fill this out (you can always come back and change these later) and then press &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finally, you will then be asked to create a top-level administration user for future access to the admin pages. Fill out the details with your own name, email etc and then click &amp;quot;Save changes&amp;quot;. Not all the fields are required, but if you miss any important fields you&#039;ll be re-prompted for them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure you remember the username and password you chose for the administration user account, as they will be necessary to access the administration page in future.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(If for any reason your install is interrupted, or there is a system error of some kind that prevents you from logging in using the admin account, you can usually log in using the default username of &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;, with password &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Once successful, you will be returned to the home page of your new site! Note the administration links that appear down the left hand side of the page (these items also appear on a separate Admin page) - these items are only visible to you because you are logged in as the admin user. All your further administration of Moodle can now be done using this menu, such as:&lt;br /&gt;
&lt;br /&gt;
* creating and deleting courses&lt;br /&gt;
* creating and editing user accounts&lt;br /&gt;
* administering teacher accounts&lt;br /&gt;
* changing site-wide settings like themes etc&lt;br /&gt;
&lt;br /&gt;
But you are not done installing yet! There is one very important thing still to do (see the next section on cron).&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Installing Moodle Using Command Line ==&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
&lt;br /&gt;
Installing Moodle Using command line is just as easy as installing Moodle using web browser. &lt;br /&gt;
* First Go to the moodle root directory and then to admin directory inside the moodle root. &lt;br /&gt;
&lt;br /&gt;
 $cd /var/www/html/moodle/admin&lt;br /&gt;
&lt;br /&gt;
* Then simply use the following syntax to run the moodle command line installer (this is a long command which has been split over 3 lines, so type as one line)&lt;br /&gt;
 $php cliupgrade.php --lang=en --webaddr=&amp;lt;nowiki&amp;gt;http://www.example.com&amp;lt;/nowiki&amp;gt; --moodledir=/var/www/html/moodle &lt;br /&gt;
                     --datadir=/var/moodledata --dbtype=mysql --dbhost=localhost --dbname=moodle &lt;br /&gt;
                     --dbuser=root --prefix=mdl --verbose=1 --interactivelevel=2 &lt;br /&gt;
&lt;br /&gt;
More information about the options can be found using &lt;br /&gt;
$php cliupgrad.php --help&lt;br /&gt;
&lt;br /&gt;
Then you will see the following list of available options&lt;br /&gt;
&lt;br /&gt;
 --lang		 		Valid installed language for installation. Default is English(en)&lt;br /&gt;
 --webaddr			Web address for the Moodle site&lt;br /&gt;
 --moodledir			Location of the moodle web folder&lt;br /&gt;
 --datadir			Location of the moodle data folder (should not be web visible)&lt;br /&gt;
 --dbtype			Database type. Default it mysql&lt;br /&gt;
 --dbhost			Database host. Default localhost&lt;br /&gt;
 --dbname			Database name. Default is moodle&lt;br /&gt;
 --dbuser			Database user. Default is blank&lt;br /&gt;
 --dbpass			Database password. Default is blank&lt;br /&gt;
 --prefix			        Table prefix for above database tables. Default is mdl&lt;br /&gt;
 --verbose			0 No output, 1 Summarized output(Default), 2 Detailed output&lt;br /&gt;
 --interactivelevel	        0 Non interactive, 1 Semi interactive(Default), 2 Interactive&lt;br /&gt;
 --help				print out this help&lt;br /&gt;
&lt;br /&gt;
When you choose non interactive mode without any options all the default values are assumed.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Set up cron ==&lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
== Set up backups ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Backup settings| backup instructions]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Create a new course ==&lt;br /&gt;
&lt;br /&gt;
Now that Moodle is running properly, you can try creating a new course to play with.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Create a new course&amp;quot; from the Admin page (or the admin links on the home page).&lt;br /&gt;
&lt;br /&gt;
Fill out the form, paying special attention to the course format. You don&#039;t have to worry about the details too much at this stage, as everything can be changed later by the teacher. Note that the yellow help icons are everywhere to provide contextual help on any aspect.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;Save changes&amp;quot;, and you will be taken to a new form where you can assign teachers to the course. You can only add existing user accounts from this form - if you want to create a new teacher account then either ask the teacher to create one for themselves (see the login page), or create one for them using the &amp;quot;Add a new user&amp;quot; on the Admin page.&lt;br /&gt;
&lt;br /&gt;
Once done, the course is ready to customize, and is accessible via the &amp;quot;Courses&amp;quot; link on the home page.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
* [[Complete install packages]] might be an easier first time installs on some systems&lt;br /&gt;
* Help forum:  [http://moodle.org/mod/forum/view.php?id=28 Installation problems]&lt;br /&gt;
* [[Installing Apache, MySQL and PHP]] - Open source programs that can run Moodle on the web or on a desktop&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=42688 Selecting a web host for Moodle] forum discussion&lt;br /&gt;
* [[masquerading|Masquerading]] - Running Moodle behind a masquerading/NAT firewall&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[cs:Instalace]]&lt;br /&gt;
[[de:Installieren von Moodle]]&lt;br /&gt;
[[es:Instalación de moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;br /&gt;
[[nl:Installatiegids]]&lt;br /&gt;
[[pl:Instalacja Moodle]]&lt;br /&gt;
[[pt:Instalação do Moodle]]&lt;br /&gt;
[[ru:Установка Moodle]]&lt;br /&gt;
[[sk:Inštalácia]]&lt;br /&gt;
[[zh:安装Moodlezh:]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=44487</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=44487"/>
		<updated>2008-09-29T10:32:49Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Using a SQLite database */  fix broken links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Firstly, don&#039;t panic! :-)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install Moodle for the first time. For some of these steps it goes into a lot of detail to try and cover the majority of possible web server setups, so this page may look long and complicated. Don&#039;t panic, once you know how to do it you can install Moodle in minutes!&lt;br /&gt;
&lt;br /&gt;
If you have problems please read this page carefully - most common issues are answered in here. If you still have trouble, you can seek help from the Moodle community via  [http://moodle.org/course/view.php?id=5 moodle.org Using Moodle].&lt;br /&gt;
&lt;br /&gt;
Another option is to contact a [http://moodle.com/hosting/ Moodle Partner providing Moodle hosting] who can completely maintain Moodle for you, so that you can ignore all this and get straight into educating! A Moodle partner is the preferred option but if you decide to choose a hosting company that has cpanel then [http://ic.eflclasses.org/tutorials/settingupmoodleonhostingwitholdcpanel.swf this tutorial will guide you]  through the process of choosing a host and setting up moodle via the old cpanel. If you have the new cpanel please use this link [http://ic.eflclasses.org/tutorials/settingupmoodleoncpanel.swf this tutorial will guide you].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; some hosting companies offer one-click moodle install options such as fantastico, which whilst sometimes effective, usually use old (sometimes years old) versions of moodle and sometimes simply don&#039;t work. If one of these goes wrong, your best bet is often to start from scratch following the instructions here yourself. Its almost certainly quicker.&lt;br /&gt;
&lt;br /&gt;
If you want to run Moodle on your own computer and this page looks a bit daunting, then please see our guides on how to install one of Moodle&#039;s complete [[Complete install packages for Windows|Windows packages]], [[Complete Install Packages for Mac OS X|Mac OS packages]] or [[Installing AMP |Installing Apache, MySQL and PHP(AMP)]]. They provide alternative instructions to install all this on most popular platforms.&lt;br /&gt;
&lt;br /&gt;
==Table of Contents==&lt;br /&gt;
__TOC__&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), but is also regularly tested with Windows XP/2000/2003 (WAMP), Solaris 10 (Sparc and x64), Mac OS X and Netware 6 operating systems. Support for PostgreSQL, Oracle and Microsoft SQL Server is also available.&lt;br /&gt;
&lt;br /&gt;
The procedure for installing Moodle on the Windows platform (e.g. Windows Server, IIS and MSSQL) varies slightly to the procedure for the LAMP platform. See [[Installation for Windows 2003 with IIS]] for more details.&lt;br /&gt;
&lt;br /&gt;
[[Installing Moodle on Windows Vista]] might help with &#039;&#039;&#039;Blank page problem while installing Moodle on Windows Vista&#039;&#039;&#039; .&lt;br /&gt;
&lt;br /&gt;
The requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
===Hardware === &lt;br /&gt;
* Disk space: 160MB free (min). You will require more free space to store your teaching materials.&lt;br /&gt;
* Memory: 256MB (min), 1GB (recommended). The general rule of thumb is that Moodle can support 50 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination. &lt;br /&gt;
** &#039;&#039;&#039;Note if you are using a hosted account:&#039;&#039;&#039; Most hosted accounts on commercial sites will meet Disk and Memory requirements. However, you should contact your web host&#039;s support desk to check that this is the case before signing-up with them. It is especially important to &#039;&#039;&#039;ask about any PHP memory limits or MySQL question limits&#039;&#039;&#039;. If your prospective host does not provide a service which meets these requirements, or you are already signed up with them, ask them why and consider taking your business elsewhere if they do not change.&lt;br /&gt;
&lt;br /&gt;
===Software===&lt;br /&gt;
* Web server software. Most people use [[Apache]], but Moodle should work fine under any web server that supports [[PHP]], such as [[IIS]] on Windows platforms. PHP does impose requirements on versions of web servers, however these are complex and the general advice is to use the newest version possible of your chosen web server. &lt;br /&gt;
* PHP scripting language. (Please note that there have been issues installing Moodle with [http://www.php-accelerator.co.uk PHP-Accelerator]). There are currently two versions (or branches) of PHP available: PHP4 and PHP5 and the version requirements are listed below.&lt;br /&gt;
** For Moodle version 1.4 or later: PHP4 (version 4.1.0 or later) or PHP5 (version 5.1.0 or later) are supported.&lt;br /&gt;
** For Moodle version 1.6 or later: the PHP4 (version 4.3.0 or later) or PHP5 (version 5.1.0 or later) are supported. &lt;br /&gt;
** Future Moodle versions 2.0 or later will not support PHP4 and will require PHP5 (version 5.2.4 or later).&lt;br /&gt;
** PHP Settings. 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. &lt;br /&gt;
*** &#039;&#039;safe_mode&#039;&#039; needs to be OFF.&lt;br /&gt;
*** &#039;&#039;memory_limit&#039;&#039; should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.&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 ON. (It will be recommended to turn it off in 2.0.)&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.&lt;br /&gt;
** PHP Extensions and libraries&lt;br /&gt;
*** The mbstring extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** The iconv extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** [http://www.libgd.org/ GD library] and the [http://www.freetype.org/ FreeType 2] library and extensions are needed to be able to look at the dynamic graphs that the logs pages make.&lt;br /&gt;
*** The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.&lt;br /&gt;
*** The pgsql extension is required if you are using the PostgreSQL database.&lt;br /&gt;
*** The pdo and pdo_sqlite extensions are required for the (experimental) SQLite 3 database support.&lt;br /&gt;
*** The curl extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The tokenizer extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).&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;
* A working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is &#039;&#039;the&#039;&#039; choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment.&lt;br /&gt;
** For Moodle 1.5, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later). &lt;br /&gt;
** For Moodle 1.6, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).&lt;br /&gt;
** For Moodle 1.7, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
** For Moodle 1.8 or later, MySQL (version 4.1.12 or later), PostgreSQL (8.0 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
: MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting &amp;quot;strict mode&amp;quot; must be OFF (set to &amp;quot;&amp;quot; or &amp;quot;MYSQL40&amp;quot;) in the MySQL configuration file. &lt;br /&gt;
: PostgreSQL Notes: PostgreSQL 7.4 is recommended for earlier Moodle versions, since Moodle 1.8 only PostgreSQL 8.0 and above are supported.&lt;br /&gt;
* For showcases or low to medium-sized installations, Moodle 2.0 also includes (experimental) support for SQLite 3 database. This setup requires no database server, as the database file is stored in a local directory on the server.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== How many users? ==&lt;br /&gt;
&lt;br /&gt;
In addition to the hardware and software requirements, you will also need to think about the capacity of your Moodle installation in terms of the number of users it can handle. There are two numbers to plan for:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Browsing users&#039;&#039;&#039;: the maximum number of users able to browse your Moodle site. This is the number of computers in your organization or on your course (whichever is greater).&lt;br /&gt;
:&#039;&#039;&#039;Concurrent database users&#039;&#039;&#039;: the maximum number of concurrent database users (needed for Moodle activities such as quizzes). This is the number of users who will be using Moodle at the same time. In an educational institution, use your timetable/roster to obtain this figure.&lt;br /&gt;
&lt;br /&gt;
Once you know these figures for your users, you can start work out if your Moodle installation can support this capacity. The exact number of users depends on your hardware/software/network combination. Usually the amount of memory installed (RAM) is the deciding factor but a faster overall processor speed will also help in reducing waiting times for pages to load. &lt;br /&gt;
&lt;br /&gt;
The general rule of thumb for a single server is that the approx max concurrent users = RAM (GB) * 50 and the approx max browsing users = Approx max concurrent users * 5. As an example, a university with 500 total computers on campus and 100 concurrent users at any time will need approx 2GB of RAM on the one server to support the number of concurrent users.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Ask your provider what limits are placed on the number of concurrent database connections and the processor load. This will give a good estimate of the number of users your Moodle install can manage.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note:&#039;&#039;&#039; As of August 31, 2007, Moodle 1.8.2+ is not recommended for large installations, especially if you have large number (e.g. 20,000+) of courses. The main reason is the codes related to ROLES are still not fully optimized with database queries and still need some work. If you are planning to use 1.8.x codes for a larger institution, please make sure that you have sufficient time to do your own testing and performance profiling.  Upgrade to Moodle 1.9!!&lt;br /&gt;
&lt;br /&gt;
[Update|Updating from a previous version] of Moodle has been improved quite a bit from 1.8.3+ version (see this thread discussion: http://moodle.org/mod/forum/discuss.php?d=83281).  Moodle 1.9 has even more improvements in all areas and is the recommended version.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to get Moodle, either as a compressed package or via [[CVS]]. &lt;br /&gt;
&lt;br /&gt;
=== Download from compressed packages===&lt;br /&gt;
There are two types of compressed packages at the [http://download.moodle.org/ download.moodle.org page:] which offer a variety of version, operating systems and compression types.&lt;br /&gt;
#The &amp;quot;Standard Distribution&amp;quot; (with Moodle only files) and &lt;br /&gt;
#Several operating system &amp;quot;Complete Install Packages&amp;quot; (which contains programs to create a Moodle in a web environment). Please see [[Complete install packages]] for more information.  &lt;br /&gt;
&lt;br /&gt;
Most of these instructions are for the standard distribution, &lt;br /&gt;
Download a compressed package and then unpack the archive into your file structure using either of these two commands:&lt;br /&gt;
 tar -zxvf [filename]&lt;br /&gt;
 unzip [filename]&lt;br /&gt;
&lt;br /&gt;
===Download from CVS===&lt;br /&gt;
To use CVS, helpful instructions are available at the [[CVS_for_Administrators | CVS for Administrators]] page. The full [http://cvs.moodle.org/moodle/ Moodle CVS repository] is also available for browsing. &lt;br /&gt;
&lt;br /&gt;
If you are using CVS, run the CVS Checkout command.&lt;br /&gt;
&lt;br /&gt;
===Directory created placement===&lt;br /&gt;
After either of the above processes, you will now have with a directory called &amp;quot;moodle&amp;quot;, containing a number of files and folders.&lt;br /&gt;
&lt;br /&gt;
For the standard package, 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;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip&#039;&#039;&#039;: If you are downloading Moodle to your local computer and then uploading it to your web site, it is usually better to upload the whole archive as one file, and then do the unpacking on the server. Even web hosting interfaces like cPanel allow you to uncompress archives in the &amp;quot;File Manager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Structure of moodle directory ===&lt;br /&gt;
&lt;br /&gt;
You can safely skip this section, but here is a quick summary of the contents of the Moodle folder, to help get you oriented:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;config.php&#039;&#039; - contains basic settings. This file does not come with Moodle - you will create it by executing install.php or manually.&lt;br /&gt;
:&#039;&#039;install.php&#039;&#039; - the script you will run to create config.php&lt;br /&gt;
:&#039;&#039;version.php&#039;&#039; - defines the current version of Moodle code&lt;br /&gt;
:&#039;&#039;index.php&#039;&#039; - the front page of the site&lt;br /&gt;
:&#039;&#039;admin/&#039;&#039; - code to administrate the whole server&lt;br /&gt;
:&#039;&#039;auth/&#039;&#039; - plugin modules to authenticate users&lt;br /&gt;
:&#039;&#039;blocks/&#039;&#039; - plugin modules for the little side blocks on many pages&lt;br /&gt;
:&#039;&#039;calendar/&#039;&#039; - all the code for managing and displaying calendars&lt;br /&gt;
:&#039;&#039;course/&#039;&#039; - code to display and manage courses&lt;br /&gt;
:&#039;&#039;doc/&#039;&#039; - help documentation for Moodle (eg this page)&lt;br /&gt;
:&#039;&#039;files/&#039;&#039; - code to display and manage uploaded files&lt;br /&gt;
:&#039;&#039;lang/&#039;&#039; - texts in different languages, one directory per language&lt;br /&gt;
:&#039;&#039;lib/&#039;&#039; - libraries of core Moodle code&lt;br /&gt;
:&#039;&#039;login/&#039;&#039; - code to handle login and account creation&lt;br /&gt;
:&#039;&#039;mod/&#039;&#039; - all the main Moodle course modules are in here&lt;br /&gt;
:&#039;&#039;pix/&#039;&#039; - generic site graphics&lt;br /&gt;
:&#039;&#039;theme/&#039;&#039; - theme packs/skins to change the look of the site.&lt;br /&gt;
:&#039;&#039;user/&#039;&#039; - code to display and manage users&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Setting-up your system==&lt;br /&gt;
To ensure that Moodle will install successfully, you need to check that the web server settings are correct, then create a blank database for Moodle to use and finally create a directory on your hard disk for Moodle to save your materials and other files you upload into your courses.&lt;br /&gt;
&lt;br /&gt;
=== Check web server settings ===&lt;br /&gt;
&lt;br /&gt;
*Firstly, make sure that your web server is set up to use index.php as a default page (perhaps in addition to index.html, default.htm and so on). In Apache, this is done using a DirectoryIndex parameter in your httpd.conf file. Mine usually looks like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
:Just make sure index.php is in the list (and preferably towards the start of the list, for efficiency).&lt;br /&gt;
&lt;br /&gt;
*Secondly, &#039;&#039;&#039;if you are using Apache 2&#039;&#039;&#039;, then you should turn on the &#039;&#039;AcceptPathInfo&#039;&#039; variable, which allows scripts to be passed arguments like &amp;lt;nowiki&amp;gt;http://server/file.php/arg1/arg2&amp;lt;/nowiki&amp;gt;. This is essential to allow relative links between your resources, and also provides a performance boost for people using your Moodle web site. You can turn this on by adding these lines to your httpd.conf file. (NB: This setting, or any equivalent, is not required in Apache 1)&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
=== Recheck PHP settings ===&lt;br /&gt;
Moodle requires a number of PHP settings to be active for it to work. These were given in the Requirements section and &#039;&#039;&#039;On most servers these will already be the default settings&#039;&#039;&#039;.  However, some PHP servers (and some of the more recent PHP versions) may have things set differently, so it is useful to double-check that the settings are correct. These are defined in PHP&#039;s configuration file (usually called &#039;&#039;&#039;php.ini&#039;&#039;&#039;) or in the Apache &#039;&#039;&#039;.htaccess&#039;&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
 safe_mode = 0 (necessary)&lt;br /&gt;
 memory_limit = 40M (varies: minimum 16M, 32M Moodle v1.7, 40M Moodle v1.8, 128M large sites)&lt;br /&gt;
 session.save_handler = files (unless you are using another handler, e.g. mm)   &lt;br /&gt;
 magic_quotes_gpc = 1    (preferred but not necessary, 0 will be recommended in 2.0)&lt;br /&gt;
 magic_quotes_runtime = 0    (necessary)&lt;br /&gt;
 file_uploads = 1&lt;br /&gt;
 session.auto_start = 0&lt;br /&gt;
 session.bug_compat_warn = 0&lt;br /&gt;
&lt;br /&gt;
You may also want to set other, optional php.ini file settings while you are already editing it. For instance, you may want to reset the maximum upload size of file attachments, which usually defaults to 2M(egabytes). For instance, to set these to 16 Megabytes:&lt;br /&gt;
 &lt;br /&gt;
 post_max_size = 16M&lt;br /&gt;
 upload_max_filesize = 16M&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Using a .htaccess file for webserver and PHP settings ===&lt;br /&gt;
&lt;br /&gt;
Use the above if you can directly edit your server&#039;s files, but if you are setting-up Moodle on a webhost, or don&#039;t have access to &#039;&#039;&#039;httpd.conf&#039;&#039;&#039; or &#039;&#039;&#039;php.ini&#039;&#039;&#039; on your server, or you have Moodle on a server with other applications that require different settings, then don&#039;t worry, you can often still override the default settings. This only works on Apache servers and only when Overrides have been allowed in the main Apache configuration. Moodle is supplied with a htaccess file which you can use, or you can create your own file manually.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Use the default htaccess file&#039;&#039;&#039;. The easiest thing to do is just copy the sample file from moodle/lib/htaccess and edit it to suit your needs. It contains further instructions. For example, in a Unix shell:&lt;br /&gt;
&lt;br /&gt;
 cd moodle&lt;br /&gt;
 cp moodle/lib/htaccess .htaccess&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Create your own file&#039;&#039;&#039;. Alternatively you can create your own file called &#039;&#039;&#039;.htaccess&#039;&#039;&#039; in Moodle&#039;s main directory that contains lines like the following. &lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
 php_value memory_limit 40M (adjust to your version of Moodle)&lt;br /&gt;
 php_flag magic_quotes_gpc 1&lt;br /&gt;
 php_flag magic_quotes_runtime 0&lt;br /&gt;
 php_flag file_uploads 1&lt;br /&gt;
 php_flag session.auto_start 0&lt;br /&gt;
 php_flag session.bug_compat_warn 0&lt;br /&gt;
&lt;br /&gt;
:If you have Apache version 2 installed, add these lines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IfDefine APACHE2&amp;gt;&lt;br /&gt;
     AcceptPathInfo on&lt;br /&gt;
 &amp;lt;/IfDefine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Otherwise add this single line:&lt;br /&gt;
&lt;br /&gt;
 AcceptPathInfo on&lt;br /&gt;
&lt;br /&gt;
:Optionally, you can also do things like define the maximum size for uploaded files, etc by adding these lines:&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 0&lt;br /&gt;
 php_value upload_max_filesize 2M&lt;br /&gt;
 php_value post_max_size 2M&lt;br /&gt;
&lt;br /&gt;
:The value given in these lines is 2M. You may want to change this at a later date to allow uploading of larger files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Some shared hosts do not allow .htaccess files&#039;&#039;&#039;. In this case, it may be necessary to place a php.ini file within each sub-directory of the site. To do this, you use your editor to create a php.ini file in the main moodle directory and later copy it to all sub-directories. The syntax for the php.ini file is different than the one used in .htaccess - you do not use the php_value and php_flag prefixes. See the example below:&lt;br /&gt;
 upload_max_filesize = 2M&lt;br /&gt;
 post_max_size = 2M&lt;br /&gt;
:After creating the php.ini file with all of the statements you need, run the script http://tips-scripts.com/php_ini_copy or copy php.ini manually to all sub-directories.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Some shared hosts use suPHP, which requires a slightly different configuration&#039;&#039;&#039;. If everything else fails, try creating the following two files and uploading to your moodle root directory&lt;br /&gt;
:php.ini (sample):&lt;br /&gt;
 register_globals = 0&lt;br /&gt;
 display_errors = 0&lt;br /&gt;
&lt;br /&gt;
:.htaccess (sample):&lt;br /&gt;
 suPHP_ConfigPath /home/cPanelName/public_html/moodle&lt;br /&gt;
&lt;br /&gt;
Change the above path to the actual path to your moodle install.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note&#039;&#039;&#039;: Use a .htaccess file only [http://httpd.apache.org/docs/1.3/howto/htaccess.html#when as a last resort] as it can have an impact on the performance of your Moodle site and cause pages to load slowly on your browser.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating an empty database ===&lt;br /&gt;
&lt;br /&gt;
You need to create an empty database (eg &amp;quot;&#039;&#039;moodle&#039;&#039;&amp;quot;) in your database system along with a special user (eg &amp;quot;moodleuser&amp;quot;) that has access to that database (and that database only). You could use the &amp;quot;root&amp;quot; user if you wanted to for a test server, but this is not recommended for a production system: if hackers manage to discover the password then your whole database system would be at risk, rather than just one database.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Warning&#039;&#039;&#039;: Bear in mind that, as of Moodle version 1.5.x, Moodle doesn&#039;t work with MySQL 5.x&#039;s strict mode setting (STRICT_TRANS_TABLES and/or STRICT_ALL_TABLES) -- see [http://moodle.org/mod/forum/discuss.php?d=58552 forum discussion]. So if you are using MySQL 5.x, edit MySQL&#039;s configuration file (called &amp;quot;my.ini&amp;quot; in Windows and &amp;quot;my.cnf&amp;quot; on Unix/Linux) and comment out that option or set it to &amp;lt;code&amp;gt;sql-mode=&#039;&#039;&amp;lt;/code&amp;gt;. You have to restart MySQL after changing this setting. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; If you do not have access to your server, use PHPMyAdmin (or another MySQL client) and enter the command &amp;lt;code&amp;gt;SET @@global.sql_mode=&#039;&#039;;&amp;lt;/code&amp;gt; (be sure to use single quotes, and don&#039;t forget the semicolon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
====Using a hosted server====&lt;br /&gt;
If you are using a webhost, they will probably have a control panel web interface for you to create your database.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;[http://www.cpanel.com/ cPanel]&#039;&#039;&#039; system is one of the most popular of these. &lt;br /&gt;
To create a database using cPanel:&lt;br /&gt;
&lt;br /&gt;
# Click on the &#039;&#039;&#039;MySQL Databases&#039;&#039;&#039; icon.&lt;br /&gt;
# Type &#039;&#039;&#039;moodle&#039;&#039;&#039; in the New Database field and click &#039;&#039;&#039;Create Database&#039;&#039;&#039;.&lt;br /&gt;
# Type a &#039;&#039;username&#039;&#039; and &#039;&#039;password&#039;&#039; (not one you use elsewhere) in the respective fields and click &#039;&#039;&#039;Create  User&#039;&#039;&#039;.&amp;lt;br&amp;gt;Note that the &#039;&#039;username&#039;&#039; and &#039;&#039;database&#039;&#039; names may be prefixed by your cPanel account name and an underscore, and truncated to 16 characters. When entering this information into the Moodle installer - use the full names.&lt;br /&gt;
# Now use the &#039;&#039;&#039;Add Users to Databases&#039;&#039;&#039; button and give this new user account &#039;&#039;&#039;ALL&#039;&#039;&#039; rights to the new database.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#CreatDataDir |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
====Using a SQLite database====&lt;br /&gt;
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.&lt;br /&gt;
&lt;br /&gt;
Moodle 2.0 offers support for SQLite3 database installations. In this case, no database setup is required. The database file will be created by the installation script. By default, the database file will be store in Moodle&#039;s data directory (see [[Installing_Moodle#Creating_the_data_directory |Creating the data directory]]). During install, the web server must have write access on the directory where the database file will be stored. After installation, the web server must have read-write access to the database file.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#Creating_the_data_directory |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Using the command line====&lt;br /&gt;
&lt;br /&gt;
If you have access to Unix or Windows command lines then you can do the same sort of thing by typing commands. You should do this using the MySQL Client program as follows (commands which you type-in are shown in bold):&lt;br /&gt;
&lt;br /&gt;
- Start the MySQL Client program:&lt;br /&gt;
 #&#039;&#039;&#039;mysql -u root -p&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;
 Your MySQL connection id is 2 to server version: 5.0.22-log&lt;br /&gt;
 &lt;br /&gt;
 Type &#039;help;&#039; or &#039;\h&#039; for help. Type &#039;\c&#039; to clear the buffer.&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The prompt changes to &amp;quot;mysql&amp;gt;&amp;quot; to indicate that you are now working in the MySQL Client program. When working in MySQL, all commands which you type-in must end in a semi-colon. (If you hit the Enter key without the final semi-colon, you&#039;ll get the line continuation symbol &#039;-&amp;gt;&#039;; this is your second chance to type the semi-colon and hit Enter.) &lt;br /&gt;
&lt;br /&gt;
- Begin by checking for any existing databases called &amp;quot;moodle&amp;quot; - if there are any you should change the name in all the commands which follow:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;SHOW DATABASES;&#039;&#039;&#039;&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | Database                |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | information_schema      |&lt;br /&gt;
 | mysql                   |&lt;br /&gt;
 | test                    |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 3 rows in set (0.03 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a database to store the Moodle tables. We&#039;ll call this &amp;quot;moodle&amp;quot;, as there are none with that name already in the above list, but change it if you need to.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;CREATE DATABASE moodle;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Change the default character set and collation of the &amp;quot;moodle&amp;quot; database to UTF8. Leave this out if you are installing Moodle 1.5 or earlier):&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a username and password to access the database &amp;quot;moodle&amp;quot; and grant database access permissions. We&#039;ll call the user &amp;quot;moodleuser&amp;quot; and set the password as &amp;quot;yourpassword&amp;quot;. It&#039;s a good idea to change these for your installation however most people keep the username as &amp;quot;moodleuser&amp;quot;. Remember the username and password you have set, as you&#039;ll need it in the configuration screens later. This is a long command so has been split over several lines by pressing the Return key.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;DROP,INDEX,ALTER ON moodle.*&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 0 rows affected (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Security Warnings&#039;&#039;&#039;: Never leave the password as the one shown here. Make sure you have a strong password (a mixture of letters and numbers, upper and lower case). Avoid granting &amp;quot;ALL&amp;quot; permissions on the database.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: For MySQL 4.0.1 or earlier, you don&#039;t need the CREATE TEMPORARY TABLES permission. &lt;br /&gt;
&lt;br /&gt;
- Exit the MySQL Client program:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;QUIT&#039;&#039;&#039;&lt;br /&gt;
 Bye&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
- Reload the grant tables using the mysqladmin program:&lt;br /&gt;
 #&#039;&#039;&#039;mysqladmin -u root -p reload&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
And some example command lines for PostgreSQL:&lt;br /&gt;
&lt;br /&gt;
   # su - postgres&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create user moodleuser createdb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create database moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;with encoding &#039;unicode&#039;&amp;lt;/font&amp;gt;;&amp;quot; -U moodleuser template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser nocreatedb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser with encrypted password &#039;yourpassword&#039;;&amp;quot; template1&lt;br /&gt;
   &amp;gt; su - root&lt;br /&gt;
   # /etc/init.d/postgresql reload&lt;br /&gt;
&lt;br /&gt;
If the Postgres create database command above (&amp;gt;psql -c &amp;quot;create database moodle...&amp;quot;) gives an error message you may want to try:&lt;br /&gt;
 psql -c &amp;quot;create database moodle with template=template1 encoding = &#039;unicode&#039; owner =  moodleuser &amp;lt;br&amp;gt;     location = &#039;/var/mydata&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the create database command asks you for a password, run the line containing &#039;encrypted password&#039; first before proceeding.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
* Step-by-step instructions on  [https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Ubuntu installation for Ubuntu(Debian)]&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating the data directory  ===&lt;br /&gt;
&lt;br /&gt;
Moodle will also need some space on your server&#039;s hard disk to store uploaded files, such as course documents and user pictures. The Moodle installer tries hard to create the &#039;&#039;&#039;moodledata&#039;&#039;&#039; directory for you but if it fails then you will have to create a directory for this purpose manually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Security warning&#039;&#039;&#039;: For security purposes, it is &#039;&#039;&#039;CRITICAL&#039;&#039;&#039; that this directory is &#039;&#039;&#039;NOT&#039;&#039;&#039; accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web site root directory (it is the folder that the main part of your URL -that is, the part up to the first single / - points to; for example, in &amp;lt;nowiki&amp;gt;http://your.domain.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;, it is &amp;lt;nowiki&amp;gt;http://your.domain.com/&amp;lt;/nowiki&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
But if you must have it in the web directory (and you are using Apache AND the web server configuration allows .htaccess files to restrict access to directories) then protect it by creating a file in the data directory called &#039;&#039;&#039;.htaccess&#039;&#039;&#039;, containing these lines:&lt;br /&gt;
&lt;br /&gt;
 order deny,allow&lt;br /&gt;
 deny from all&lt;br /&gt;
&lt;br /&gt;
If you are using IIS, you need to edit the properties of the data directory (from the Internet Information Services Manager console) and deny access to that folder to everybody from the web.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;If you don&#039;t protect the data directory from direct web access, anybody will be able to impersonate any user of your Moodle site (including the admin user!!!), and all of your course materials will be available to the web at large.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ownership &amp;amp; Permissions&#039;&#039;&#039;: To make sure that Moodle can save uploaded files in this directory, check that the web server software has permission to read, write and execute in this directory. On Unix machines, this means setting the owner of the directory to be something like &amp;quot;nobody&amp;quot; or &amp;quot;apache&amp;quot;, and then giving that user read, write and execute permissions. As an example, to change the owner to &amp;quot;nobody&amp;quot; you could use:&lt;br /&gt;
&lt;br /&gt;
 chown -R nobody:apache moodledata&lt;br /&gt;
&lt;br /&gt;
To change the permissions so that the owner has read,write and execute permissions, use something like this:&lt;br /&gt;
&lt;br /&gt;
 chmod -R 0770 moodledata&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are receiving permission denied messages, try &#039;&#039;chmod -R 0770 moodledata&#039;&#039; and then adjust the settings so that they are more secure. A more secure setting is &#039;&#039;chmod -R 0750 moodledata&#039;&#039;. According to the comments in config-dist.php, &amp;quot;On hosting systems you might need to make sure that your group has no permissions at all while others have full permissions.&amp;quot; To do this you could use &#039;&#039;chmod -R 707 moodledata&#039;&#039;. See also the [[Security | security page]].&lt;br /&gt;
&lt;br /&gt;
Remember that by default moodle will issue a warning about moodle data directories created inside the web directory, but otherwise this directory can be located where you wish. You can later move or change the location of this directory, but if you do, be sure to edit the setting in the &#039;&#039;&#039;config.php&#039;&#039;&#039; file that sets this; e.g. if moodledata is under a directory called data, then it would look like this:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dataroot  = &#039;/data/moodledata&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CPanel and webhosts&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On cPanel systems you can use the &amp;quot;File Manager&amp;quot; to find the folder, click on it, then choose &amp;quot;Change Permissions&amp;quot;. On many shared hosting servers, you will probably need to restrict all file access to your &amp;quot;group&amp;quot; (to prevent other webhost customers from looking at or changing your files), but provide full read/write access to everyone else (which will allow the web server to access your files). Speak to your server administrator if you are having trouble setting this up securely. In particular it will not be possible to create a usable data directory on sites that use a PHP feature known as &amp;quot;&#039;&#039;&#039;Safe Mode&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Run the installer script to create config.php ==&lt;br /&gt;
&lt;br /&gt;
To run the installer script (install.php), just try to access your Moodle main URL using a web browser, or access &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourserver/install.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; directly.&lt;br /&gt;
&lt;br /&gt;
(The Installer will try to set a session cookie. If you get a popup warning in your browser make sure you accept that cookie!)&lt;br /&gt;
&lt;br /&gt;
Moodle will detect that configuration is necessary and will lead you through some screens to help you create a new configuration file called &#039;&#039;&#039;config.php&#039;&#039;&#039;. At the end of the process Moodle will try and write the file into the right location, otherwise you can press a button to download it from the installer and then upload &#039;&#039;&#039;config.php&#039;&#039;&#039; into the main Moodle directory on the server.&lt;br /&gt;
&lt;br /&gt;
Along the way the installer will test your server environment and give you suggestions about how to fix any problems. For most common issues these suggestions should be sufficient, but if you get stuck, check in the Installation Forum for more help.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Go to the admin page to continue configuration ==&lt;br /&gt;
&lt;br /&gt;
Once the basic config.php has been correctly created in the previous step, trying to access the front page of your site will take you to the &amp;quot;admin&amp;quot; page for the rest of the configuration.&lt;br /&gt;
&lt;br /&gt;
The first time you access this admin page, you will be presented with a GPL &amp;quot;shrink wrap&amp;quot; agreement with which you must agree before you can continue with the setup.&lt;br /&gt;
&lt;br /&gt;
Now Moodle will start setting up your database and creating tables to store data. Firstly, the main database tables are created. You should see a number of SQL statements followed by status messages that look like this:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE course (&lt;br /&gt;
    id int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
    category int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    password varchar(50) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    fullname varchar(254) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    shortname varchar(15) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    summary text NOT NULL,&lt;br /&gt;
    format tinyint(4) NOT NULL default &#039;1&#039;,&lt;br /&gt;
    teacher varchar(100) NOT NULL default &#039;Teacher&#039;,&lt;br /&gt;
    startdate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    enddate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    timemodified int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    PRIMARY KEY (id)&lt;br /&gt;
 ) TYPE=MyISAM;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;SUCCESS&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and so on, followed by: &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Main databases set up successfully.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see these, then there must have been some problem with the database or the configuration settings you defined in config.php. Check that PHP isn&#039;t in a restricted &amp;quot;Safe Mode&amp;quot; (commercial web hosts sometimes have safe mode turned on). You can check PHP variables by creating a little file containing &#039;&#039;&#039;&amp;lt;?php phpinfo() ?&amp;gt;&#039;&#039;&#039; and looking at it through a browser. Check all these and try this page again.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
You should now see a form where you can define more configuration variables for your installation, such as the default language, SMTP hosts and so on. Don&#039;t worry too much about getting everything right just now - you can always come back and edit these later on using the admin interface. The defaults are designed to be useful and secure for most sites. Scroll down to the bottom and click &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If (and only if) you find yourself getting stuck on this page, unable to continue, then your server probably has what I call the &amp;quot;buggy referrer&amp;quot; problem. This is easy to fix: just turn off the &amp;quot;secureforms&amp;quot; setting, then try to continue again.&lt;br /&gt;
&lt;br /&gt;
Next you will see more pages that print lots of status messages as they set up all the tables required by the various Moodle module. As before, they should all be &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;green&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
The next page is a form where you can define parameters for your Moodle site and the front page, such as the name, format, description and so on. Fill this out (you can always come back and change these later) and then press &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finally, you will then be asked to create a top-level administration user for future access to the admin pages. Fill out the details with your own name, email etc and then click &amp;quot;Save changes&amp;quot;. Not all the fields are required, but if you miss any important fields you&#039;ll be re-prompted for them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure you remember the username and password you chose for the administration user account, as they will be necessary to access the administration page in future.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(If for any reason your install is interrupted, or there is a system error of some kind that prevents you from logging in using the admin account, you can usually log in using the default username of &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;, with password &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Once successful, you will be returned to the home page of your new site! Note the administration links that appear down the left hand side of the page (these items also appear on a separate Admin page) - these items are only visible to you because you are logged in as the admin user. All your further administration of Moodle can now be done using this menu, such as:&lt;br /&gt;
&lt;br /&gt;
* creating and deleting courses&lt;br /&gt;
* creating and editing user accounts&lt;br /&gt;
* administering teacher accounts&lt;br /&gt;
* changing site-wide settings like themes etc&lt;br /&gt;
&lt;br /&gt;
But you are not done installing yet! There is one very important thing still to do (see the next section on cron).&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Installing Moodle Using Command Line ==&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
&lt;br /&gt;
Installing Moodle Using command line is just as easy as installing Moodle using web browser. &lt;br /&gt;
* First Go to the moodle root directory and then to admin directory inside the moodle root. &lt;br /&gt;
&lt;br /&gt;
 $cd /var/www/html/moodle/admin&lt;br /&gt;
&lt;br /&gt;
* Then simply use the following syntax to run the moodle command line installer (this is a long command which has been split over 3 lines, so type as one line)&lt;br /&gt;
 $php cliupgrade.php --lang=en --webaddr=&amp;lt;nowiki&amp;gt;http://www.example.com&amp;lt;/nowiki&amp;gt; --moodledir=/var/www/html/moodle &lt;br /&gt;
                     --datadir=/var/moodledata --dbtype=mysql --dbhost=localhost --dbname=moodle &lt;br /&gt;
                     --dbuser=root --prefix=mdl --verbose=1 --interactivelevel=2 &lt;br /&gt;
&lt;br /&gt;
More information about the options can be found using &lt;br /&gt;
$php cliupgrad.php --help&lt;br /&gt;
&lt;br /&gt;
Then you will see the following list of available options&lt;br /&gt;
&lt;br /&gt;
 --lang		 		Valid installed language for installation. Default is English(en)&lt;br /&gt;
 --webaddr			Web address for the Moodle site&lt;br /&gt;
 --moodledir			Location of the moodle web folder&lt;br /&gt;
 --datadir			Location of the moodle data folder (should not be web visible)&lt;br /&gt;
 --dbtype			Database type. Default it mysql&lt;br /&gt;
 --dbhost			Database host. Default localhost&lt;br /&gt;
 --dbname			Database name. Default is moodle&lt;br /&gt;
 --dbuser			Database user. Default is blank&lt;br /&gt;
 --dbpass			Database password. Default is blank&lt;br /&gt;
 --prefix			        Table prefix for above database tables. Default is mdl&lt;br /&gt;
 --verbose			0 No output, 1 Summarized output(Default), 2 Detailed output&lt;br /&gt;
 --interactivelevel	        0 Non interactive, 1 Semi interactive(Default), 2 Interactive&lt;br /&gt;
 --help				print out this help&lt;br /&gt;
&lt;br /&gt;
When you choose non interactive mode without any options all the default values are assumed.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Set up cron ==&lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
== Set up backups ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Backup settings| backup instructions]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Create a new course ==&lt;br /&gt;
&lt;br /&gt;
Now that Moodle is running properly, you can try creating a new course to play with.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Create a new course&amp;quot; from the Admin page (or the admin links on the home page).&lt;br /&gt;
&lt;br /&gt;
Fill out the form, paying special attention to the course format. You don&#039;t have to worry about the details too much at this stage, as everything can be changed later by the teacher. Note that the yellow help icons are everywhere to provide contextual help on any aspect.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;Save changes&amp;quot;, and you will be taken to a new form where you can assign teachers to the course. You can only add existing user accounts from this form - if you want to create a new teacher account then either ask the teacher to create one for themselves (see the login page), or create one for them using the &amp;quot;Add a new user&amp;quot; on the Admin page.&lt;br /&gt;
&lt;br /&gt;
Once done, the course is ready to customize, and is accessible via the &amp;quot;Courses&amp;quot; link on the home page.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
* [[Complete install packages]] might be an easier first time installs on some systems&lt;br /&gt;
* Help forum:  [http://moodle.org/mod/forum/view.php?id=28 Installation problems]&lt;br /&gt;
* [[Installing Apache, MySQL and PHP]] - Open source programs that can run Moodle on the web or on a desktop&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=42688 Selecting a web host for Moodle] forum discussion&lt;br /&gt;
* [[masquerading|Masquerading]] - Running Moodle behind a masquerading/NAT firewall&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[cs:Instalace]]&lt;br /&gt;
[[de:Installieren von Moodle]]&lt;br /&gt;
[[es:Instalación de moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;br /&gt;
[[nl:Installatiegids]]&lt;br /&gt;
[[pl:Instalacja Moodle]]&lt;br /&gt;
[[pt:Instalação do Moodle]]&lt;br /&gt;
[[ru:Установка Moodle]]&lt;br /&gt;
[[sk:Inštalácia]]&lt;br /&gt;
[[zh:安装Moodlezh:]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=43271</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=43271"/>
		<updated>2008-09-09T00:09:48Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: inserted a space between words&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Firstly don&#039;t panic! :-)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install Moodle for the first time. For some of these steps it goes into a lot of detail to try and cover the majority of possible web server setups, so this page may look long and complicated. Don&#039;t panic, once you know how to do it you can install Moodle in minutes!&lt;br /&gt;
&lt;br /&gt;
If you have problems please read this page carefully - most common issues are answered in here. If you still have trouble, you can seek help from the Moodle community via  [http://moodle.org/course/view.php?id=5 moodle.org Using Moodle].&lt;br /&gt;
&lt;br /&gt;
Another option is to contact a [http://moodle.com/hosting/ Moodle Partner providing Moodle hosting] who can completely maintain Moodle for you, so that you can ignore all this and get straight into educating! A Moodle partner is the preferred option but if you decide to choose a hosting company that has cpanel then [http://ic.eflclasses.org/tutorials/settingupmoodleonhostingwitholdcpanel.swf this tutorial will guide you]  through the process of choosing a host and setting up moodle via the old cpanel. If you have the new cpanel please use this link [http://ic.eflclasses.org/tutorials/settingupmoodleoncpanel.swf this tutorial will guide you].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; some hosting companies offer one-click moodle install options such as fantastico, which whilst sometimes effective, usually use old (sometimes years old) versions of moodle and sometimes simply don&#039;t work. If one of these goes wrong, your best bet is often to start from scratch following the instructions here yourself. Its almost certainly quicker.&lt;br /&gt;
&lt;br /&gt;
If you want to run Moodle on your own computer and this page looks a bit daunting, then please see our guides on how to install one of Moodle&#039;s complete [[Complete install packages for Windows|Windows packages]], [[Complete Install Packages for Mac OS X|Mac OS packages]] or [[Installing AMP |Installing Apache, MySQL and PHP(AMP)]]. They provide alternative instructions to install all this on most popular platforms.&lt;br /&gt;
&lt;br /&gt;
==Table of Contents==&lt;br /&gt;
__TOC__&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), but is also regularly tested with Windows XP/2000/2003 (WAMP), Solaris 10 (Sparc and x64), Mac OS X and Netware 6 operating systems. Support for PostgreSQL, Oracle and Microsoft SQL Server is also available.&lt;br /&gt;
&lt;br /&gt;
The procedure for installing Moodle on the Windows platform (e.g. Windows Server, IIS and MSSQL) varies slightly to the procedure for the LAMP platform. See [[Installation for Windows 2003 with IIS]] for more details.&lt;br /&gt;
&lt;br /&gt;
[[Installing Moodle on Windows Vista]] might help with &#039;&#039;&#039;Blank page problem while installing Moodle on Windows Vista&#039;&#039;&#039; .&lt;br /&gt;
&lt;br /&gt;
The requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
===Hardware === &lt;br /&gt;
* Disk space: 160MB free (min). You will require more free space to store your teaching materials.&lt;br /&gt;
* Memory: 256MB (min), 1GB (recommended). The general rule of thumb is that Moodle can support 50 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination. &lt;br /&gt;
** &#039;&#039;&#039;Note if you are using a hosted account:&#039;&#039;&#039; Most hosted accounts on commercial sites will meet Disk and Memory requirements. However, you should contact your web host&#039;s support desk to check that this is the case before signing-up with them. It is especially important to &#039;&#039;&#039;ask about any PHP memory limits or MySQL question limits&#039;&#039;&#039;. If your prospective host does not provide a service which meets these requirements, or you are already signed up with them, ask them why and consider taking your business elsewhere if they do not change.&lt;br /&gt;
&lt;br /&gt;
===Software===&lt;br /&gt;
* Web server software. Most people use [[Apache]], but Moodle should work fine under any web server that supports [[PHP]], such as [[IIS]] on Windows platforms. PHP does impose requirements on versions of web servers, however these are complex and the general advice is to use the newest version possible of your chosen web server. &lt;br /&gt;
* PHP scripting language. (Please note that there have been issues installing Moodle with [http://www.php-accelerator.co.uk PHP-Accelerator]). There are currently two versions (or branches) of PHP available: PHP4 and PHP5 and the version requirements are listed below.&lt;br /&gt;
** For Moodle version 1.4 or later: PHP4 (version 4.1.0 or later) or PHP5 (version 5.1.0 or later) are supported.&lt;br /&gt;
** For Moodle version 1.6 or later: the PHP4 (version 4.3.0 or later) or PHP5 (version 5.1.0 or later) are supported. &lt;br /&gt;
** Future Moodle versions 2.0 or later will not support PHP4 and will require PHP5 (version 5.2.4 or later).&lt;br /&gt;
** PHP Settings. 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. &lt;br /&gt;
*** &#039;&#039;safe_mode&#039;&#039; needs to be OFF.&lt;br /&gt;
*** &#039;&#039;memory_limit&#039;&#039; should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.&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 ON. (It will be recommended to turn it off in 2.0.)&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.&lt;br /&gt;
** PHP Extensions and libraries&lt;br /&gt;
*** The mbstring extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** The iconv extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** [http://www.libgd.org/ GD library] and the [http://www.freetype.org/ FreeType 2] library and extensions are needed to be able to look at the dynamic graphs that the logs pages make.&lt;br /&gt;
*** The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.&lt;br /&gt;
*** The pgsql extension is required if you are using the PostgreSQL database.&lt;br /&gt;
*** The pdo and pdo_sqlite extensions are required for the (experimental) SQLite 3 database support.&lt;br /&gt;
*** The curl extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The tokenizer extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).&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;
* A working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is &#039;&#039;the&#039;&#039; choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment.&lt;br /&gt;
** For Moodle 1.5, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later). &lt;br /&gt;
** For Moodle 1.6, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).&lt;br /&gt;
** For Moodle 1.7, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
** For Moodle 1.8 or later, MySQL (version 4.1.12 or later), PostgreSQL (8.0 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
: MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting &amp;quot;strict mode&amp;quot; must be OFF (set to &amp;quot;&amp;quot; or &amp;quot;MYSQL40&amp;quot;) in the MySQL configuration file. &lt;br /&gt;
: PostgreSQL Notes: PostgreSQL 7.4 is recommended for earlier Moodle versions, since Moodle 1.8 only PostgreSQL 8.0 and above are supported.&lt;br /&gt;
* For showcases or low to medium-sized installations, Moodle 2.0 also includes (experimental) support for SQLite 3 database. This setup requires no database server, as the database file is stored in a local directory on the server.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== How many users? ==&lt;br /&gt;
&lt;br /&gt;
In addition to the hardware and software requirements, you will also need to think about the capacity of your Moodle installation in terms of the number of users it can handle. There are two numbers to plan for:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Browsing users&#039;&#039;&#039;: the maximum number of users able to browse your Moodle site. This is the number of computers in your organization or on your course (whichever is greater).&lt;br /&gt;
:&#039;&#039;&#039;Concurrent database users&#039;&#039;&#039;: the maximum number of concurrent database users (needed for Moodle activities such as quizzes). This is the number of users who will be using Moodle at the same time. In an educational institution, use your timetable/roster to obtain this figure.&lt;br /&gt;
&lt;br /&gt;
Once you know these figures for your users, you can start work out if your Moodle installation can support this capacity. The exact number of users depends on your hardware/software/network combination. Usually the amount of memory installed (RAM) is the deciding factor but a faster overall processor speed will also help in reducing waiting times for pages to load. &lt;br /&gt;
&lt;br /&gt;
The general rule of thumb for a single server is that the approx max concurrent users = RAM (GB) * 50 and the approx max browsing users = Approx max concurrent users * 5. As an example, a university with 500 total computers on campus and 100 concurrent users at any time will need approx 2GB of RAM on the one server to support the number of concurrent users.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Ask your provider what limits are placed on the number of concurrent database connections and the processor load. This will give a good estimate of the number of users your Moodle install can manage.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note:&#039;&#039;&#039; As of August 31, 2007, Moodle 1.8.2+ is not recommended for large installations, especially if you have large number (e.g. 20,000+) of courses. The main reason is the codes related to ROLES are still not fully optimized with database queries and still need some work. If you are planning to use 1.8.x codes for a larger institution, please make sure that you have sufficient time to do your own testing and performance profiling.  Upgrade to Moodle 1.9!!&lt;br /&gt;
&lt;br /&gt;
[Update|Updating from a previous version] of Moodle has been improved quite a bit from 1.8.3+ version (see this thread discussion: http://moodle.org/mod/forum/discuss.php?d=83281).  Moodle 1.9 has even more improvements in all areas and is the recommended version.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to get Moodle, either as a compressed package or via [[CVS]]. &lt;br /&gt;
&lt;br /&gt;
=== Download from compressed packages===&lt;br /&gt;
There are two types of compressed packages at the [http://download.moodle.org/ download.moodle.org page:] which offer a variety of version, operating systems and compression types.&lt;br /&gt;
#The &amp;quot;Standard Distribution&amp;quot; (with Moodle only files) and &lt;br /&gt;
#Several operating system &amp;quot;Complete Install Packages&amp;quot; (which contains programs to create a Moodle in a web environment). Please see [[Complete install packages]] for more information.  &lt;br /&gt;
&lt;br /&gt;
Most of these instructions are for the standard distribution, &lt;br /&gt;
Download a compressed package and then unpack the archive into your file structure using either of these two commands:&lt;br /&gt;
 tar -zxvf [filename]&lt;br /&gt;
 unzip [filename]&lt;br /&gt;
&lt;br /&gt;
===Download from CVS===&lt;br /&gt;
To use CVS, helpful instructions are available at the [[CVS_for_Administrators | CVS for Administrators]] page. The full [http://cvs.moodle.org/moodle/ Moodle CVS repository] is also available for browsing. &lt;br /&gt;
&lt;br /&gt;
If you are using CVS, run the CVS Checkout command.&lt;br /&gt;
&lt;br /&gt;
===Directory created placement===&lt;br /&gt;
After either of the above processes, you will now have with a directory called &amp;quot;moodle&amp;quot;, containing a number of files and folders.&lt;br /&gt;
&lt;br /&gt;
For the standard package, 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;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip&#039;&#039;&#039;: If you are downloading Moodle to your local computer and then uploading it to your web site, it is usually better to upload the whole archive as one file, and then do the unpacking on the server. Even web hosting interfaces like cPanel allow you to uncompress archives in the &amp;quot;File Manager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Structure of moodle directory ===&lt;br /&gt;
&lt;br /&gt;
You can safely skip this section, but here is a quick summary of the contents of the Moodle folder, to help get you oriented:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;config.php&#039;&#039; - contains basic settings. This file does not come with Moodle - you will create it by executing install.php or manually.&lt;br /&gt;
:&#039;&#039;install.php&#039;&#039; - the script you will run to create config.php&lt;br /&gt;
:&#039;&#039;version.php&#039;&#039; - defines the current version of Moodle code&lt;br /&gt;
:&#039;&#039;index.php&#039;&#039; - the front page of the site&lt;br /&gt;
:&#039;&#039;admin/&#039;&#039; - code to administrate the whole server&lt;br /&gt;
:&#039;&#039;auth/&#039;&#039; - plugin modules to authenticate users&lt;br /&gt;
:&#039;&#039;blocks/&#039;&#039; - plugin modules for the little side blocks on many pages&lt;br /&gt;
:&#039;&#039;calendar/&#039;&#039; - all the code for managing and displaying calendars&lt;br /&gt;
:&#039;&#039;course/&#039;&#039; - code to display and manage courses&lt;br /&gt;
:&#039;&#039;doc/&#039;&#039; - help documentation for Moodle (eg this page)&lt;br /&gt;
:&#039;&#039;files/&#039;&#039; - code to display and manage uploaded files&lt;br /&gt;
:&#039;&#039;lang/&#039;&#039; - texts in different languages, one directory per language&lt;br /&gt;
:&#039;&#039;lib/&#039;&#039; - libraries of core Moodle code&lt;br /&gt;
:&#039;&#039;login/&#039;&#039; - code to handle login and account creation&lt;br /&gt;
:&#039;&#039;mod/&#039;&#039; - all the main Moodle course modules are in here&lt;br /&gt;
:&#039;&#039;pix/&#039;&#039; - generic site graphics&lt;br /&gt;
:&#039;&#039;theme/&#039;&#039; - theme packs/skins to change the look of the site.&lt;br /&gt;
:&#039;&#039;user/&#039;&#039; - code to display and manage users&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Setting-up your system==&lt;br /&gt;
To ensure that Moodle will install successfully, you need to check that the web server settings are correct, then create a blank database for Moodle to use and finally create a directory on your hard disk for Moodle to save your materials and other files you upload into your courses.&lt;br /&gt;
&lt;br /&gt;
=== Check web server settings ===&lt;br /&gt;
&lt;br /&gt;
*Firstly, make sure that your web server is set up to use index.php as a default page (perhaps in addition to index.html, default.htm and so on). In Apache, this is done using a DirectoryIndex parameter in your httpd.conf file. Mine usually looks like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
:Just make sure index.php is in the list (and preferably towards the start of the list, for efficiency).&lt;br /&gt;
&lt;br /&gt;
*Secondly, &#039;&#039;&#039;if you are using Apache 2&#039;&#039;&#039;, then you should turn on the &#039;&#039;AcceptPathInfo&#039;&#039; variable, which allows scripts to be passed arguments like &amp;lt;nowiki&amp;gt;http://server/file.php/arg1/arg2&amp;lt;/nowiki&amp;gt;. This is essential to allow relative links between your resources, and also provides a performance boost for people using your Moodle web site. You can turn this on by adding these lines to your httpd.conf file. (NB: This setting, or any equivalent, is not required in Apache 1)&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
=== Recheck PHP settings ===&lt;br /&gt;
Moodle requires a number of PHP settings to be active for it to work. These were given in the Requirements section and &#039;&#039;&#039;On most servers these will already be the default settings&#039;&#039;&#039;.  However, some PHP servers (and some of the more recent PHP versions) may have things set differently, so it is useful to double-check that the settings are correct. These are defined in PHP&#039;s configuration file (usually called &#039;&#039;&#039;php.ini&#039;&#039;&#039;) or in the Apache &#039;&#039;&#039;.htaccess&#039;&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
 safe_mode = 0 (necessary)&lt;br /&gt;
 memory_limit = 40M (varies: minimum 16M, 32M Moodle v1.7, 40M Moodle v1.8, 128M large sites)&lt;br /&gt;
 session.save_handler = files (unless you are using another handler, e.g. mm)   &lt;br /&gt;
 magic_quotes_gpc = 1    (preferred but not necessary, 0 will be recommended in 2.0)&lt;br /&gt;
 magic_quotes_runtime = 0    (necessary)&lt;br /&gt;
 file_uploads = 1&lt;br /&gt;
 session.auto_start = 0&lt;br /&gt;
 session.bug_compat_warn = 0&lt;br /&gt;
&lt;br /&gt;
You may also want to set other, optional php.ini file settings while you are already editing it. For instance, you may want to reset the maximum upload size of file attachments, which usually defaults to 2M(egabytes). For instance, to set these to 16 Megabytes:&lt;br /&gt;
 &lt;br /&gt;
 post_max_size = 16M&lt;br /&gt;
 upload_max_filesize = 16M&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Using a .htaccess file for webserver and PHP settings ===&lt;br /&gt;
&lt;br /&gt;
Use the above if you can directly edit your server&#039;s files, but if you are setting-up Moodle on a webhost, or don&#039;t have access to &#039;&#039;&#039;httpd.conf&#039;&#039;&#039; or &#039;&#039;&#039;php.ini&#039;&#039;&#039; on your server, or you have Moodle on a server with other applications that require different settings, then don&#039;t worry, you can often still override the default settings. This only works on Apache servers and only when Overrides have been allowed in the main Apache configuration. Moodle is supplied with a htaccess file which you can use, or you can create your own file manually.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Use the default htaccess file&#039;&#039;&#039;. The easiest thing to do is just copy the sample file from moodle/lib/htaccess and edit it to suit your needs. It contains further instructions. For example, in a Unix shell:&lt;br /&gt;
&lt;br /&gt;
 cd moodle&lt;br /&gt;
 cp moodle/lib/htaccess .htaccess&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Create your own file&#039;&#039;&#039;. Alternatively you can create your own file called &#039;&#039;&#039;.htaccess&#039;&#039;&#039; in Moodle&#039;s main directory that contains lines like the following. &lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
 php_value memory_limit 40M (adjust to your version of Moodle)&lt;br /&gt;
 php_flag magic_quotes_gpc 1&lt;br /&gt;
 php_flag magic_quotes_runtime 0&lt;br /&gt;
 php_flag file_uploads 1&lt;br /&gt;
 php_flag session.auto_start 0&lt;br /&gt;
 php_flag session.bug_compat_warn 0&lt;br /&gt;
&lt;br /&gt;
:If you have Apache version 2 installed, add these lines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IfDefine APACHE2&amp;gt;&lt;br /&gt;
     AcceptPathInfo on&lt;br /&gt;
 &amp;lt;/IfDefine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Otherwise add this single line:&lt;br /&gt;
&lt;br /&gt;
 AcceptPathInfo on&lt;br /&gt;
&lt;br /&gt;
:Optionally, you can also do things like define the maximum size for uploaded files, etc by adding these lines:&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 0&lt;br /&gt;
 php_value upload_max_filesize 2M&lt;br /&gt;
 php_value post_max_size 2M&lt;br /&gt;
&lt;br /&gt;
:The value given in these lines is 2M. You may want to change this at a later date to allow uploading of larger files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Some shared hosts do not allow .htaccess files&#039;&#039;&#039;. In this case, it may be necessary to place a php.ini file within each sub-directory of the site. To do this, you use your editor to create a php.ini file in the main moodle directory and later copy it to all sub-directories. The syntax for the php.ini file is different than the one used in .htaccess - you do not use the php_value and php_flag prefixes. See the example below:&lt;br /&gt;
 upload_max_filesize = 2M&lt;br /&gt;
 post_max_size = 2M&lt;br /&gt;
:After creating the php.ini file with all of the statements you need, run the script http://tips-scripts.com/php_ini_copy or copy php.ini manually to all sub-directories.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Some shared hosts use suPHP, which requires a slightly different configuration&#039;&#039;&#039;. If everything else fails, try creating the following two files and uploading to your moodle root directory&lt;br /&gt;
:php.ini (sample):&lt;br /&gt;
 register_globals = 0&lt;br /&gt;
 display_errors = 0&lt;br /&gt;
&lt;br /&gt;
:.htaccess (sample):&lt;br /&gt;
 suPHP_ConfigPath /home/cPanelName/public_html/moodle&lt;br /&gt;
&lt;br /&gt;
Change the above path to the actual path to your moodle install.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note&#039;&#039;&#039;: Use a .htaccess file only [http://httpd.apache.org/docs/1.3/howto/htaccess.html#when as a last resort] as it can have an impact on the performance of your Moodle site and cause pages to load slowly on your browser.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating an empty database ===&lt;br /&gt;
&lt;br /&gt;
You need to create an empty database (eg &amp;quot;&#039;&#039;moodle&#039;&#039;&amp;quot;) in your database system along with a special user (eg &amp;quot;moodleuser&amp;quot;) that has access to that database (and that database only). You could use the &amp;quot;root&amp;quot; user if you wanted to for a test server, but this is not recommended for a production system: if hackers manage to discover the password then your whole database system would be at risk, rather than just one database.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Warning&#039;&#039;&#039;: Bear in mind that, as of Moodle version 1.5.x, Moodle doesn&#039;t work with MySQL 5.x&#039;s strict mode setting (STRICT_TRANS_TABLES and/or STRICT_ALL_TABLES) -- see [http://moodle.org/mod/forum/discuss.php?d=58552 forum discussion]. So if you are using MySQL 5.x, edit MySQL&#039;s configuration file (called &amp;quot;my.ini&amp;quot; in Windows and &amp;quot;my.cnf&amp;quot; on Unix/Linux) and comment out that option or set it to &amp;lt;code&amp;gt;sql-mode=&#039;&#039;&amp;lt;/code&amp;gt;. You have to restart MySQL after changing this setting. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; If you do not have access to your server, use PHPMyAdmin (or another MySQL client) and enter the command &amp;lt;code&amp;gt;SET @@global.sql_mode=&#039;&#039;;&amp;lt;/code&amp;gt; (be sure to use single quotes, and don&#039;t forget the semicolon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
====Using a hosted server====&lt;br /&gt;
If you are using a webhost, they will probably have a control panel web interface for you to create your database.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;[http://www.cpanel.com/ cPanel]&#039;&#039;&#039; system is one of the most popular of these. &lt;br /&gt;
To create a database using cPanel:&lt;br /&gt;
&lt;br /&gt;
# Click on the &#039;&#039;&#039;MySQL Databases&#039;&#039;&#039; icon.&lt;br /&gt;
# Type &#039;&#039;&#039;moodle&#039;&#039;&#039; in the New Database field and click &#039;&#039;&#039;Create Database&#039;&#039;&#039;.&lt;br /&gt;
# Type a &#039;&#039;username&#039;&#039; and &#039;&#039;password&#039;&#039; (not one you use elsewhere) in the respective fields and click &#039;&#039;&#039;Create  User&#039;&#039;&#039;.&amp;lt;br&amp;gt;Note that the &#039;&#039;username&#039;&#039; and &#039;&#039;database&#039;&#039; names may be prefixed by your cPanel account name and an underscore, and truncated to 16 characters. When entering this information into the Moodle installer - use the full names.&lt;br /&gt;
# Now use the &#039;&#039;&#039;Add Users to Databases&#039;&#039;&#039; button and give this new user account &#039;&#039;&#039;ALL&#039;&#039;&#039; rights to the new database.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#CreatDataDir |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
====Using a SQLite database====&lt;br /&gt;
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.&lt;br /&gt;
&lt;br /&gt;
Moodle 2.0 offers support for SQLite3 database installations. In this case, no database setup is required. The database file will be created by the installation script. By default, the database file will be store in Moodle&#039;s data directory (see [[Installing_Moodle#CreatDataDir |Creating the data directory]]). During install, the web server must have write access on the directory where the database file will be stored. After installation, the web server must have read-write access to the database file.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#CreatDataDir |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Using the command line====&lt;br /&gt;
&lt;br /&gt;
If you have access to Unix or Windows command lines then you can do the same sort of thing by typing commands. You should do this using the MySQL Client program as follows (commands which you type-in are shown in bold):&lt;br /&gt;
&lt;br /&gt;
- Start the MySQL Client program:&lt;br /&gt;
 #&#039;&#039;&#039;mysql -u root -p&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;
 Your MySQL connection id is 2 to server version: 5.0.22-log&lt;br /&gt;
 &lt;br /&gt;
 Type &#039;help;&#039; or &#039;\h&#039; for help. Type &#039;\c&#039; to clear the buffer.&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The prompt changes to &amp;quot;mysql&amp;gt;&amp;quot; to indicate that you are now working in the MySQL Client program. When working in MySQL, all commands which you type-in must end in a semi-colon. (If you hit the Enter key without the final semi-colon, you&#039;ll get the line continuation symbol &#039;-&amp;gt;&#039;; this is your second chance to type the semi-colon and hit Enter.) &lt;br /&gt;
&lt;br /&gt;
- Begin by checking for any existing databases called &amp;quot;moodle&amp;quot; - if there are any you should change the name in all the commands which follow:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;SHOW DATABASES;&#039;&#039;&#039;&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | Database                |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | information_schema      |&lt;br /&gt;
 | mysql                   |&lt;br /&gt;
 | test                    |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 3 rows in set (0.03 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a database to store the Moodle tables. We&#039;ll call this &amp;quot;moodle&amp;quot;, as there are none with that name already in the above list, but change it if you need to.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;CREATE DATABASE moodle;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Change the default character set and collation of the &amp;quot;moodle&amp;quot; database to UTF8. Leave this out if you are installing Moodle 1.5 or earlier):&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a username and password to access the database &amp;quot;moodle&amp;quot; and grant database access permissions. We&#039;ll call the user &amp;quot;moodleuser&amp;quot; and set the password as &amp;quot;yourpassword&amp;quot;. It&#039;s a good idea to change these for your installation however most people keep the username as &amp;quot;moodleuser&amp;quot;. Remember the username and password you have set, as you&#039;ll need it in the configuration screens later. This is a long command so has been split over several lines by pressing the Return key.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;DROP,INDEX,ALTER ON moodle.*&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 0 rows affected (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Security Warnings&#039;&#039;&#039;: Never leave the password as the one shown here. Make sure you have a strong password (a mixture of letters and numbers, upper and lower case). Avoid granting &amp;quot;ALL&amp;quot; permissions on the database.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: For MySQL 4.0.1 or earlier, you don&#039;t need the CREATE TEMPORARY TABLES permission. &lt;br /&gt;
&lt;br /&gt;
- Exit the MySQL Client program:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;QUIT&#039;&#039;&#039;&lt;br /&gt;
 Bye&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
- Reload the grant tables using the mysqladmin program:&lt;br /&gt;
 #&#039;&#039;&#039;mysqladmin -u root -p reload&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
And some example command lines for PostgreSQL:&lt;br /&gt;
&lt;br /&gt;
   # su - postgres&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create user moodleuser createdb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create database moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;with encoding &#039;unicode&#039;&amp;lt;/font&amp;gt;;&amp;quot; -U moodleuser template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser nocreatedb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser with encrypted password &#039;yourpassword&#039;;&amp;quot; template1&lt;br /&gt;
   &amp;gt; su - root&lt;br /&gt;
   # /etc/init.d/postgresql reload&lt;br /&gt;
&lt;br /&gt;
If the Postgres create database command above (&amp;gt;psql -c &amp;quot;create database moodle...&amp;quot;) gives an error message you may want to try:&lt;br /&gt;
 psql -c &amp;quot;create database moodle with template=template1 encoding = &#039;unicode&#039; owner =  moodleuser &amp;lt;br&amp;gt;     location = &#039;/var/mydata&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the create database command asks you for a password, run the line containing &#039;encrypted password&#039; first before proceeding.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
* Step-by-step instructions on  [https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Ubuntu installation for Ubuntu(Debian)]&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating the data directory  ===&lt;br /&gt;
&lt;br /&gt;
Moodle will also need some space on your server&#039;s hard disk to store uploaded files, such as course documents and user pictures. The Moodle installer tries hard to create the &#039;&#039;&#039;moodledata&#039;&#039;&#039; directory for you but if it fails then you will have to create a directory for this purpose manually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Security warning&#039;&#039;&#039;: For security purposes, it is &#039;&#039;&#039;CRITICAL&#039;&#039;&#039; that this directory is &#039;&#039;&#039;NOT&#039;&#039;&#039; accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web site root directory (it is the folder that the main part of your URL -that is, the part up to the first single / - points to; for example, in &amp;lt;nowiki&amp;gt;http://your.domain.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;, it is &amp;lt;nowiki&amp;gt;http://your.domain.com/&amp;lt;/nowiki&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
But if you must have it in the web directory (and you are using Apache AND the web server configuration allows .htaccess files to restrict access to directories) then protect it by creating a file in the data directory called &#039;&#039;&#039;.htaccess&#039;&#039;&#039;, containing these lines:&lt;br /&gt;
&lt;br /&gt;
 order deny,allow&lt;br /&gt;
 deny from all&lt;br /&gt;
&lt;br /&gt;
If you are using IIS, you need to edit the properties of the data directory (from the Internet Information Services Manager console) and deny access to that folder to everybody from the web.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;If you don&#039;t protect the data directory from direct web access, anybody will be able to impersonate any user of your Moodle site (including the admin user!!!), and all of your course materials will be available to the web at large.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ownership &amp;amp; Permissions&#039;&#039;&#039;: To make sure that Moodle can save uploaded files in this directory, check that the web server software has permission to read, write and execute in this directory. On Unix machines, this means setting the owner of the directory to be something like &amp;quot;nobody&amp;quot; or &amp;quot;apache&amp;quot;, and then giving that user read, write and execute permissions. As an example, to change the owner to &amp;quot;nobody&amp;quot; you could use:&lt;br /&gt;
&lt;br /&gt;
 chown -R nobody:apache moodledata&lt;br /&gt;
&lt;br /&gt;
To change the permissions so that the owner has read,write and execute permissions, use something like this:&lt;br /&gt;
&lt;br /&gt;
 chmod -R 0770 moodledata&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are receiving permission denied messages, try &#039;&#039;chmod -R 0770 moodledata&#039;&#039; and then adjust the settings so that they are more secure. A more secure setting is &#039;&#039;chmod -R 0750 moodledata&#039;&#039;. According to the comments in config-dist.php, &amp;quot;On hosting systems you might need to make sure that your group has no permissions at all while others have full permissions.&amp;quot; To do this you could use &#039;&#039;chmod -R 707 moodledata&#039;&#039;. See also the [[Security | security page]].&lt;br /&gt;
&lt;br /&gt;
Remember that by default moodle will issue a warning about moodle data directories created inside the web directory, but otherwise this directory can be located where you wish. You can later move or change the location of this directory, but if you do, be sure to edit the setting in the &#039;&#039;&#039;config.php&#039;&#039;&#039; file that sets this; e.g. if moodledata is under a directory called data, then it would look like this:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dataroot  = &#039;/data/moodledata&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CPanel and webhosts&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On cPanel systems you can use the &amp;quot;File Manager&amp;quot; to find the folder, click on it, then choose &amp;quot;Change Permissions&amp;quot;. On many shared hosting servers, you will probably need to restrict all file access to your &amp;quot;group&amp;quot; (to prevent other webhost customers from looking at or changing your files), but provide full read/write access to everyone else (which will allow the web server to access your files). Speak to your server administrator if you are having trouble setting this up securely. In particular it will not be possible to create a usable data directory on sites that use a PHP feature known as &amp;quot;&#039;&#039;&#039;Safe Mode&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Run the installer script to create config.php ==&lt;br /&gt;
&lt;br /&gt;
To run the installer script (install.php), just try to access your Moodle main URL using a web browser, or access &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourserver/install.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; directly.&lt;br /&gt;
&lt;br /&gt;
(The Installer will try to set a session cookie. If you get a popup warning in your browser make sure you accept that cookie!)&lt;br /&gt;
&lt;br /&gt;
Moodle will detect that configuration is necessary and will lead you through some screens to help you create a new configuration file called &#039;&#039;&#039;config.php&#039;&#039;&#039;. At the end of the process Moodle will try and write the file into the right location, otherwise you can press a button to download it from the installer and then upload &#039;&#039;&#039;config.php&#039;&#039;&#039; into the main Moodle directory on the server.&lt;br /&gt;
&lt;br /&gt;
Along the way the installer will test your server environment and give you suggestions about how to fix any problems. For most common issues these suggestions should be sufficient, but if you get stuck, check in the Installation Forum for more help.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Go to the admin page to continue configuration ==&lt;br /&gt;
&lt;br /&gt;
Once the basic config.php has been correctly created in the previous step, trying to access the front page of your site will take you to the &amp;quot;admin&amp;quot; page for the rest of the configuration.&lt;br /&gt;
&lt;br /&gt;
The first time you access this admin page, you will be presented with a GPL &amp;quot;shrink wrap&amp;quot; agreement with which you must agree before you can continue with the setup.&lt;br /&gt;
&lt;br /&gt;
Now Moodle will start setting up your database and creating tables to store data. Firstly, the main database tables are created. You should see a number of SQL statements followed by status messages that look like this:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE course (&lt;br /&gt;
    id int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
    category int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    password varchar(50) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    fullname varchar(254) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    shortname varchar(15) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    summary text NOT NULL,&lt;br /&gt;
    format tinyint(4) NOT NULL default &#039;1&#039;,&lt;br /&gt;
    teacher varchar(100) NOT NULL default &#039;Teacher&#039;,&lt;br /&gt;
    startdate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    enddate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    timemodified int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    PRIMARY KEY (id)&lt;br /&gt;
 ) TYPE=MyISAM;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;SUCCESS&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and so on, followed by: &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Main databases set up successfully.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see these, then there must have been some problem with the database or the configuration settings you defined in config.php. Check that PHP isn&#039;t in a restricted &amp;quot;Safe Mode&amp;quot; (commercial web hosts sometimes have safe mode turned on). You can check PHP variables by creating a little file containing &#039;&#039;&#039;&amp;lt;?php phpinfo() ?&amp;gt;&#039;&#039;&#039; and looking at it through a browser. Check all these and try this page again.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
You should now see a form where you can define more configuration variables for your installation, such as the default language, SMTP hosts and so on. Don&#039;t worry too much about getting everything right just now - you can always come back and edit these later on using the admin interface. The defaults are designed to be useful and secure for most sites. Scroll down to the bottom and click &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If (and only if) you find yourself getting stuck on this page, unable to continue, then your server probably has what I call the &amp;quot;buggy referrer&amp;quot; problem. This is easy to fix: just turn off the &amp;quot;secureforms&amp;quot; setting, then try to continue again.&lt;br /&gt;
&lt;br /&gt;
Next you will see more pages that print lots of status messages as they set up all the tables required by the various Moodle module. As before, they should all be &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;green&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
The next page is a form where you can define parameters for your Moodle site and the front page, such as the name, format, description and so on. Fill this out (you can always come back and change these later) and then press &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finally, you will then be asked to create a top-level administration user for future access to the admin pages. Fill out the details with your own name, email etc and then click &amp;quot;Save changes&amp;quot;. Not all the fields are required, but if you miss any important fields you&#039;ll be re-prompted for them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure you remember the username and password you chose for the administration user account, as they will be necessary to access the administration page in future.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(If for any reason your install is interrupted, or there is a system error of some kind that prevents you from logging in using the admin account, you can usually log in using the default username of &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;, with password &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Once successful, you will be returned to the home page of your new site! Note the administration links that appear down the left hand side of the page (these items also appear on a separate Admin page) - these items are only visible to you because you are logged in as the admin user. All your further administration of Moodle can now be done using this menu, such as:&lt;br /&gt;
&lt;br /&gt;
* creating and deleting courses&lt;br /&gt;
* creating and editing user accounts&lt;br /&gt;
* administering teacher accounts&lt;br /&gt;
* changing site-wide settings like themes etc&lt;br /&gt;
&lt;br /&gt;
But you are not done installing yet! There is one very important thing still to do (see the next section on cron).&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Installing Moodle Using Command Line ==&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
&lt;br /&gt;
Installing Moodle Using command line is just as easy as installing Moodle using web browser. &lt;br /&gt;
* First Go to the moodle root directory and then to admin directory inside the moodle root. &lt;br /&gt;
&lt;br /&gt;
 $cd /var/www/html/moodle/admin&lt;br /&gt;
&lt;br /&gt;
* Then simply use the following syntax to run the moodle command line installer (this is a long command which has been split over 3 lines, so type as one line)&lt;br /&gt;
 $php cliupgrade.php --lang=en --webaddr=&amp;lt;nowiki&amp;gt;http://www.example.com&amp;lt;/nowiki&amp;gt; --moodledir=/var/www/html/moodle &lt;br /&gt;
                     --datadir=/var/moodledata --dbtype=mysql --dbhost=localhost --dbname=moodle &lt;br /&gt;
                     --dbuser=root --prefix=mdl --verbose=1 --interactivelevel=2 &lt;br /&gt;
&lt;br /&gt;
More information about the options can be found using &lt;br /&gt;
$php cliupgrad.php --help&lt;br /&gt;
&lt;br /&gt;
Then you will see the following list of available options&lt;br /&gt;
&lt;br /&gt;
 --lang		 		Valid installed language for installation. Default is English(en)&lt;br /&gt;
 --webaddr			Web address for the Moodle site&lt;br /&gt;
 --moodledir			Location of the moodle web folder&lt;br /&gt;
 --datadir			Location of the moodle data folder (should not be web visible)&lt;br /&gt;
 --dbtype			Database type. Default it mysql&lt;br /&gt;
 --dbhost			Database host. Default localhost&lt;br /&gt;
 --dbname			Database name. Default is moodle&lt;br /&gt;
 --dbuser			Database user. Default is blank&lt;br /&gt;
 --dbpass			Database password. Default is blank&lt;br /&gt;
 --prefix			        Table prefix for above database tables. Default is mdl&lt;br /&gt;
 --verbose			0 No output, 1 Summarized output(Default), 2 Detailed output&lt;br /&gt;
 --interactivelevel	        0 Non interactive, 1 Semi interactive(Default), 2 Interactive&lt;br /&gt;
 --help				print out this help&lt;br /&gt;
&lt;br /&gt;
When you choose non interactive mode without any options all the default values are assumed.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Set up cron ==&lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
== Set up backups ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Backup settings| backup instructions]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Create a new course ==&lt;br /&gt;
&lt;br /&gt;
Now that Moodle is running properly, you can try creating a new course to play with.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Create a new course&amp;quot; from the Admin page (or the admin links on the home page).&lt;br /&gt;
&lt;br /&gt;
Fill out the form, paying special attention to the course format. You don&#039;t have to worry about the details too much at this stage, as everything can be changed later by the teacher. Note that the yellow help icons are everywhere to provide contextual help on any aspect.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;Save changes&amp;quot;, and you will be taken to a new form where you can assign teachers to the course. You can only add existing user accounts from this form - if you want to create a new teacher account then either ask the teacher to create one for themselves (see the login page), or create one for them using the &amp;quot;Add a new user&amp;quot; on the Admin page.&lt;br /&gt;
&lt;br /&gt;
Once done, the course is ready to customize, and is accessible via the &amp;quot;Courses&amp;quot; link on the home page.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
* [[Complete install packages]] might be an easier first time installs on some systems&lt;br /&gt;
* Help forum:  [http://moodle.org/mod/forum/view.php?id=28 Installation problems]&lt;br /&gt;
* [[Installing Apache, MySQL and PHP]] - Open source programs that can run Moodle on the web or on a desktop&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=42688 Selecting a web host for Moodle] forum discussion&lt;br /&gt;
* [[masquerading|Masquerading]] - Running Moodle behind a masquerading/NAT firewall&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[cs:Instalace]]&lt;br /&gt;
[[de:Installieren von Moodle]]&lt;br /&gt;
[[es:Instalación de moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;br /&gt;
[[nl:Installatiegids]]&lt;br /&gt;
[[pl:Instalacja Moodle]]&lt;br /&gt;
[[pt:Instalação do Moodle]]&lt;br /&gt;
[[ru:Установка Moodle]]&lt;br /&gt;
[[sk:Inštalácia]]&lt;br /&gt;
[[zh:安装Moodlezh:]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=43057</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=43057"/>
		<updated>2008-09-02T20:59:53Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* I receive this error &amp;quot;500:Internal Server Error&amp;quot; */ correct grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Table of Contents==&lt;br /&gt;
__TOC__&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;?PHP phpinfo() ?&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== System information needed for Installation Forum ==&lt;br /&gt;
When posting questions to the installation forum, try to provide as much background information as possible about your moodle system. Use this template to copy and paste into your post:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* Browser name (version also if possible):&lt;br /&gt;
* Moodle version:&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached?(Y/N):&lt;br /&gt;
* Phpinfo attached? (Y/N):&lt;br /&gt;
&lt;br /&gt;
For the last two items, try to include the following in your post as an attachment:&lt;br /&gt;
* A copy of your phpinfo output as shown in your browser (see the instructions above for an explanation of how to obtain this).&lt;br /&gt;
* A copy of the Moodle configuration file. This is located in the directory moodle and is named config.php&lt;br /&gt;
&lt;br /&gt;
Copy and paste both of these into a single text file (using vi, Notepad, etc) and attach this to your post.&lt;br /&gt;
&lt;br /&gt;
If you cannot provide your phpinfo, try to copy &amp;amp; paste and complete these in your post:&lt;br /&gt;
* Webserver (e.g. Apache/IIS) version:&lt;br /&gt;
* Database server (e.g. MySQL, PostgreSQL) version:&lt;br /&gt;
* PHP version:&lt;br /&gt;
&lt;br /&gt;
For installation on web hosting accounts: contact your support desk who should be able to tell you this information.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Security Warning&#039;&#039;&#039;: Make sure you edit any files and delete any passwords before posting onto the forum.&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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. Please remember that manually editing the file is not recommended and may lead to blank pages, especially if there are additional spaces and/or lines after the final php closing tag &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==Running a health check==&lt;br /&gt;
Moodle contains a script that will help identify common php and webserver configuration problems as well as configuration problems. It is a good idea to run this script to check if you are having post-installation problems. Use your browser to run this file:&lt;br /&gt;
&lt;br /&gt;
 http://www.mymoodle.com/moodle/admin/health.php&lt;br /&gt;
&lt;br /&gt;
Change the above line if you have installed moodle in the webroot instead of a folder inside the webroot.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
* &#039;&#039;&#039;Generic Packages&#039;&#039;&#039;: If your server does not meet the [[Installing_Moodle#Requirements | requirements]] for the current version of Moodle, 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 http://download.moodle.org/stable15. 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, or alternatively use these URLs for zip or tgz downloads:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].tgz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Changes made in the version in the last month are listed in the &amp;quot;CHANGES&amp;quot; file in the directory listing. The files you download contain Moodle code and are not the Windows or Mac packages - so you need to have a webserver, a database server and PHP already installed. The earliest version available is Moodle 1.3.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download previous releases of the 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 previous releases of the Mac pacakges, 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;
* &#039;&#039;&#039;Using CVS&#039;&#039;&#039;: You can also use CVS to download older releases and incremental releases of the Moodle generic packages, e.g. Moodle 1.5.4 - see the [[CVS_for_Administrators | CVS documentation]].&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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. &lt;br /&gt;
* &#039;&#039;&#039;Using the php.ini file&#039;&#039;&#039;: The log settings are contained in the php.ini file stored on the server. If you don&#039;t know where that is, edit your Moodle &#039;&#039;config.php&#039;&#039; and add the following as the second line&lt;br /&gt;
&lt;br /&gt;
  phpinfo();&lt;br /&gt;
&lt;br /&gt;
:then reload the web page. Look for the entry &#039;&#039;&#039;Configuration File (php.ini) Path&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:When you have located php.ini open it in your favorite text editor. Find the &#039;&#039;&#039;Error handling and logging&#039;&#039;&#039; section of the php.ini file. Make sure that both &#039;&#039;&#039;display_errors = On&#039;&#039;&#039;, &#039;&#039;&#039;display_startup_errors = On&#039;&#039;&#039; and &#039;&#039;&#039;log_errors = On&#039;&#039;&#039; are present and uncommented. Check the value of &#039;&#039;&#039;error_log&#039;&#039;&#039; - this tells you the location of the file errors are logged to. If it is commented out then errors will be sent to the web server error log file. Remember, if you make any changes to this file you will need to restart the web server (or just reboot the server).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Using ini_set commands&#039;&#039;&#039;: If you are using Moodle 1.7 or higher, the previous steps are not enough. In those versions error logging parameters are dependant on certain administrative settings that you specify in the debugging section. The problem is that if you can&#039;t access the administrative pages, you can&#039;t set the debugging options. So the only way to modify them is by adding the following lines to your config.php file, just before the last line (the one containing a single&#039;?&amp;gt;&#039; only):&lt;br /&gt;
&lt;br /&gt;
  ini_set (&#039;display_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;log_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;display_startup_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;error_reporting&#039;, E_ALL);&lt;br /&gt;
  $CFG-&amp;gt;debug = DEBUG_ALL;&lt;br /&gt;
&lt;br /&gt;
:This will enable the same settings specified above even if Moodle sets them otherwise. &lt;br /&gt;
:&#039;&#039;&#039;Important&#039;&#039;&#039;: Remember to put them just before the last line of config.php.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
==Any text I add with an apostrophe (&#039;) or a quote (&amp;quot;) causes errors or comes up with a slash added==&lt;br /&gt;
&lt;br /&gt;
Problems caused by apostrophes are caused by incorrect &amp;quot;magic quotes&amp;quot; settings. Moodle requires the following settings in the php.ini file (which are usually the default):&lt;br /&gt;
&lt;br /&gt;
 magic_quotes_runtime = Off&lt;br /&gt;
&lt;br /&gt;
Starting in 2.0 it is strongly recommended to disable magic quotes completely&lt;br /&gt;
&lt;br /&gt;
  magic_quotes_gpc = Off&lt;br /&gt;
&lt;br /&gt;
Please see [[Installing Moodle]] for more details.&lt;br /&gt;
&lt;br /&gt;
If you are using [[Debian_GNU/Linux_installation|Debian]] then the problem might be in the version of PHP that you have installed. Have a look at this [http://tracker.moodle.org/browse/MDL-9691 bug report ]  to see if it matches your situation.&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.&lt;br /&gt;
&lt;br /&gt;
Basically, you need to set up a process to regularly call the script &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://yoursite/admin/cron.php&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Try the default settings in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039;. This generally works.&lt;br /&gt;
*Make sure that &#039;&#039;allowuseremailcharset&#039;&#039; in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039; is set to No. Setting this to Yes can cause a problem in some versions of Moodle.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
==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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==I can&#039;t log in - I just stay stuck on the login screen==&lt;br /&gt;
&lt;br /&gt;
The most common cause for this is that your own computer (not your Moodle server) has 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;
&lt;br /&gt;
The server admin can also fix this for everyone by changing the &#039;&#039;secureforms&#039;&#039; variable to &#039;No&#039; in the security section of Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]].&lt;br /&gt;
&lt;br /&gt;
Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script &amp;lt;nowiki&amp;gt;http://yourserver/moodle/lib/session-test.php&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==I keep getting this error: A server error that affects your login session was detected.==&lt;br /&gt;
&lt;br /&gt;
Please refer to the Using Moodle forum discussion [http://moodle.org/mod/forum/discuss.php?d=73716 A server error that affects your login session was detected. Please login again or restart your browser.].&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==I keep getting this 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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
If you are not using Apache 2 and you still have this problem (unlikely) then you can switch Moodle to use an alternative method. The disadvantages are a slight loss of performance for your users and you won&#039;t be able to use relative links within HTML resources.&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
 $CFG-&amp;gt;dirroot = &amp;quot;d:\inetpub\sites\www.yoursite.com\web\moodle&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL. 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 MySQL 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;
 phpinfo();&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if MySQL is supported. If not look for a package you are missing.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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 [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your 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. &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_FAQ#Table_of_Contents|Table of Contents]]&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. This will be an abrupt hang with half the page displayed in the browser and/or other outputs removed. Examples are:&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Truncated mysql statements&#039;&#039;&#039;:&lt;br /&gt;
 &lt;br /&gt;
 (mysql): SET NAMES &#039;utf8&#039;&lt;br /&gt;
 --------------------------------------------------------------------------------&lt;br /&gt;
 (mysql): SHOW LOCAL VARIABLES LIKE &#039;character_set_database&#039;&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 (no more statements are displayed)   &lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Missing Continue button&#039;&#039;&#039;: The “Scroll to continue” link is displayed but no “Continue” button is there. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: There is an exception to this when upgrading an existing database and the installation may appear to hang at the roles generation phase. This process can take a very long time - so please be patient.&lt;br /&gt;
&lt;br /&gt;
Below are some solutions you can try to overcome this problem:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check for mysql limits&#039;&#039;&#039;. This is often a mysql error and not a php error. Check that there is no limit placed on your mysql database, e.g. a &amp;quot;questions&amp;quot; limit.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your .htaccess files&#039;&#039;&#039;. If the install is on a webhost, adding the following line to the .htaccess file in the moodle directory has been known to solve the problem.&lt;br /&gt;
 AddType x-mapp-php5 .php&lt;br /&gt;
&lt;br /&gt;
:Try also renaming the .htaccess file so that it is disabled.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Code customizations&#039;&#039;&#039;. You may also want to look and see if you&#039;ve customized any of your code.  Look at the last successful table, and then look at the block, mod, or other code that is referenced by that table.  For example, if your install hangs and continues to say that the forum tables were successful as the last message, look at /mod/forum/ for any custom code.  If you have customized code, backup those files and replace with the correct files.  You can then restart the install by renaming config.php or reinstalling your database from the backup.  If your install is successful, you can make your code changes back into the stock Moodle code.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your memory limit&#039;&#039;&#039;. It may also be that the &amp;quot;memory_limit&amp;quot; in your php.ini is set too low. Please check your php.ini file and allocate the recommended amount (see [https://docs.moodle.org/en/Installing_Moodle#Requirements Moodle requirements]). For Moodle version 1.8 and above at least 40MB is  recommended.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Upgrade incrementally&#039;&#039;&#039;. To avoid this problem when upgrading, it is recommended to upgrade via each version of Moodle, for example 1.7 -&amp;gt; 1.8 -&amp;gt; 1.9 (with the exception of upgrading from 1.5 or 1.6, when it is recommended that 1.7 is skipped, in other words upgrade 1.5 -&amp;gt; 1.6 -&amp;gt; 1.8 -&amp;gt; 1.9).&lt;br /&gt;
&lt;br /&gt;
A work-around to this problem is to setup a working Moodle system on your local PC or server using the [http://download.moodle.org Moodle Packages]. Once you have a running Moodle, [https://docs.moodle.org/en/Upgrading_Moodle#Backup_important_data backup the database] and import to your webhost. Then backup the Moodle code itself (the &amp;quot;moodle&amp;quot; directory on your PC) and copy this to your webhost using (for example) FTP. Finally, edit the moodle/config.php file for the new settings that have to be changed for the webhost.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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 because GD is not enabled on your server. GD is a library that allows image processing.&lt;br /&gt;
&lt;br /&gt;
1. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going into Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[Variables]] 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;
&lt;br /&gt;
2. 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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
&lt;br /&gt;
==I receive this error &amp;quot;500:Internal Server Error&amp;quot;==&lt;br /&gt;
There are several possible causes for this error:&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;
==I receive this error &amp;quot;403: Forbidden&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
Check your webserver configuration. See also the section above I receive this error &amp;quot;500:Internal Server Error&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
==How do I uninstall Moodle?==&lt;br /&gt;
&#039;&#039;&#039;Moodle package installation&#039;&#039;&#039;: If you have downloaded a Moodle package, simply uninstall using your system commands. On Windows PCs, you should access the Control Panel -&amp;gt; Add/Remove Programs. Select the package name and click Change or Remove Programs.&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==How do I upgrade Moodle? Do I just overwrite the files?==&lt;br /&gt;
Do not overwrite files, it may cause strange errors. You should read the [[Upgrade]] documentation before proceeding.&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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, 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;
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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
The second place to check are the server files.  The php.ini file has a limit which will override any other setting. (Hint: remember to restart your server for changes to take effect).  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;
&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[nl:Installatie FAQ]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[ru:Установка FAQ]]&lt;br /&gt;
[[pl:Instalacja FAQ]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=43056</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=43056"/>
		<updated>2008-09-02T20:54:16Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* I receive this error &amp;quot;500:Internal Server Error&amp;quot; */  correct egregious misstatement about php.ini&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Table of Contents==&lt;br /&gt;
__TOC__&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;?PHP phpinfo() ?&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== System information needed for Installation Forum ==&lt;br /&gt;
When posting questions to the installation forum, try to provide as much background information as possible about your moodle system. Use this template to copy and paste into your post:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* Browser name (version also if possible):&lt;br /&gt;
* Moodle version:&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached?(Y/N):&lt;br /&gt;
* Phpinfo attached? (Y/N):&lt;br /&gt;
&lt;br /&gt;
For the last two items, try to include the following in your post as an attachment:&lt;br /&gt;
* A copy of your phpinfo output as shown in your browser (see the instructions above for an explanation of how to obtain this).&lt;br /&gt;
* A copy of the Moodle configuration file. This is located in the directory moodle and is named config.php&lt;br /&gt;
&lt;br /&gt;
Copy and paste both of these into a single text file (using vi, Notepad, etc) and attach this to your post.&lt;br /&gt;
&lt;br /&gt;
If you cannot provide your phpinfo, try to copy &amp;amp; paste and complete these in your post:&lt;br /&gt;
* Webserver (e.g. Apache/IIS) version:&lt;br /&gt;
* Database server (e.g. MySQL, PostgreSQL) version:&lt;br /&gt;
* PHP version:&lt;br /&gt;
&lt;br /&gt;
For installation on web hosting accounts: contact your support desk who should be able to tell you this information.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Security Warning&#039;&#039;&#039;: Make sure you edit any files and delete any passwords before posting onto the forum.&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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. Please remember that manually editing the file is not recommended and may lead to blank pages, especially if there are additional spaces and/or lines after the final php closing tag &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==Running a health check==&lt;br /&gt;
Moodle contains a script that will help identify common php and webserver configuration problems as well as configuration problems. It is a good idea to run this script to check if you are having post-installation problems. Use your browser to run this file:&lt;br /&gt;
&lt;br /&gt;
 http://www.mymoodle.com/moodle/admin/health.php&lt;br /&gt;
&lt;br /&gt;
Change the above line if you have installed moodle in the webroot instead of a folder inside the webroot.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
* &#039;&#039;&#039;Generic Packages&#039;&#039;&#039;: If your server does not meet the [[Installing_Moodle#Requirements | requirements]] for the current version of Moodle, 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 http://download.moodle.org/stable15. 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, or alternatively use these URLs for zip or tgz downloads:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].tgz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Changes made in the version in the last month are listed in the &amp;quot;CHANGES&amp;quot; file in the directory listing. The files you download contain Moodle code and are not the Windows or Mac packages - so you need to have a webserver, a database server and PHP already installed. The earliest version available is Moodle 1.3.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download previous releases of the 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 previous releases of the Mac pacakges, 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;
* &#039;&#039;&#039;Using CVS&#039;&#039;&#039;: You can also use CVS to download older releases and incremental releases of the Moodle generic packages, e.g. Moodle 1.5.4 - see the [[CVS_for_Administrators | CVS documentation]].&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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. &lt;br /&gt;
* &#039;&#039;&#039;Using the php.ini file&#039;&#039;&#039;: The log settings are contained in the php.ini file stored on the server. If you don&#039;t know where that is, edit your Moodle &#039;&#039;config.php&#039;&#039; and add the following as the second line&lt;br /&gt;
&lt;br /&gt;
  phpinfo();&lt;br /&gt;
&lt;br /&gt;
:then reload the web page. Look for the entry &#039;&#039;&#039;Configuration File (php.ini) Path&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:When you have located php.ini open it in your favorite text editor. Find the &#039;&#039;&#039;Error handling and logging&#039;&#039;&#039; section of the php.ini file. Make sure that both &#039;&#039;&#039;display_errors = On&#039;&#039;&#039;, &#039;&#039;&#039;display_startup_errors = On&#039;&#039;&#039; and &#039;&#039;&#039;log_errors = On&#039;&#039;&#039; are present and uncommented. Check the value of &#039;&#039;&#039;error_log&#039;&#039;&#039; - this tells you the location of the file errors are logged to. If it is commented out then errors will be sent to the web server error log file. Remember, if you make any changes to this file you will need to restart the web server (or just reboot the server).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Using ini_set commands&#039;&#039;&#039;: If you are using Moodle 1.7 or higher, the previous steps are not enough. In those versions error logging parameters are dependant on certain administrative settings that you specify in the debugging section. The problem is that if you can&#039;t access the administrative pages, you can&#039;t set the debugging options. So the only way to modify them is by adding the following lines to your config.php file, just before the last line (the one containing a single&#039;?&amp;gt;&#039; only):&lt;br /&gt;
&lt;br /&gt;
  ini_set (&#039;display_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;log_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;display_startup_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;error_reporting&#039;, E_ALL);&lt;br /&gt;
  $CFG-&amp;gt;debug = DEBUG_ALL;&lt;br /&gt;
&lt;br /&gt;
:This will enable the same settings specified above even if Moodle sets them otherwise. &lt;br /&gt;
:&#039;&#039;&#039;Important&#039;&#039;&#039;: Remember to put them just before the last line of config.php.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
==Any text I add with an apostrophe (&#039;) or a quote (&amp;quot;) causes errors or comes up with a slash added==&lt;br /&gt;
&lt;br /&gt;
Problems caused by apostrophes are caused by incorrect &amp;quot;magic quotes&amp;quot; settings. Moodle requires the following settings in the php.ini file (which are usually the default):&lt;br /&gt;
&lt;br /&gt;
 magic_quotes_runtime = Off&lt;br /&gt;
&lt;br /&gt;
Starting in 2.0 it is strongly recommended to disable magic quotes completely&lt;br /&gt;
&lt;br /&gt;
  magic_quotes_gpc = Off&lt;br /&gt;
&lt;br /&gt;
Please see [[Installing Moodle]] for more details.&lt;br /&gt;
&lt;br /&gt;
If you are using [[Debian_GNU/Linux_installation|Debian]] then the problem might be in the version of PHP that you have installed. Have a look at this [http://tracker.moodle.org/browse/MDL-9691 bug report ]  to see if it matches your situation.&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.&lt;br /&gt;
&lt;br /&gt;
Basically, you need to set up a process to regularly call the script &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://yoursite/admin/cron.php&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Try the default settings in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039;. This generally works.&lt;br /&gt;
*Make sure that &#039;&#039;allowuseremailcharset&#039;&#039; in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039; is set to No. Setting this to Yes can cause a problem in some versions of Moodle.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
==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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==I can&#039;t log in - I just stay stuck on the login screen==&lt;br /&gt;
&lt;br /&gt;
The most common cause for this is that your own computer (not your Moodle server) has 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;
&lt;br /&gt;
The server admin can also fix this for everyone by changing the &#039;&#039;secureforms&#039;&#039; variable to &#039;No&#039; in the security section of Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]].&lt;br /&gt;
&lt;br /&gt;
Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script &amp;lt;nowiki&amp;gt;http://yourserver/moodle/lib/session-test.php&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==I keep getting this error: A server error that affects your login session was detected.==&lt;br /&gt;
&lt;br /&gt;
Please refer to the Using Moodle forum discussion [http://moodle.org/mod/forum/discuss.php?d=73716 A server error that affects your login session was detected. Please login again or restart your browser.].&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==I keep getting this 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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
If you are not using Apache 2 and you still have this problem (unlikely) then you can switch Moodle to use an alternative method. The disadvantages are a slight loss of performance for your users and you won&#039;t be able to use relative links within HTML resources.&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
 $CFG-&amp;gt;dirroot = &amp;quot;d:\inetpub\sites\www.yoursite.com\web\moodle&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL. 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 MySQL 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;
 phpinfo();&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if MySQL is supported. If not look for a package you are missing.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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 [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your 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. &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_FAQ#Table_of_Contents|Table of Contents]]&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. This will be an abrupt hang with half the page displayed in the browser and/or other outputs removed. Examples are:&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Truncated mysql statements&#039;&#039;&#039;:&lt;br /&gt;
 &lt;br /&gt;
 (mysql): SET NAMES &#039;utf8&#039;&lt;br /&gt;
 --------------------------------------------------------------------------------&lt;br /&gt;
 (mysql): SHOW LOCAL VARIABLES LIKE &#039;character_set_database&#039;&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 (no more statements are displayed)   &lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Missing Continue button&#039;&#039;&#039;: The “Scroll to continue” link is displayed but no “Continue” button is there. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: There is an exception to this when upgrading an existing database and the installation may appear to hang at the roles generation phase. This process can take a very long time - so please be patient.&lt;br /&gt;
&lt;br /&gt;
Below are some solutions you can try to overcome this problem:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check for mysql limits&#039;&#039;&#039;. This is often a mysql error and not a php error. Check that there is no limit placed on your mysql database, e.g. a &amp;quot;questions&amp;quot; limit.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your .htaccess files&#039;&#039;&#039;. If the install is on a webhost, adding the following line to the .htaccess file in the moodle directory has been known to solve the problem.&lt;br /&gt;
 AddType x-mapp-php5 .php&lt;br /&gt;
&lt;br /&gt;
:Try also renaming the .htaccess file so that it is disabled.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Code customizations&#039;&#039;&#039;. You may also want to look and see if you&#039;ve customized any of your code.  Look at the last successful table, and then look at the block, mod, or other code that is referenced by that table.  For example, if your install hangs and continues to say that the forum tables were successful as the last message, look at /mod/forum/ for any custom code.  If you have customized code, backup those files and replace with the correct files.  You can then restart the install by renaming config.php or reinstalling your database from the backup.  If your install is successful, you can make your code changes back into the stock Moodle code.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Check your memory limit&#039;&#039;&#039;. It may also be that the &amp;quot;memory_limit&amp;quot; in your php.ini is set too low. Please check your php.ini file and allocate the recommended amount (see [https://docs.moodle.org/en/Installing_Moodle#Requirements Moodle requirements]). For Moodle version 1.8 and above at least 40MB is  recommended.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Upgrade incrementally&#039;&#039;&#039;. To avoid this problem when upgrading, it is recommended to upgrade via each version of Moodle, for example 1.7 -&amp;gt; 1.8 -&amp;gt; 1.9 (with the exception of upgrading from 1.5 or 1.6, when it is recommended that 1.7 is skipped, in other words upgrade 1.5 -&amp;gt; 1.6 -&amp;gt; 1.8 -&amp;gt; 1.9).&lt;br /&gt;
&lt;br /&gt;
A work-around to this problem is to setup a working Moodle system on your local PC or server using the [http://download.moodle.org Moodle Packages]. Once you have a running Moodle, [https://docs.moodle.org/en/Upgrading_Moodle#Backup_important_data backup the database] and import to your webhost. Then backup the Moodle code itself (the &amp;quot;moodle&amp;quot; directory on your PC) and copy this to your webhost using (for example) FTP. Finally, edit the moodle/config.php file for the new settings that have to be changed for the webhost.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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 because GD is not enabled on your server. GD is a library that allows image processing.&lt;br /&gt;
&lt;br /&gt;
1. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going into Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[Variables]] 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;
&lt;br /&gt;
2. 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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
&lt;br /&gt;
==I receive this error &amp;quot;500:Internal Server Error&amp;quot;==&lt;br /&gt;
There are several possible causes for this error:&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 to 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;
==I receive this error &amp;quot;403: Forbidden&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
Check your webserver configuration. See also the section above I receive this error &amp;quot;500:Internal Server Error&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
==How do I uninstall Moodle?==&lt;br /&gt;
&#039;&#039;&#039;Moodle package installation&#039;&#039;&#039;: If you have downloaded a Moodle package, simply uninstall using your system commands. On Windows PCs, you should access the Control Panel -&amp;gt; Add/Remove Programs. Select the package name and click Change or Remove Programs.&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==How do I upgrade Moodle? Do I just overwrite the files?==&lt;br /&gt;
Do not overwrite files, it may cause strange errors. You should read the [[Upgrade]] documentation before proceeding.&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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, 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;
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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
The second place to check are the server files.  The php.ini file has a limit which will override any other setting. (Hint: remember to restart your server for changes to take effect).  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;
&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[nl:Installatie FAQ]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[ru:Установка FAQ]]&lt;br /&gt;
[[pl:Instalacja FAQ]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=42466</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=42466"/>
		<updated>2008-08-22T16:14:41Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: update tutorial availability info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Firstly don&#039;t panic! :-)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install Moodle for the first time. For some of these steps it goes into a lot of detail to try and cover the majority of possible web server setups, so this page may look long and complicated. Don&#039;t panic, once you know how to do it you can install Moodle in minutes!&lt;br /&gt;
&lt;br /&gt;
If you have problems please read this page carefully - most common issues are answered in here. If you still have trouble, you can seek help from the Moodle community via  [http://moodle.org/course/view.php?id=5 moodle.org Using Moodle].&lt;br /&gt;
&lt;br /&gt;
Another option is to contact a [http://moodle.com/hosting/ Moodle Partner providing Moodle hosting] who can completely maintain Moodle for you, so that you can ignore all this and get straight into educating! A Moodle partner is the preferred option but if you decide to choose a hosting company that has cpanel then [http://otaru-jc.ac.jp/hagley/settingupmoodleonhostingwithcpanel.swf this tutorial will guide you]  through the process of choosing a host and setting up moodle via cpanel (had not been available the last few weeks; now tentatively seems to be available again; see [http://englishforum.sgu.ac.jp/moodle/ this portal page]). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; some hosting companies offer one-click moodle install options, which whilst sometimes effective, usually use old (sometimes years old) versions of moodle and sometimes simply don&#039;t work. If one of these goes wrong, your best bet is often to start from scratch following the instructions here yourself. Its almost certainly quicker.&lt;br /&gt;
&lt;br /&gt;
If you want to run Moodle on your own computer and this page looks a bit daunting, then please see our guides on how to install one of Moodle&#039;s complete [[Complete install packages for Windows|Windows packages]], [[Complete Install Packages for Mac OS X|Mac OS packages]] or [[Installing AMP |Installing Apache, MySQL and PHP(AMP)]]. They provide alternative instructions to install all this on most popular platforms.&lt;br /&gt;
&lt;br /&gt;
==Table of Contents==&lt;br /&gt;
__TOC__&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), but is also regularly tested with Windows XP/2000/2003 (WAMP), Solaris 10 (Sparc and x64), Mac OS X and Netware 6 operating systems. Support for PostgreSQL, Oracle and Microsoft SQL Server is also available.&lt;br /&gt;
&lt;br /&gt;
The procedure for installing Moodle on the Windows platform (e.g. Windows Server, IIS and MSSQL) varies slightly to the procedure for the LAMP platform. See [[Installation for Windows 2003 with IIS]] for more details.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Blank page problem while installing Moodle on Windows Vista may occur; following these steps: [[Installing Moodle on Windows Vista]] might help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Most web hosts support all of these requirements by default. You should contact your web host&#039;s support desk to check that this is the case &#039;&#039;&#039;before&#039;&#039;&#039; signing-up with them. It is especially important to ask about any PHP memory limits or MySQL question limits. If your prospective host does not provide a service which meets these requirements, or you are already signed up with them, ask them why and consider taking your business elsewhere if they do not change.&lt;br /&gt;
&lt;br /&gt;
The requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Hardware&#039;&#039;&#039; (unless you are using a hosted server). &lt;br /&gt;
* Disk space: 160MB free (min). You will require more free space to store your teaching materials.&lt;br /&gt;
* Memory: 256MB (min), 1GB (recommended). The general rule of thumb is that Moodle can support 50 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination. &lt;br /&gt;
&#039;&#039;&#039;Software&#039;&#039;&#039;&lt;br /&gt;
* Web server software. Most people use [[Apache]], but Moodle should work fine under any web server that supports [[PHP]], such as [[IIS]] on Windows platforms. PHP does impose requirements on versions of web servers, however these are complex and the general advice is to use the newest version possible of your chosen web server. &lt;br /&gt;
* PHP scripting language. (Please note that there have been issues installing Moodle with [http://www.php-accelerator.co.uk PHP-Accelerator]). There are currently two versions (or branches) of PHP available: PHP4 and PHP5 and the version requirements are listed below.&lt;br /&gt;
** For Moodle version 1.4 or later: PHP4 (version 4.1.0 or later) or PHP5 (version 5.1.0 or later) are supported.&lt;br /&gt;
** For Moodle version 1.6 or later: the PHP4 (version 4.3.0 or later) or PHP5 (version 5.1.0 or later) are supported. &lt;br /&gt;
** Future Moodle versions 2.0 or later will not support PHP4 and will require PHP5 (version 5.2.0 or later).&lt;br /&gt;
** PHP Settings. 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. &lt;br /&gt;
*** &#039;&#039;safe_mode&#039;&#039; needs to be OFF.&lt;br /&gt;
*** &#039;&#039;memory_limit&#039;&#039; should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.&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 ON. (It will be recommended to turn it off in 2.0.)&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.&lt;br /&gt;
** PHP Extensions and libraries&lt;br /&gt;
*** The mbstring extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** The iconv extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** [http://www.libgd.org/ GD library] and the [http://www.freetype.org/ FreeType 2] library and extensions are needed to be able to look at the dynamic graphs that the logs pages make.&lt;br /&gt;
*** The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.&lt;br /&gt;
*** The pgsql extension is required if you are using the PostgreSQL database.&lt;br /&gt;
*** The pdo and pdo_sqlite extensions are required for the (experimental) SQLite 3 database support.&lt;br /&gt;
*** The curl extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The tokenizer extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).&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;
* A working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is &#039;&#039;the&#039;&#039; choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment.&lt;br /&gt;
** For Moodle 1.5, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later). &lt;br /&gt;
** For Moodle 1.6, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).&lt;br /&gt;
** For Moodle 1.7, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
** For Moodle 1.8 or later, MySQL (version 4.1.12 or later), PostgreSQL (8.0 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
: MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting &amp;quot;strict mode&amp;quot; must be OFF (set to &amp;quot;&amp;quot; or &amp;quot;MYSQL40&amp;quot;) in the MySQL configuration file. &lt;br /&gt;
: PostgreSQL Notes: PostgreSQL 7.4 is recommended for earlier Moodle versions, since Moodle 1.8 only PostgreSQL 8.0 and above are supported.&lt;br /&gt;
* For showcases or low to medium-sized installations, Moodle 2.0 also includes (experimental) support for SQLite 3 database. This setup requires no database server, as the database file is stored in a local directory on the server.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== How many users? ==&lt;br /&gt;
&lt;br /&gt;
In addition to the hardware and software requirements, you will also need to think about the capacity of your Moodle installation in terms of the number of users it can handle. There are two numbers to plan for:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Browsing users&#039;&#039;&#039;: the maximum number of users able to browse your Moodle site. This is the number of computers in your organization or on your course (whichever is greater).&lt;br /&gt;
* &#039;&#039;&#039;Concurrent database users&#039;&#039;&#039;: the maximum number of concurrent database users (needed for Moodle activities such as quizzes). This is the number of users who will be using Moodle at the same time. In an educational institution, use your timetable/roster to obtain this figure.&lt;br /&gt;
&lt;br /&gt;
Once you know these figures for your users, you can start work out if your Moodle installation can support this capacity. The exact number of users depends on your hardware/software/network combination. Usually the amount of memory installed (RAM) is the deciding factor but a faster overall processor speed will also help in reducing waiting times for pages to load. &lt;br /&gt;
&lt;br /&gt;
The general rule of thumb for a single server is that the approx max concurrent users = RAM (GB) * 50 and the approx max browsing users = Approx max concurrent users * 5. As an example, a university with 500 total computers on campus and 100 concurrent users at any time will need approx 2GB of RAM on the one server to support the number of concurrent users.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Ask your provider what limits are placed on the number of concurrent database connections and the processor load. This will give a good estimate of the number of users your Moodle install can manage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; As of August 31, 2007, Moodle 1.8.2+ is not recommended for large installations, especially if you have large number (e.g. 20,000+) of courses. The main reason is the codes related to ROLES are still not fully optimized with database queries and still need some work. If you are planning to use 1.8.x codes for a larger institution, please make sure that you have sufficient time to do your own testing and performance profiling.  Upgrade to Moodle 1.9!!&lt;br /&gt;
&lt;br /&gt;
[Update] This performance issue has been improved quite a bit in the most recent 1.8.3+ version (see this thread discussion: http://moodle.org/mod/forum/discuss.php?d=83281).  Moodle 1.9 has even more improvements in all areas and is the recommended version.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to get Moodle, either as a compressed package or via CVS. &lt;br /&gt;
* There are two types of compressed packages on the  [http://download.moodle.org/ download page: http://download.moodle.org/], the standard distribution with Moodle only files and the [[Complete install packages|complete install]], which contains programs to operate Moodle in a web environment.  &lt;br /&gt;
* To use CVS, helpful instructions are available at the [[CVS_for_Administrators | CVS for Administrators]] page. The full [http://cvs.moodle.org/moodle/ Moodle CVS repository] is also available for browsing. &lt;br /&gt;
&lt;br /&gt;
After downloading, unpack the archive using either &lt;br /&gt;
 tar -zxvf [filename]&lt;br /&gt;
or&lt;br /&gt;
 unzip [filename]&lt;br /&gt;
as appropriate. &lt;br /&gt;
&lt;br /&gt;
If using CVS, run the CVS Checkout command.&lt;br /&gt;
&lt;br /&gt;
You will now be left with a directory called &amp;quot;moodle&amp;quot;, 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;.&lt;br /&gt;
&lt;br /&gt;
If you are downloading Moodle to your local computer and then uploading it to your web site, it is usually better to upload the whole archive as one file, and then do the unpacking on the server. Even web hosting interfaces like cPanel allow you to uncompress archives in the &amp;quot;File Manager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Structure of moodle directory ===&lt;br /&gt;
&lt;br /&gt;
You can safely skip this section, but here is a quick summary of the contents of the Moodle folder, to help get you oriented:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;config.php&#039;&#039; - contains basic settings. This file does not come with Moodle - you will create it.&lt;br /&gt;
:&#039;&#039;install.php&#039;&#039; - the script you will run to create config.php&lt;br /&gt;
:&#039;&#039;version.php&#039;&#039; - defines the current version of Moodle code&lt;br /&gt;
:&#039;&#039;index.php&#039;&#039; - the front page of the site&lt;br /&gt;
:&#039;&#039;admin/&#039;&#039; - code to administrate the whole server&lt;br /&gt;
:&#039;&#039;auth/&#039;&#039; - plugin modules to authenticate users&lt;br /&gt;
:&#039;&#039;blocks/&#039;&#039; - plugin modules for the little side blocks on many pages&lt;br /&gt;
:&#039;&#039;calendar/&#039;&#039; - all the code for managing and displaying calendars&lt;br /&gt;
:&#039;&#039;course/&#039;&#039; - code to display and manage courses&lt;br /&gt;
:&#039;&#039;doc/&#039;&#039; - help documentation for Moodle (eg this page)&lt;br /&gt;
:&#039;&#039;files/&#039;&#039; - code to display and manage uploaded files&lt;br /&gt;
:&#039;&#039;lang/&#039;&#039; - texts in different languages, one directory per language&lt;br /&gt;
:&#039;&#039;lib/&#039;&#039; - libraries of core Moodle code&lt;br /&gt;
:&#039;&#039;login/&#039;&#039; - code to handle login and account creation&lt;br /&gt;
:&#039;&#039;mod/&#039;&#039; - all the main Moodle course modules are in here&lt;br /&gt;
:&#039;&#039;pix/&#039;&#039; - generic site graphics&lt;br /&gt;
:&#039;&#039;theme/&#039;&#039; - theme packs/skins to change the look of the site.&lt;br /&gt;
:&#039;&#039;user/&#039;&#039; - code to display and manage users&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Setting-up your system==&lt;br /&gt;
To ensure that Moodle will install successfully, you need to check that the web server settings are correct, then create a blank database for Moodle to use and finally create a directory on your hard disk for Moodle to save your materials and other files you upload into your courses.&lt;br /&gt;
&lt;br /&gt;
=== Check web server settings ===&lt;br /&gt;
&lt;br /&gt;
*Firstly, make sure that your web server is set up to use index.php as a default page (perhaps in addition to index.html, default.htm and so on). In Apache, this is done using a DirectoryIndex parameter in your httpd.conf file. Mine usually looks like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
:Just make sure index.php is in the list (and preferably towards the start of the list, for efficiency).&lt;br /&gt;
&lt;br /&gt;
*Secondly, &#039;&#039;&#039;if you are using Apache 2&#039;&#039;&#039;, then you should turn on the &#039;&#039;AcceptPathInfo&#039;&#039; variable, which allows scripts to be passed arguments like &amp;lt;nowiki&amp;gt;http://server/file.php/arg1/arg2&amp;lt;/nowiki&amp;gt;. This is essential to allow relative links between your resources, and also provides a performance boost for people using your Moodle web site. You can turn this on by adding these lines to your httpd.conf file. (NB: This setting, or any equivalent, is not required in Apache 1)&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
=== Recheck PHP settings ===&lt;br /&gt;
Moodle requires a number of PHP settings to be active for it to work. These were given in the Requirements section and &#039;&#039;&#039;On most servers these will already be the default settings&#039;&#039;&#039;.  However, some PHP servers (and some of the more recent PHP versions) may have things set differently, so it is useful to double-check that the settings are correct. These are defined in PHP&#039;s configuration file (usually called &#039;&#039;&#039;php.ini&#039;&#039;&#039;) or in the Apache &#039;&#039;&#039;.htaccess&#039;&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
 safe_mode = 0 (necessary)&lt;br /&gt;
 memory_limit = 40M (varies: minimum 16M, 32M Moodle v1.7, 40M Moodle v1.8, 128M large sites)&lt;br /&gt;
 session.save_handler = files (unless you are using another handler, e.g. mm)   &lt;br /&gt;
 magic_quotes_gpc = 1    (preferred but not necessary, 0 will be recommended in 2.0)&lt;br /&gt;
 magic_quotes_runtime = 0    (necessary)&lt;br /&gt;
 file_uploads = 1&lt;br /&gt;
 session.auto_start = 0&lt;br /&gt;
 session.bug_compat_warn = 0&lt;br /&gt;
&lt;br /&gt;
You may also want to set other, optional php.ini file settings while you are already editing it. For instance, you may want to reset the maximum upload size of file attachments, which usually defaults to 2M(egabytes). For instance, to set these to 16 Megabytes:&lt;br /&gt;
 &lt;br /&gt;
 post_max_size = 16M&lt;br /&gt;
 upload_max_filesize = 16M&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Using a .htaccess file for webserver and PHP settings ===&lt;br /&gt;
&lt;br /&gt;
Use the above if you can directly edit your server&#039;s files, but if you are setting-up Moodle on a webhost, or don&#039;t have access to &#039;&#039;&#039;httpd.conf&#039;&#039;&#039; or &#039;&#039;&#039;php.ini&#039;&#039;&#039; on your server, or you have Moodle on a server with other applications that require different settings, then don&#039;t worry, you can often still override the default settings. This only works on Apache servers and only when Overrides have been allowed in the main Apache configuration. Moodle is supplied with a htaccess file which you can use, or you can create your own file manually.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Use the default htaccess file&#039;&#039;&#039;. The easiest thing to do is just copy the sample file from moodle/lib/htaccess and edit it to suit your needs. It contains further instructions. For example, in a Unix shell:&lt;br /&gt;
&lt;br /&gt;
 cd moodle&lt;br /&gt;
 cp moodle/lib/htaccess .htaccess&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Create your own file&#039;&#039;&#039;. Alternatively you can create your own file called &#039;&#039;&#039;.htaccess&#039;&#039;&#039; in Moodle&#039;s main directory that contains lines like the following. &lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
 php_value memory_limit 40M (adjust to your version of Moodle)&lt;br /&gt;
 php_flag magic_quotes_gpc 1&lt;br /&gt;
 php_flag magic_quotes_runtime 0&lt;br /&gt;
 php_flag file_uploads 1&lt;br /&gt;
 php_flag session.auto_start 0&lt;br /&gt;
 php_flag session.bug_compat_warn 0&lt;br /&gt;
&lt;br /&gt;
:If you have Apache version 2 installed, add these lines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IfDefine APACHE2&amp;gt;&lt;br /&gt;
     AcceptPathInfo on&lt;br /&gt;
 &amp;lt;/IfDefine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Otherwise add this single line:&lt;br /&gt;
&lt;br /&gt;
 AcceptPathInfo on&lt;br /&gt;
&lt;br /&gt;
:Optionally, you can also do things like define the maximum size for uploaded files, etc by adding these lines:&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 0&lt;br /&gt;
 php_value upload_max_filesize 2M&lt;br /&gt;
 php_value post_max_size 2M&lt;br /&gt;
&lt;br /&gt;
:The value given in these lines is 2M. You may want to change this at a later date to allow uploading of larger files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
Several hosting services that uses Apache 2 and php 5.x does not allow php flags and values to be set from within .htaccess file. It may be necessary to place a php.ini file within each sub-directory of the site :-( .&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Make one php.ini file in the main moodle directory tree and later copy it to all sub-directories. the syntax is a little bit different than the one used in .htaccess. (see sample after section 2)&lt;br /&gt;
# Run the script http://tips-scripts.com/php_ini_copy or copy php.ini manually to all sub-directories.&lt;br /&gt;
:php.ini (sample):&lt;br /&gt;
 upload_max_filesize = 2M&lt;br /&gt;
 post_max_size = 2M&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Some shared hosts use suPHP, which requires a slightly different configuration&#039;&#039;&#039;. If everything else fails, try creating the following two files and uploading to your moodle root directory&lt;br /&gt;
:php.ini (sample):&lt;br /&gt;
 register_globals = 0&lt;br /&gt;
 display_errors = 0&lt;br /&gt;
&lt;br /&gt;
:.htaccess (sample):&lt;br /&gt;
 suPHP_ConfigPath /home/cPanelName/public_html/moodle&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change the above path to the actual path to your moodle install&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Before you go into this adventure make sure you really need those php instructions in your site.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note&#039;&#039;&#039;: Use a .htaccess file only [http://httpd.apache.org/docs/1.3/howto/htaccess.html#when as a last resort] as it can have an impact on the performance of your Moodle site and cause pages to load slowly on your browser.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating an empty database ===&lt;br /&gt;
&lt;br /&gt;
You need to create an empty database (eg &amp;quot;&#039;&#039;moodle&#039;&#039;&amp;quot;) in your database system along with a special user (eg &amp;quot;moodleuser&amp;quot;) that has access to that database (and that database only). You could use the &amp;quot;root&amp;quot; user if you wanted to for a test server, but this is not recommended for a production system: if hackers manage to discover the password then your whole database system would be at risk, rather than just one database.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Warning&#039;&#039;&#039;: Bear in mind that, as of Moodle version 1.5.x, Moodle doesn&#039;t work with MySQL 5.x&#039;s strict mode setting (STRICT_TRANS_TABLES and/or STRICT_ALL_TABLES) -- see [http://moodle.org/mod/forum/discuss.php?d=58552 forum discussion]. So if you are using MySQL 5.x, edit MySQL&#039;s configuration file (called &amp;quot;my.ini&amp;quot; in Windows and &amp;quot;my.cnf&amp;quot; on Unix/Linux) and comment out that option or set it to &amp;lt;code&amp;gt;sql-mode=&#039;&#039;&amp;lt;/code&amp;gt;. You have to restart MySQL after changing this setting. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; If you do not have access to your server, use PHPMyAdmin (or another MySQL client) and enter the command &amp;lt;code&amp;gt;SET @@global.sql_mode=&#039;&#039;;&amp;lt;/code&amp;gt; (be sure to use single quotes, and don&#039;t forget the semicolon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
====Using a hosted server====&lt;br /&gt;
If you are using a webhost, they will probably have a control panel web interface for you to create your database.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;[http://www.cpanel.com/ cPanel]&#039;&#039;&#039; system is one of the most popular of these. &lt;br /&gt;
To create a database using cPanel:&lt;br /&gt;
&lt;br /&gt;
# Click on the &#039;&#039;&#039;MySQL Databases&#039;&#039;&#039; icon.&lt;br /&gt;
# Type &#039;&#039;&#039;moodle&#039;&#039;&#039; in the New Database field and click &#039;&#039;&#039;Create Database&#039;&#039;&#039;.&lt;br /&gt;
# Type a &#039;&#039;username&#039;&#039; and &#039;&#039;password&#039;&#039; (not one you use elsewhere) in the respective fields and click &#039;&#039;&#039;Create  User&#039;&#039;&#039;.&amp;lt;br&amp;gt;Note that the &#039;&#039;username&#039;&#039; and &#039;&#039;database&#039;&#039; names may be prefixed by your cPanel account name and an underscore, and truncated to 16 characters. When entering this information into the Moodle installer - use the full names.&lt;br /&gt;
# Now use the &#039;&#039;&#039;Add Users to Databases&#039;&#039;&#039; button and give this new user account &#039;&#039;&#039;ALL&#039;&#039;&#039; rights to the new database.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#CreatDataDir |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
====Using a SQLite database====&lt;br /&gt;
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.&lt;br /&gt;
&lt;br /&gt;
Moodle 2.0 offers support for SQLite3 database installations. In this case, no database setup is required. The database file will be created by the installation script. By default, the database file will be store in Moodle&#039;s data directory (see [[Installing_Moodle#CreatDataDir |Creating the data directory]]). During install, the web server must have write access on the directory where the database file will be stored. After installation, the web server must have read-write access to the database file.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#CreatDataDir |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Using the command line====&lt;br /&gt;
&lt;br /&gt;
If you have access to Unix or Windows command lines then you can do the same sort of thing by typing commands. You should do this using the MySQL Client program as follows (commands which you type-in are shown in bold):&lt;br /&gt;
&lt;br /&gt;
- Start the MySQL Client program:&lt;br /&gt;
 #&#039;&#039;&#039;mysql -u root -p&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;
 Your MySQL connection id is 2 to server version: 5.0.22-log&lt;br /&gt;
 &lt;br /&gt;
 Type &#039;help;&#039; or &#039;\h&#039; for help. Type &#039;\c&#039; to clear the buffer.&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The prompt changes to &amp;quot;mysql&amp;gt;&amp;quot; to indicate that you are now working in the MySQL Client program. When working in MySQL, all commands which you type-in must end in a semi-colon. (If you hit the Enter key without the final semi-colon, you&#039;ll get the line continuation symbol &#039;-&amp;gt;&#039;; this is your second chance to type the semi-colon and hit Enter.) &lt;br /&gt;
&lt;br /&gt;
- Begin by checking for any existing databases called &amp;quot;moodle&amp;quot; - if there are any you should change the name in all the commands which follow:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;SHOW DATABASES;&#039;&#039;&#039;&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | Database                |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | information_schema      |&lt;br /&gt;
 | mysql                   |&lt;br /&gt;
 | test                    |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 3 rows in set (0.03 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a database to store the Moodle tables. We&#039;ll call this &amp;quot;moodle&amp;quot;, as there are none with that name already in the above list, but change it if you need to.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;CREATE DATABASE moodle;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Change the default character set and collation of the &amp;quot;moodle&amp;quot; database to UTF8. Leave this out if you are installing Moodle 1.5 or earlier):&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a username and password to access the database &amp;quot;moodle&amp;quot; and grant database access permissions. We&#039;ll call the user &amp;quot;moodleuser&amp;quot; and set the password as &amp;quot;yourpassword&amp;quot;. It&#039;s a good idea to change these for your installation however most people keep the username as &amp;quot;moodleuser&amp;quot;. Remember the username and password you have set, as you&#039;ll need it in the configuration screens later. This is a long command so has been split over several lines by pressing the Return key.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;DROP,INDEX,ALTER ON moodle.*&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 0 rows affected (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Security Warnings&#039;&#039;&#039;: Never leave the password as the one shown here. Make sure you have a strong password (a mixture of letters and numbers, upper and lower case). Avoid granting &amp;quot;ALL&amp;quot; permissions on the database.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: For MySQL 4.0.1 or earlier, you don&#039;t need the CREATE TEMPORARY TABLES permission. &lt;br /&gt;
&lt;br /&gt;
- Exit the MySQL Client program:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;QUIT&#039;&#039;&#039;&lt;br /&gt;
 Bye&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
- Reload the grant tables using the mysqladmin program:&lt;br /&gt;
 #&#039;&#039;&#039;mysqladmin -u root -p reload&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
And some example command lines for PostgreSQL:&lt;br /&gt;
&lt;br /&gt;
   # su - postgres&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create user moodleuser createdb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create database moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;with encoding &#039;unicode&#039;&amp;lt;/font&amp;gt;;&amp;quot; -U moodleuser template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser nocreatedb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser with encrypted password &#039;yourpassword&#039;;&amp;quot; template1&lt;br /&gt;
   &amp;gt; su - root&lt;br /&gt;
   # /etc/init.d/postgresql reload&lt;br /&gt;
&lt;br /&gt;
If the Postgres create database command above (&amp;gt;psql -c &amp;quot;create database moodle...&amp;quot;) gives an error message you may want to try:&lt;br /&gt;
 psql -c &amp;quot;create database moodle with template=template1 encoding = &#039;unicode&#039; owner =  moodleuser &amp;lt;br&amp;gt;     location = &#039;/var/mydata&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the create database command asks you for a password, run the line containing &#039;encrypted password&#039; first before proceeding.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
* Step-by-step instructions on  [https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Ubuntu installation for Ubuntu(Debian)]&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating the data directory  ===&lt;br /&gt;
&lt;br /&gt;
Moodle will also need some space on your server&#039;s hard disk to store uploaded files, such as course documents and user pictures. The Moodle installer tries hard to create the &#039;&#039;&#039;moodledata&#039;&#039;&#039; directory for you but if it fails then you will have to create a directory for this purpose manually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Security warning&#039;&#039;&#039;: For security purposes, it is &#039;&#039;&#039;CRITICAL&#039;&#039;&#039; that this directory is &#039;&#039;&#039;NOT&#039;&#039;&#039; accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web site root directory (it is the folder that the main part of your URL -that is, the part up to the first single / - points to; for example, in &amp;lt;nowiki&amp;gt;http://your.domain.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;, it is &amp;lt;nowiki&amp;gt;http://your.domain.com/&amp;lt;/nowiki&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
But if you must have it in the web directory (and you are using Apache AND the web server configuration allows .htaccess files to restrict access to directories) then protect it by creating a file in the data directory called &#039;&#039;&#039;.htaccess&#039;&#039;&#039;, containing these lines:&lt;br /&gt;
&lt;br /&gt;
 order deny,allow&lt;br /&gt;
 deny from all&lt;br /&gt;
&lt;br /&gt;
If you are using IIS, you need to edit the properties of the data directory (from the Internet Information Services Manager console) and deny access to that folder to everybody from the web.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;If you don&#039;t protect the data directory from direct web access, anybody will be able to impersonate any user of your Moodle site (including the admin user!!!), and all of your course materials will be available to the web at large.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ownership &amp;amp; Permissions&#039;&#039;&#039;: To make sure that Moodle can save uploaded files in this directory, check that the web server software has permission to read, write and execute in this directory. On Unix machines, this means setting the owner of the directory to be something like &amp;quot;nobody&amp;quot; or &amp;quot;apache&amp;quot;, and then giving that user read, write and execute permissions. As an example, to change the owner to &amp;quot;nobody&amp;quot; you could use:&lt;br /&gt;
&lt;br /&gt;
 chown -R nobody:apache moodledata&lt;br /&gt;
&lt;br /&gt;
To change the permissions so that the owner has read,write and execute permissions, use something like this:&lt;br /&gt;
&lt;br /&gt;
 chmod -R 0770 moodledata&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are receiving permission denied messages, try &#039;&#039;chmod -R 0770 moodledata&#039;&#039; and then adjust the settings so that they are more secure. A more secure setting is &#039;&#039;chmod -R 0750 moodledata&#039;&#039;. According to the comments in config-dist.php, &amp;quot;On hosting systems you might need to make sure that your group has no permissions at all while others have full permissions.&amp;quot; To do this you could use &#039;&#039;chmod -R 707 moodledata&#039;&#039;. See also the [[Security | security page]].&lt;br /&gt;
&lt;br /&gt;
Remember that by default moodle will issue a warning about moodle data directories created inside the web directory, but otherwise this directory can be located where you wish. You can later move or change the location of this directory, but if you do, be sure to edit the setting in the &#039;&#039;&#039;config.php&#039;&#039;&#039; file that sets this; e.g. if moodledata is under a directory called data, then it would look like this:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dataroot  = &#039;/data/moodledata&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CPanel and webhosts&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On cPanel systems you can use the &amp;quot;File Manager&amp;quot; to find the folder, click on it, then choose &amp;quot;Change Permissions&amp;quot;. On many shared hosting servers, you will probably need to restrict all file access to your &amp;quot;group&amp;quot; (to prevent other webhost customers from looking at or changing your files), but provide full read/write access to everyone else (which will allow the web server to access your files). Speak to your server administrator if you are having trouble setting this up securely. In particular it will not be possible to create a usable data directory on sites that use a PHP feature known as &amp;quot;&#039;&#039;&#039;Safe Mode&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Run the installer script to create config.php ==&lt;br /&gt;
&lt;br /&gt;
To run the installer script (install.php), just try to access your Moodle main URL using a web browser, or access &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourserver/install.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; directly.&lt;br /&gt;
&lt;br /&gt;
(The Installer will try to set a session cookie. If you get a popup warning in your browser make sure you accept that cookie!)&lt;br /&gt;
&lt;br /&gt;
Moodle will detect that configuration is necessary and will lead you through some screens to help you create a new configuration file called &#039;&#039;&#039;config.php&#039;&#039;&#039;. At the end of the process Moodle will try and write the file into the right location, otherwise you can press a button to download it from the installer and then upload &#039;&#039;&#039;config.php&#039;&#039;&#039; into the main Moodle directory on the server.&lt;br /&gt;
&lt;br /&gt;
Along the way the installer will test your server environment and give you suggestions about how to fix any problems. For most common issues these suggestions should be sufficient, but if you get stuck, check in the Installation Forum for more help.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Go to the admin page to continue configuration ==&lt;br /&gt;
&lt;br /&gt;
Once the basic config.php has been correctly created in the previous step, trying to access the front page of your site will take you to the &amp;quot;admin&amp;quot; page for the rest of the configuration.&lt;br /&gt;
&lt;br /&gt;
The first time you access this admin page, you will be presented with a GPL &amp;quot;shrink wrap&amp;quot; agreement with which you must agree before you can continue with the setup.&lt;br /&gt;
&lt;br /&gt;
Now Moodle will start setting up your database and creating tables to store data. Firstly, the main database tables are created. You should see a number of SQL statements followed by status messages that look like this:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE course (&lt;br /&gt;
    id int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
    category int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    password varchar(50) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    fullname varchar(254) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    shortname varchar(15) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    summary text NOT NULL,&lt;br /&gt;
    format tinyint(4) NOT NULL default &#039;1&#039;,&lt;br /&gt;
    teacher varchar(100) NOT NULL default &#039;Teacher&#039;,&lt;br /&gt;
    startdate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    enddate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    timemodified int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    PRIMARY KEY (id)&lt;br /&gt;
 ) TYPE=MyISAM;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;SUCCESS&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and so on, followed by: &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Main databases set up successfully.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see these, then there must have been some problem with the database or the configuration settings you defined in config.php. Check that PHP isn&#039;t in a restricted &amp;quot;Safe Mode&amp;quot; (commercial web hosts sometimes have safe mode turned on). You can check PHP variables by creating a little file containing &#039;&#039;&#039;&amp;lt;?php phpinfo() ?&amp;gt;&#039;&#039;&#039; and looking at it through a browser. Check all these and try this page again.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
You should now see a form where you can define more configuration variables for your installation, such as the default language, SMTP hosts and so on. Don&#039;t worry too much about getting everything right just now - you can always come back and edit these later on using the admin interface. The defaults are designed to be useful and secure for most sites. Scroll down to the bottom and click &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If (and only if) you find yourself getting stuck on this page, unable to continue, then your server probably has what I call the &amp;quot;buggy referrer&amp;quot; problem. This is easy to fix: just turn off the &amp;quot;secureforms&amp;quot; setting, then try to continue again.&lt;br /&gt;
&lt;br /&gt;
Next you will see more pages that print lots of status messages as they set up all the tables required by the various Moodle module. As before, they should all be &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;green&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
The next page is a form where you can define parameters for your Moodle site and the front page, such as the name, format, description and so on. Fill this out (you can always come back and change these later) and then press &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finally, you will then be asked to create a top-level administration user for future access to the admin pages. Fill out the details with your own name, email etc and then click &amp;quot;Save changes&amp;quot;. Not all the fields are required, but if you miss any important fields you&#039;ll be re-prompted for them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure you remember the username and password you chose for the administration user account, as they will be necessary to access the administration page in future.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(If for any reason your install is interrupted, or there is a system error of some kind that prevents you from logging in using the admin account, you can usually log in using the default username of &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;, with password &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Once successful, you will be returned to the home page of your new site! Note the administration links that appear down the left hand side of the page (these items also appear on a separate Admin page) - these items are only visible to you because you are logged in as the admin user. All your further administration of Moodle can now be done using this menu, such as:&lt;br /&gt;
&lt;br /&gt;
* creating and deleting courses&lt;br /&gt;
* creating and editing user accounts&lt;br /&gt;
* administering teacher accounts&lt;br /&gt;
* changing site-wide settings like themes etc&lt;br /&gt;
&lt;br /&gt;
But you are not done installing yet! There is one very important thing still to do (see the next section on cron).&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Installing Moodle Using Command Line ==&lt;br /&gt;
&lt;br /&gt;
Installing Moodle Using command line is just as easy as installing Moodle using web browser. &lt;br /&gt;
* First Go to the moodle root directory and then to admin directory inside the moodle root. &lt;br /&gt;
&lt;br /&gt;
 $cd /var/www/html/moodle/admin&lt;br /&gt;
&lt;br /&gt;
* Then simply use the following syntax to run the moodle command line installer&lt;br /&gt;
 $php cliupgrade.php --lang=en --webaddr=http://www.example.com --moodledir=/var/www/html/moodle --datadir=/var/moodledata --dbtype=mysql --dbhost=localhost --dbname=moodle --dbuser=root --prefix=mdl --verbose=1 --interactivelevel=2 &lt;br /&gt;
&lt;br /&gt;
More information about the options can be found using &lt;br /&gt;
$php cliupgrad.php --help&lt;br /&gt;
&lt;br /&gt;
Then you will see the following list of available options&lt;br /&gt;
&lt;br /&gt;
 --lang		 		Valid installed language for installation. Default is English(en)&lt;br /&gt;
 --webaddr			Web address for the Moodle site&lt;br /&gt;
 --moodledir			Location of the moodle web folder&lt;br /&gt;
 --datadir			Location of the moodle data folder (should not be web visible)&lt;br /&gt;
 --dbtype			Database type. Default it mysql&lt;br /&gt;
 --dbhost			Database host. Default localhost&lt;br /&gt;
 --dbname			Database name. Default is moodle&lt;br /&gt;
 --dbuser			Database user. Default is blank&lt;br /&gt;
 --dbpass			Database password. Default is blank&lt;br /&gt;
 --prefix			        Table prefix for above database tables. Default is mdl&lt;br /&gt;
 --verbose			0 No output, 1 Summarized output(Default), 2 Detailed output&lt;br /&gt;
 --interactivelevel	        0 Non interactive, 1 Semi interactive(Default), 2 Interactive&lt;br /&gt;
 --help				print out this help&lt;br /&gt;
&lt;br /&gt;
When you choose non interactive mode without any options all the default values are assumed.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Set up cron ==&lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
== Set up backups ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Backup settings| backup instructions]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Create a new course ==&lt;br /&gt;
&lt;br /&gt;
Now that Moodle is running properly, you can try creating a new course to play with.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Create a new course&amp;quot; from the Admin page (or the admin links on the home page).&lt;br /&gt;
&lt;br /&gt;
Fill out the form, paying special attention to the course format. You don&#039;t have to worry about the details too much at this stage, as everything can be changed later by the teacher. Note that the yellow help icons are everywhere to provide contextual help on any aspect.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;Save changes&amp;quot;, and you will be taken to a new form where you can assign teachers to the course. You can only add existing user accounts from this form - if you want to create a new teacher account then either ask the teacher to create one for themselves (see the login page), or create one for them using the &amp;quot;Add a new user&amp;quot; on the Admin page.&lt;br /&gt;
&lt;br /&gt;
Once done, the course is ready to customize, and is accessible via the &amp;quot;Courses&amp;quot; link on the home page.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
* [[Complete install packages]] might be an easier first time installs on some systems&lt;br /&gt;
* Help forum:  [http://moodle.org/mod/forum/view.php?id=28 Installation problems]&lt;br /&gt;
* [[Installing Apache, MySQL and PHP]] - Open source programs that can run Moodle on the web or on a desktop&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=42688 Selecting a web host for Moodle] forum discussion&lt;br /&gt;
* [[masquerading|Masquerading]] - Running Moodle behind a masquerading/NAT firewall&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[cs:Instalace]]&lt;br /&gt;
[[de:Installieren von Moodle]]&lt;br /&gt;
[[es:Instalación de moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;br /&gt;
[[nl:Installatiegids]]&lt;br /&gt;
[[pl:Instalacja Moodle]]&lt;br /&gt;
[[pt:Instalação do Moodle]]&lt;br /&gt;
[[ru:Установка Moodle]]&lt;br /&gt;
[[sk:Inštalácia]]&lt;br /&gt;
[[zh:安装Moodlezh:]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=41770</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=41770"/>
		<updated>2008-08-09T20:48:15Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: updated notice about broken link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Firstly don&#039;t panic! :-)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install Moodle for the first time. For some of these steps it goes into a lot of detail to try and cover the majority of possible web server setups, so this page may look long and complicated. Don&#039;t panic, once you know how to do it you can install Moodle in minutes!&lt;br /&gt;
&lt;br /&gt;
If you have problems please read this page carefully - most common issues are answered in here. If you still have trouble, you can seek help from the Moodle community via  [http://moodle.org/course/view.php?id=5 moodle.org Using Moodle].&lt;br /&gt;
&lt;br /&gt;
Another option is to contact a [http://moodle.com/hosting/ Moodle Partner providing Moodle hosting] who can completely maintain Moodle for you, so that you can ignore all this and get straight into educating! A Moodle partner is the preferred option but if you decide to choose a hosting company that has cpanel then [http://otaru-jc.ac.jp/hagley/settingupmoodleonhostingwithcpanel.swf this tutorial will guide you]  through the process of choosing a host and setting up moodle via cpanel (not currently available; links are expected to be updated in a few weeks; see [http://moodle.org/mod/forum/discuss.php?d=102472#p454083 this forum post]). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; some hosting companies offer one-click moodle install options, which whilst sometimes effective, usually use old (sometimes years old) versions of moodle and sometimes simply don&#039;t work. If one of these goes wrong, your best bet is often to start from scratch following the instructions here yourself. Its almost certainly quicker.&lt;br /&gt;
&lt;br /&gt;
If you want to run Moodle on your own computer and this page looks a bit daunting, then please see our guides on how to install one of Moodle&#039;s complete [[Complete install packages for Windows|Windows packages]], [[Complete Install Packages for Mac OS X|Mac OS packages]] or [[Installing AMP |Installing Apache, MySQL and PHP(AMP)]]. They provide alternative instructions to install all this on most popular platforms.&lt;br /&gt;
&lt;br /&gt;
==Table of Contents==&lt;br /&gt;
__TOC__&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), but is also regularly tested with Windows XP/2000/2003 (WAMP), Solaris 10 (Sparc and x64), Mac OS X and Netware 6 operating systems. Support for PostgreSQL, Oracle and Microsoft SQL Server is also available.&lt;br /&gt;
&lt;br /&gt;
The procedure for installing Moodle on the Windows platform (e.g. Windows Server, IIS and MSSQL) varies slightly to the procedure for the LAMP platform. See [[Installation for Windows 2003 with IIS]] for more details.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Blank page problem while installing Moodle on Windows Vista may occur; following these steps: [[Installing Moodle on Windows Vista]] might help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Most web hosts support all of these requirements by default. You should contact your web host&#039;s support desk to check that this is the case &#039;&#039;&#039;before&#039;&#039;&#039; signing-up with them. It is especially important to ask about any PHP memory limits or MySQL question limits. If your prospective host does not provide a service which meets these requirements, or you are already signed up with them, ask them why and consider taking your business elsewhere if they do not change.&lt;br /&gt;
&lt;br /&gt;
The requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Hardware&#039;&#039;&#039; (unless you are using a hosted server). &lt;br /&gt;
* Disk space: 160MB free (min). You will require more free space to store your teaching materials.&lt;br /&gt;
* Memory: 256MB (min), 1GB (recommended). The general rule of thumb is that Moodle can support 50 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination. &lt;br /&gt;
&#039;&#039;&#039;Software&#039;&#039;&#039;&lt;br /&gt;
* Web server software. Most people use [[Apache]], but Moodle should work fine under any web server that supports [[PHP]], such as [[IIS]] on Windows platforms. PHP does impose requirements on versions of web servers, however these are complex and the general advice is to use the newest version possible of your chosen web server. &lt;br /&gt;
* PHP scripting language. (Please note that there have been issues installing Moodle with [http://www.php-accelerator.co.uk PHP-Accelerator]). There are currently two versions (or branches) of PHP available: PHP4 and PHP5 and the version requirements are listed below.&lt;br /&gt;
** For Moodle version 1.4 or later: PHP4 (version 4.1.0 or later) or PHP5 (version 5.1.0 or later) are supported.&lt;br /&gt;
** For Moodle version 1.6 or later: the PHP4 (version 4.3.0 or later) or PHP5 (version 5.1.0 or later) are supported. &lt;br /&gt;
** Future Moodle versions 2.0 or later will not support PHP4 and will require PHP5 (version 5.2.0 or later).&lt;br /&gt;
** PHP Settings. 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. &lt;br /&gt;
*** &#039;&#039;safe_mode&#039;&#039; needs to be OFF.&lt;br /&gt;
*** &#039;&#039;memory_limit&#039;&#039; should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.&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 ON. (It will be recommended to turn it off in 2.0.)&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.&lt;br /&gt;
** PHP Extensions and libraries&lt;br /&gt;
*** The mbstring extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** The iconv extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** [http://www.libgd.org/ GD library] and the [http://www.freetype.org/ FreeType 2] library and extensions are needed to be able to look at the dynamic graphs that the logs pages make.&lt;br /&gt;
*** The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.&lt;br /&gt;
*** The pgsql extension is required if you are using the PostgreSQL database.&lt;br /&gt;
*** The zlib extension is required for zip/unzip functionality.&lt;br /&gt;
*** The curl extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The tokenizer extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).&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;
* A working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is &#039;&#039;the&#039;&#039; choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment. &lt;br /&gt;
** For Moodle 1.5, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later). &lt;br /&gt;
** For Moodle 1.6, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).&lt;br /&gt;
** For Moodle 1.7, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
** For Moodle 1.8 or later, MySQL (version 4.1.12 or later), PostgreSQL (8.0 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
: MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting &amp;quot;strict mode&amp;quot; must be OFF (set to &amp;quot;&amp;quot; or &amp;quot;MYSQL40&amp;quot;) in the MySQL configuration file. &lt;br /&gt;
: PostgreSQL Notes: PostgreSQL 7.4 is recommended for earlier Moodle versions, since Moodle 1.8 only PostgreSQL 8.0 and above are supported.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== How many users? ==&lt;br /&gt;
&lt;br /&gt;
In addition to the hardware and software requirements, you will also need to think about the capacity of your Moodle installation in terms of the number of users it can handle. There are two numbers to plan for:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Browsing users&#039;&#039;&#039;: the maximum number of users able to browse your Moodle site. This is the number of computers in your organization or on your course (whichever is greater).&lt;br /&gt;
* &#039;&#039;&#039;Concurrent database users&#039;&#039;&#039;: the maximum number of concurrent database users (needed for Moodle activities such as quizzes). This is the number of users who will be using Moodle at the same time. In an educational institution, use your timetable/roster to obtain this figure.&lt;br /&gt;
&lt;br /&gt;
Once you know these figures for your users, you can start work out if your Moodle installation can support this capacity. The exact number of users depends on your hardware/software/network combination. Usually the amount of memory installed (RAM) is the deciding factor but a faster overall processor speed will also help in reducing waiting times for pages to load. &lt;br /&gt;
&lt;br /&gt;
The general rule of thumb for a single server is that the approx max concurrent users = RAM (GB) * 50 and the approx max browsing users = Approx max concurrent users * 5. As an example, a university with 500 total computers on campus and 100 concurrent users at any time will need approx 2GB of RAM on the one server to support the number of concurrent users.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Ask your provider what limits are placed on the number of concurrent database connections and the processor load. This will give a good estimate of the number of users your Moodle install can manage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; As of August 31, 2007, Moodle 1.8.2+ is not recommended for large installations, especially if you have large number (e.g. 20,000+) of courses. The main reason is the codes related to ROLES are still not fully optimized with database queries and still need some work. If you are planning to use 1.8.x codes for a larger institution, please make sure that you have sufficient time to do your own testing and performance profiling.  Upgrade to Moodle 1.9!!&lt;br /&gt;
&lt;br /&gt;
[Update] This performance issue has been improved quite a bit in the most recent 1.8.3+ version (see this thread discussion: http://moodle.org/mod/forum/discuss.php?d=83281).  Moodle 1.9 has even more improvements in all areas and is the recommended version.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to get Moodle, either as a compressed package or via CVS. &lt;br /&gt;
* There are two types of compressed packages on the  [http://download.moodle.org/ download page: http://download.moodle.org/], the standard distribution with Moodle only files and the [[Complete install packages|complete install]], which contains programs to operate Moodle in a web environment.  &lt;br /&gt;
* To use CVS, helpful instructions are available at the [[CVS_for_Administrators | CVS for Administrators]] page. The full [http://cvs.moodle.org/moodle/ Moodle CVS repository] is also available for browsing. &lt;br /&gt;
&lt;br /&gt;
After downloading, unpack the archive using either &lt;br /&gt;
 tar -zxvf [filename]&lt;br /&gt;
or&lt;br /&gt;
 unzip [filename]&lt;br /&gt;
as appropriate. &lt;br /&gt;
&lt;br /&gt;
If using CVS, run the CVS Checkout command.&lt;br /&gt;
&lt;br /&gt;
You will now be left with a directory called &amp;quot;moodle&amp;quot;, 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;.&lt;br /&gt;
&lt;br /&gt;
If you are downloading Moodle to your local computer and then uploading it to your web site, it is usually better to upload the whole archive as one file, and then do the unpacking on the server. Even web hosting interfaces like cPanel allow you to uncompress archives in the &amp;quot;File Manager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Structure of moodle directory ===&lt;br /&gt;
&lt;br /&gt;
You can safely skip this section, but here is a quick summary of the contents of the Moodle folder, to help get you oriented:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;config.php&#039;&#039; - contains basic settings. This file does not come with Moodle - you will create it.&lt;br /&gt;
:&#039;&#039;install.php&#039;&#039; - the script you will run to create config.php&lt;br /&gt;
:&#039;&#039;version.php&#039;&#039; - defines the current version of Moodle code&lt;br /&gt;
:&#039;&#039;index.php&#039;&#039; - the front page of the site&lt;br /&gt;
:&#039;&#039;admin/&#039;&#039; - code to administrate the whole server&lt;br /&gt;
:&#039;&#039;auth/&#039;&#039; - plugin modules to authenticate users&lt;br /&gt;
:&#039;&#039;blocks/&#039;&#039; - plugin modules for the little side blocks on many pages&lt;br /&gt;
:&#039;&#039;calendar/&#039;&#039; - all the code for managing and displaying calendars&lt;br /&gt;
:&#039;&#039;course/&#039;&#039; - code to display and manage courses&lt;br /&gt;
:&#039;&#039;doc/&#039;&#039; - help documentation for Moodle (eg this page)&lt;br /&gt;
:&#039;&#039;files/&#039;&#039; - code to display and manage uploaded files&lt;br /&gt;
:&#039;&#039;lang/&#039;&#039; - texts in different languages, one directory per language&lt;br /&gt;
:&#039;&#039;lib/&#039;&#039; - libraries of core Moodle code&lt;br /&gt;
:&#039;&#039;login/&#039;&#039; - code to handle login and account creation&lt;br /&gt;
:&#039;&#039;mod/&#039;&#039; - all the main Moodle course modules are in here&lt;br /&gt;
:&#039;&#039;pix/&#039;&#039; - generic site graphics&lt;br /&gt;
:&#039;&#039;theme/&#039;&#039; - theme packs/skins to change the look of the site.&lt;br /&gt;
:&#039;&#039;user/&#039;&#039; - code to display and manage users&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Setting-up your system==&lt;br /&gt;
To ensure that Moodle will install successfully, you need to check that the web server settings are correct, then create a blank database for Moodle to use and finally create a directory on your hard disk for Moodle to save your materials and other files you upload into your courses.&lt;br /&gt;
&lt;br /&gt;
=== Check web server settings ===&lt;br /&gt;
&lt;br /&gt;
*Firstly, make sure that your web server is set up to use index.php as a default page (perhaps in addition to index.html, default.htm and so on). In Apache, this is done using a DirectoryIndex parameter in your httpd.conf file. Mine usually looks like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
:Just make sure index.php is in the list (and preferably towards the start of the list, for efficiency).&lt;br /&gt;
&lt;br /&gt;
*Secondly, &#039;&#039;&#039;if you are using Apache 2&#039;&#039;&#039;, then you should turn on the &#039;&#039;AcceptPathInfo&#039;&#039; variable, which allows scripts to be passed arguments like &amp;lt;nowiki&amp;gt;http://server/file.php/arg1/arg2&amp;lt;/nowiki&amp;gt;. This is essential to allow relative links between your resources, and also provides a performance boost for people using your Moodle web site. You can turn this on by adding these lines to your httpd.conf file. (NB: This setting, or any equivalent, is not required in Apache 1)&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
=== Recheck PHP settings ===&lt;br /&gt;
Moodle requires a number of PHP settings to be active for it to work. These were given in the Requirements section and &#039;&#039;&#039;On most servers these will already be the default settings&#039;&#039;&#039;.  However, some PHP servers (and some of the more recent PHP versions) may have things set differently, so it is useful to double-check that the settings are correct. These are defined in PHP&#039;s configuration file (usually called &#039;&#039;&#039;php.ini&#039;&#039;&#039;) or in the Apache &#039;&#039;&#039;.htaccess&#039;&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
 safe_mode = 0 (necessary)&lt;br /&gt;
 memory_limit = 40M (varies: minimum 16M, 32M Moodle v1.7, 40M Moodle v1.8, 128M large sites)&lt;br /&gt;
 session.save_handler = files (unless you are using another handler, e.g. mm)   &lt;br /&gt;
 magic_quotes_gpc = 1    (preferred but not necessary, 0 will be recommended in 2.0)&lt;br /&gt;
 magic_quotes_runtime = 0    (necessary)&lt;br /&gt;
 file_uploads = 1&lt;br /&gt;
 session.auto_start = 0&lt;br /&gt;
 session.bug_compat_warn = 0&lt;br /&gt;
&lt;br /&gt;
You may also want to set other, optional php.ini file settings while you are already editing it. For instance, you may want to reset the maximum upload size of file attachments, which usually defaults to 2M(egabytes). For instance, to set these to 16 Megabytes:&lt;br /&gt;
 &lt;br /&gt;
 post_max_size = 16M&lt;br /&gt;
 upload_max_filesize = 16M&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Using a .htaccess file for webserver and PHP settings ===&lt;br /&gt;
&lt;br /&gt;
Use the above if you can directly edit your server&#039;s files, but if you are setting-up Moodle on a webhost, or don&#039;t have access to &#039;&#039;&#039;httpd.conf&#039;&#039;&#039; or &#039;&#039;&#039;php.ini&#039;&#039;&#039; on your server, or you have Moodle on a server with other applications that require different settings, then don&#039;t worry, you can often still override the default settings. This only works on Apache servers and only when Overrides have been allowed in the main Apache configuration. Moodle is supplied with a htaccess file which you can use, or you can create your own file manually.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Use the default htaccess file&#039;&#039;&#039;. The easiest thing to do is just copy the sample file from moodle/lib/htaccess and edit it to suit your needs. It contains further instructions. For example, in a Unix shell:&lt;br /&gt;
&lt;br /&gt;
 cd moodle&lt;br /&gt;
 cp moodle/lib/htaccess .htaccess&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Create your own file&#039;&#039;&#039;. Alternatively you can create your own file called &#039;&#039;&#039;.htaccess&#039;&#039;&#039; in Moodle&#039;s main directory that contains lines like the following. &lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
 php_value memory_limit 40M (adjust to your version of Moodle)&lt;br /&gt;
 php_flag magic_quotes_gpc 1&lt;br /&gt;
 php_flag magic_quotes_runtime 0&lt;br /&gt;
 php_flag file_uploads 1&lt;br /&gt;
 php_flag session.auto_start 0&lt;br /&gt;
 php_flag session.bug_compat_warn 0&lt;br /&gt;
&lt;br /&gt;
:If you have Apache version 2 installed, add these lines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IfDefine APACHE2&amp;gt;&lt;br /&gt;
     AcceptPathInfo on&lt;br /&gt;
 &amp;lt;/IfDefine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Otherwise add this single line:&lt;br /&gt;
&lt;br /&gt;
 AcceptPathInfo on&lt;br /&gt;
&lt;br /&gt;
:Optionally, you can also do things like define the maximum size for uploaded files, etc by adding these lines:&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 0&lt;br /&gt;
 php_value upload_max_filesize 2M&lt;br /&gt;
 php_value post_max_size 2M&lt;br /&gt;
&lt;br /&gt;
:The value given in these lines is 2M. You may want to change this at a later date to allow uploading of larger files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
Several hosting services that uses Apache 2 and php 5.x does not allow php flags and values to be set from within .htaccess file. It may be necessary to place a php.ini file within each sub-directory of the site :-( .&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Make one php.ini file in the main moodle directory tree and later copy it to all sub-directories. the syntax is a little bit different than the one used in .htaccess. (see sample after section 2)&lt;br /&gt;
# Run the script http://tips-scripts.com/php_ini_copy or copy php.ini manually to all sub-directories.&lt;br /&gt;
:php.ini (sample):&lt;br /&gt;
 upload_max_filesize = 2M&lt;br /&gt;
 post_max_size = 2M&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Before you go into this adventure make sure you really need those php instructions in your site.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note&#039;&#039;&#039;: Use a .htaccess file only [http://httpd.apache.org/docs/1.3/howto/htaccess.html#when as a last resort] as it can have an impact on the performance of your Moodle site and cause pages to load slowly on your browser.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating an empty database ===&lt;br /&gt;
&lt;br /&gt;
You need to create an empty database (eg &amp;quot;&#039;&#039;moodle&#039;&#039;&amp;quot;) in your database system along with a special user (eg &amp;quot;moodleuser&amp;quot;) that has access to that database (and that database only). You could use the &amp;quot;root&amp;quot; user if you wanted to for a test server, but this is not recommended for a production system: if hackers manage to discover the password then your whole database system would be at risk, rather than just one database.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Warning&#039;&#039;&#039;: Bear in mind that, as of Moodle version 1.5.x, Moodle doesn&#039;t work with MySQL 5.x&#039;s strict mode setting (STRICT_TRANS_TABLES and/or STRICT_ALL_TABLES) -- see [http://moodle.org/mod/forum/discuss.php?d=58552 forum discussion]. So if you are using MySQL 5.x, edit MySQL&#039;s configuration file (called &amp;quot;my.ini&amp;quot; in Windows and &amp;quot;my.cnf&amp;quot; on Unix/Linux) and comment out that option or set it to &amp;lt;code&amp;gt;sql-mode=&#039;&#039;&amp;lt;/code&amp;gt;. You have to restart MySQL after changing this setting. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; If you do not have access to your server, use PHPMyAdmin (or another MySQL client) and enter the command &amp;lt;code&amp;gt;SET @@global.sql_mode=&#039;&#039;;&amp;lt;/code&amp;gt; (be sure to use single quotes, and don&#039;t forget the semicolon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
====Using a hosted server====&lt;br /&gt;
If you are using a webhost, they will probably have a control panel web interface for you to create your database.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;[http://www.cpanel.com/ cPanel]&#039;&#039;&#039; system is one of the most popular of these. &lt;br /&gt;
To create a database using cPanel:&lt;br /&gt;
&lt;br /&gt;
# Click on the &#039;&#039;&#039;MySQL Databases&#039;&#039;&#039; icon.&lt;br /&gt;
# Type &#039;&#039;&#039;moodle&#039;&#039;&#039; in the New Database field and click &#039;&#039;&#039;Create Database&#039;&#039;&#039;.&lt;br /&gt;
# Type a &#039;&#039;username&#039;&#039; and &#039;&#039;password&#039;&#039; (not one you use elsewhere) in the respective fields and click &#039;&#039;&#039;Create  User&#039;&#039;&#039;.&amp;lt;br&amp;gt;Note that the &#039;&#039;username&#039;&#039; and &#039;&#039;database&#039;&#039; names may be prefixed by your cPanel account name and an underscore, and truncated to 16 characters. When entering this information into the Moodle installer - use the full names.&lt;br /&gt;
# Now use the &#039;&#039;&#039;Add Users to Databases&#039;&#039;&#039; button and give this new user account &#039;&#039;&#039;ALL&#039;&#039;&#039; rights to the new database.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#CreatDataDir |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Using the command line====&lt;br /&gt;
&lt;br /&gt;
If you have access to Unix or Windows command lines then you can do the same sort of thing by typing commands. You should do this using the MySQL Client program as follows (commands which you type-in are shown in bold):&lt;br /&gt;
&lt;br /&gt;
- Start the MySQL Client program:&lt;br /&gt;
 #&#039;&#039;&#039;mysql -u root -p&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;
 Your MySQL connection id is 2 to server version: 5.0.22-log&lt;br /&gt;
 &lt;br /&gt;
 Type &#039;help;&#039; or &#039;\h&#039; for help. Type &#039;\c&#039; to clear the buffer.&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The prompt changes to &amp;quot;mysql&amp;gt;&amp;quot; to indicate that you are now working in the MySQL Client program. When working in MySQL, all commands which you type-in must end in a semi-colon. (If you hit the Enter key without the final semi-colon, you&#039;ll get the line continuation symbol &#039;-&amp;gt;&#039;; this is your second chance to type the semi-colon and hit Enter.) &lt;br /&gt;
&lt;br /&gt;
- Begin by checking for any existing databases called &amp;quot;moodle&amp;quot; - if there are any you should change the name in all the commands which follow:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;SHOW DATABASES;&#039;&#039;&#039;&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | Database                |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | information_schema      |&lt;br /&gt;
 | mysql                   |&lt;br /&gt;
 | test                    |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 3 rows in set (0.03 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a database to store the Moodle tables. We&#039;ll call this &amp;quot;moodle&amp;quot;, as there are none with that name already in the above list, but change it if you need to.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;CREATE DATABASE moodle;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Change the default character set and collation of the &amp;quot;moodle&amp;quot; database to UTF8. Leave this out if you are installing Moodle 1.5 or earlier):&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a username and password to access the database &amp;quot;moodle&amp;quot; and grant database access permissions. We&#039;ll call the user &amp;quot;moodleuser&amp;quot; and set the password as &amp;quot;yourpassword&amp;quot;. It&#039;s a good idea to change these for your installation however most people keep the username as &amp;quot;moodleuser&amp;quot;. Remember the username and password you have set, as you&#039;ll need it in the configuration screens later. This is a long command so has been split over several lines by pressing the Return key.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;DROP,INDEX,ALTER ON moodle.*&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 0 rows affected (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Security Warnings&#039;&#039;&#039;: Never leave the password as the one shown here. Make sure you have a strong password (a mixture of letters and numbers, upper and lower case). Avoid granting &amp;quot;ALL&amp;quot; permissions on the database.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: For MySQL 4.0.1 or earlier, you don&#039;t need the CREATE TEMPORARY TABLES permission. &lt;br /&gt;
&lt;br /&gt;
- Exit the MySQL Client program:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;QUIT&#039;&#039;&#039;&lt;br /&gt;
 Bye&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
- Reload the grant tables using the mysqladmin program:&lt;br /&gt;
 #&#039;&#039;&#039;mysqladmin -u root -p reload&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
And some example command lines for PostgreSQL:&lt;br /&gt;
&lt;br /&gt;
   # su - postgres&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create user moodleuser createdb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create database moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;with encoding &#039;unicode&#039;&amp;lt;/font&amp;gt;;&amp;quot; -U moodleuser template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser nocreatedb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser with encrypted password &#039;yourpassword&#039;;&amp;quot; template1&lt;br /&gt;
   &amp;gt; su - root&lt;br /&gt;
   # /etc/init.d/postgresql reload&lt;br /&gt;
&lt;br /&gt;
If the Postgres create database command above (&amp;gt;psql -c &amp;quot;create database moodle...&amp;quot;) gives an error message you may want to try:&lt;br /&gt;
 psql -c &amp;quot;create database moodle with template=template1 encoding = &#039;unicode&#039; owner =  moodleuser &amp;lt;br&amp;gt;     location = &#039;/var/mydata&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the create database command asks you for a password, run the line containing &#039;encrypted password&#039; first before proceeding.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
* Step-by-step instructions on  [https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Ubuntu installation for Ubuntu(Debian)]&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating the data directory  ===&lt;br /&gt;
&lt;br /&gt;
Moodle will also need some space on your server&#039;s hard disk to store uploaded files, such as course documents and user pictures. The Moodle installer tries hard to create the &#039;&#039;&#039;moodledata&#039;&#039;&#039; directory for you but if it fails then you will have to create a directory for this purpose manually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Security warning&#039;&#039;&#039;: For security purposes, it is &#039;&#039;&#039;CRITICAL&#039;&#039;&#039; that this directory is &#039;&#039;&#039;NOT&#039;&#039;&#039; accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web site root directory (it is the folder that the main part of your URL -that is, the part up to the first single / - points to; for example, in &amp;lt;nowiki&amp;gt;http://your.domain.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;, it is &amp;lt;nowiki&amp;gt;http://your.domain.com/&amp;lt;/nowiki&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
But if you must have it in the web directory (and you are using Apache AND the web server configuration allows .htaccess files to restrict access to directories) then protect it by creating a file in the data directory called &#039;&#039;&#039;.htaccess&#039;&#039;&#039;, containing these lines:&lt;br /&gt;
&lt;br /&gt;
 order deny,allow&lt;br /&gt;
 deny from all&lt;br /&gt;
&lt;br /&gt;
If you are using IIS, you need to edit the properties of the data directory (from the Internet Information Services Manager console) and deny access to that folder to everybody from the web.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;If you don&#039;t protect the data directory from direct web access, anybody will be able to impersonate any user of your Moodle site (including the admin user!!!), and all of your course materials will be available to the web at large.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ownership &amp;amp; Permissions&#039;&#039;&#039;: To make sure that Moodle can save uploaded files in this directory, check that the web server software has permission to read, write and execute in this directory. On Unix machines, this means setting the owner of the directory to be something like &amp;quot;nobody&amp;quot; or &amp;quot;apache&amp;quot;, and then giving that user read, write and execute permissions. As an example, to change the owner to &amp;quot;nobody&amp;quot; you could use:&lt;br /&gt;
&lt;br /&gt;
 chown -R nobody:apache moodledata&lt;br /&gt;
&lt;br /&gt;
To change the permissions so that the owner has read,write and execute permissions, use something like this:&lt;br /&gt;
&lt;br /&gt;
 chmod -R 0770 moodledata&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are receiving permission denied messages, try &#039;&#039;chmod -R 0770 moodledata&#039;&#039; and then adjust the settings so that they are more secure. A more secure setting is &#039;&#039;chmod -R 0750 moodledata&#039;&#039;. According to the comments in config-dist.php, &amp;quot;On hosting systems you might need to make sure that your group has no permissions at all while others have full permissions.&amp;quot; To do this you could use &#039;&#039;chmod -R 707 moodledata&#039;&#039;. See also the [[Security | security page]].&lt;br /&gt;
&lt;br /&gt;
Remember that by default moodle will issue a warning about moodle data directories created inside the web directory, but otherwise this directory can be located where you wish. You can later move or change the location of this directory, but if you do, be sure to edit the setting in the &#039;&#039;&#039;config.php&#039;&#039;&#039; file that sets this; e.g. if moodledata is under a directory called data, then it would look like this:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dataroot  = &#039;/data/moodledata&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CPanel and webhosts&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On cPanel systems you can use the &amp;quot;File Manager&amp;quot; to find the folder, click on it, then choose &amp;quot;Change Permissions&amp;quot;. On many shared hosting servers, you will probably need to restrict all file access to your &amp;quot;group&amp;quot; (to prevent other webhost customers from looking at or changing your files), but provide full read/write access to everyone else (which will allow the web server to access your files). Speak to your server administrator if you are having trouble setting this up securely. In particular it will not be possible to create a usable data directory on sites that use a PHP feature known as &amp;quot;&#039;&#039;&#039;Safe Mode&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Run the installer script to create config.php ==&lt;br /&gt;
&lt;br /&gt;
To run the installer script (install.php), just try to access your Moodle main URL using a web browser, or access &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourserver/install.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; directly.&lt;br /&gt;
&lt;br /&gt;
(The Installer will try to set a session cookie. If you get a popup warning in your browser make sure you accept that cookie!)&lt;br /&gt;
&lt;br /&gt;
Moodle will detect that configuration is necessary and will lead you through some screens to help you create a new configuration file called &#039;&#039;&#039;config.php&#039;&#039;&#039;. At the end of the process Moodle will try and write the file into the right location, otherwise you can press a button to download it from the installer and then upload &#039;&#039;&#039;config.php&#039;&#039;&#039; into the main Moodle directory on the server.&lt;br /&gt;
&lt;br /&gt;
Along the way the installer will test your server environment and give you suggestions about how to fix any problems. For most common issues these suggestions should be sufficient, but if you get stuck, check in the Installation Forum for more help.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Go to the admin page to continue configuration ==&lt;br /&gt;
&lt;br /&gt;
Once the basic config.php has been correctly created in the previous step, trying to access the front page of your site will take you to the &amp;quot;admin&amp;quot; page for the rest of the configuration.&lt;br /&gt;
&lt;br /&gt;
The first time you access this admin page, you will be presented with a GPL &amp;quot;shrink wrap&amp;quot; agreement with which you must agree before you can continue with the setup.&lt;br /&gt;
&lt;br /&gt;
Now Moodle will start setting up your database and creating tables to store data. Firstly, the main database tables are created. You should see a number of SQL statements followed by status messages that look like this:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE course (&lt;br /&gt;
    id int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
    category int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    password varchar(50) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    fullname varchar(254) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    shortname varchar(15) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    summary text NOT NULL,&lt;br /&gt;
    format tinyint(4) NOT NULL default &#039;1&#039;,&lt;br /&gt;
    teacher varchar(100) NOT NULL default &#039;Teacher&#039;,&lt;br /&gt;
    startdate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    enddate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    timemodified int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    PRIMARY KEY (id)&lt;br /&gt;
 ) TYPE=MyISAM;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;SUCCESS&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and so on, followed by: &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Main databases set up successfully.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see these, then there must have been some problem with the database or the configuration settings you defined in config.php. Check that PHP isn&#039;t in a restricted &amp;quot;Safe Mode&amp;quot; (commercial web hosts sometimes have safe mode turned on). You can check PHP variables by creating a little file containing &#039;&#039;&#039;&amp;lt;?php phpinfo() ?&amp;gt;&#039;&#039;&#039; and looking at it through a browser. Check all these and try this page again.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
You should now see a form where you can define more configuration variables for your installation, such as the default language, SMTP hosts and so on. Don&#039;t worry too much about getting everything right just now - you can always come back and edit these later on using the admin interface. The defaults are designed to be useful and secure for most sites. Scroll down to the bottom and click &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If (and only if) you find yourself getting stuck on this page, unable to continue, then your server probably has what I call the &amp;quot;buggy referrer&amp;quot; problem. This is easy to fix: just turn off the &amp;quot;secureforms&amp;quot; setting, then try to continue again.&lt;br /&gt;
&lt;br /&gt;
Next you will see more pages that print lots of status messages as they set up all the tables required by the various Moodle module. As before, they should all be &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;green&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
The next page is a form where you can define parameters for your Moodle site and the front page, such as the name, format, description and so on. Fill this out (you can always come back and change these later) and then press &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finally, you will then be asked to create a top-level administration user for future access to the admin pages. Fill out the details with your own name, email etc and then click &amp;quot;Save changes&amp;quot;. Not all the fields are required, but if you miss any important fields you&#039;ll be re-prompted for them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure you remember the username and password you chose for the administration user account, as they will be necessary to access the administration page in future.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(If for any reason your install is interrupted, or there is a system error of some kind that prevents you from logging in using the admin account, you can usually log in using the default username of &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;, with password &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Once successful, you will be returned to the home page of your new site! Note the administration links that appear down the left hand side of the page (these items also appear on a separate Admin page) - these items are only visible to you because you are logged in as the admin user. All your further administration of Moodle can now be done using this menu, such as:&lt;br /&gt;
&lt;br /&gt;
* creating and deleting courses&lt;br /&gt;
* creating and editing user accounts&lt;br /&gt;
* administering teacher accounts&lt;br /&gt;
* changing site-wide settings like themes etc&lt;br /&gt;
&lt;br /&gt;
But you are not done installing yet! There is one very important thing still to do (see the next section on cron).&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Installing Moodle Using Command Line ==&lt;br /&gt;
&lt;br /&gt;
Installing Moodle Using command line is just as easy as installing Moodle using web browser. &lt;br /&gt;
* First Go to the moodle root directory and then to admin directory inside the moodle root. &lt;br /&gt;
&lt;br /&gt;
 $cd /var/www/html/moodle/admin&lt;br /&gt;
&lt;br /&gt;
* Then simply use the following syntax to run the moodle command line installer&lt;br /&gt;
 $php cliupgrade.php --lang=en --webaddr=http://www.example.com --moodledir=/var/www/html/moodle --datadir=/var/moodledata --dbtype=mysql --dbhost=localhost --dbname=moodle --dbuser=root --prefix=mdl --verbose=1 --interactivelevel=2 &lt;br /&gt;
&lt;br /&gt;
More information about the options can be found using &lt;br /&gt;
$php cliupgrad.php --help&lt;br /&gt;
&lt;br /&gt;
Then you will see the following list of available options&lt;br /&gt;
&lt;br /&gt;
 --lang		 		Valid installed language for installation. Default is English(en)&lt;br /&gt;
 --webaddr			Web address for the Moodle site&lt;br /&gt;
 --moodledir			Location of the moodle web folder&lt;br /&gt;
 --datadir			Location of the moodle data folder (should not be web visible)&lt;br /&gt;
 --dbtype			Database type. Default it mysql&lt;br /&gt;
 --dbhost			Database host. Default localhost&lt;br /&gt;
 --dbname			Database name. Default is moodle&lt;br /&gt;
 --dbuser			Database user. Default is blank&lt;br /&gt;
 --dbpass			Database password. Default is blank&lt;br /&gt;
 --prefix			        Table prefix for above database tables. Default is mdl&lt;br /&gt;
 --verbose			0 No output, 1 Summarized output(Default), 2 Detailed output&lt;br /&gt;
 --interactivelevel	        0 Non interactive, 1 Semi interactive(Default), 2 Interactive&lt;br /&gt;
 --help				print out this help&lt;br /&gt;
&lt;br /&gt;
When you choose non interactive mode without any options all the default values are assumed.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Set up cron ==&lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
== Set up backups ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Backup settings| backup instructions]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Create a new course ==&lt;br /&gt;
&lt;br /&gt;
Now that Moodle is running properly, you can try creating a new course to play with.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Create a new course&amp;quot; from the Admin page (or the admin links on the home page).&lt;br /&gt;
&lt;br /&gt;
Fill out the form, paying special attention to the course format. You don&#039;t have to worry about the details too much at this stage, as everything can be changed later by the teacher. Note that the yellow help icons are everywhere to provide contextual help on any aspect.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;Save changes&amp;quot;, and you will be taken to a new form where you can assign teachers to the course. You can only add existing user accounts from this form - if you want to create a new teacher account then either ask the teacher to create one for themselves (see the login page), or create one for them using the &amp;quot;Add a new user&amp;quot; on the Admin page.&lt;br /&gt;
&lt;br /&gt;
Once done, the course is ready to customize, and is accessible via the &amp;quot;Courses&amp;quot; link on the home page.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
* [[Complete install packages]] might be an easier first time installs on some systems&lt;br /&gt;
* Help forum:  [http://moodle.org/mod/forum/view.php?id=28 Installation problems]&lt;br /&gt;
* [[Installing Apache, MySQL and PHP]] - Open source programs that can run Moodle on the web or on a desktop&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=42688 Selecting a web host for Moodle] forum discussion&lt;br /&gt;
* [[masquerading|Masquerading]] - Running Moodle behind a masquerading/NAT firewall&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[cs:Instalace]]&lt;br /&gt;
[[de:Installieren von Moodle]]&lt;br /&gt;
[[es:Instalación de moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;br /&gt;
[[nl:Installatiegids]]&lt;br /&gt;
[[pl:Instalacja Moodle]]&lt;br /&gt;
[[pt:Instalação do Moodle]]&lt;br /&gt;
[[ru:Установка Moodle]]&lt;br /&gt;
[[sk:Inštalácia]]&lt;br /&gt;
[[zh:安装Moodlezh:]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=41495</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=41495"/>
		<updated>2008-08-06T07:36:23Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: add note on availability of tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Firstly don&#039;t panic! :-)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install Moodle for the first time. For some of these steps it goes into a lot of detail to try and cover the majority of possible web server setups, so this page may look long and complicated. Don&#039;t panic, once you know how to do it you can install Moodle in minutes!&lt;br /&gt;
&lt;br /&gt;
If you have problems please read this page carefully - most common issues are answered in here. If you still have trouble, you can seek help from the Moodle community via  [http://moodle.org/course/view.php?id=5 moodle.org Using Moodle].&lt;br /&gt;
&lt;br /&gt;
Another option is to contact a [http://moodle.com/hosting/ Moodle Partner providing Moodle hosting] who can completely maintain Moodle for you, so that you can ignore all this and get straight into educating! A Moodle partner is the preferred option but if you decide to choose a hosting company that has cpanel then [http://otaru-jc.ac.jp/hagley/settingupmoodleonhostingwithcpanel.swf this tutorial will guide you]  through the process of choosing a host and setting up moodle via cpanel (not currently available). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; some hosting companies offer one-click moodle install options, which whilst sometimes effective, usually use old (sometimes years old) versions of moodle and sometimes simply don&#039;t work. If one of these goes wrong, your best bet is often to start from scratch following the instructions here yourself. Its almost certainly quicker.&lt;br /&gt;
&lt;br /&gt;
If you want to run Moodle on your own computer and this page looks a bit daunting, then please see our guides: [[Installing AMP |Installing Apache, MySQL and PHP(AMP)]] or [[Complete install packages| how to install one of Moodle&#039;s complete packages]]. They provide alternative instructions to install all this on most popular platforms.&lt;br /&gt;
==Table of Contents==&lt;br /&gt;
__TOC__&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), but is also regularly tested with Windows XP/2000/2003 (WAMP), Solaris 10 (Sparc and x64), Mac OS X and Netware 6 operating systems. Support for PostgreSQL, Oracle and Microsoft SQL Server is also available.&lt;br /&gt;
&lt;br /&gt;
The procedure for installing Moodle on the Windows platform (e.g. Windows Server, IIS and MSSQL) varies slightly to the procedure for the LAMP platform. See [[Installation for Windows 2003 with IIS]] for more details.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Blank page problem while installing Moodle on Windows Vista may occur; following these steps: [[Installing Moodle on Windows Vista]] might help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Most web hosts support all of these requirements by default. You should contact your web host&#039;s support desk to check that this is the case &#039;&#039;&#039;before&#039;&#039;&#039; signing-up with them. It is especially important to ask about any PHP memory limits or MySQL question limits. If your prospective host does not provide a service which meets these requirements, or you are already signed up with them, ask them why and consider taking your business elsewhere if they do not change.&lt;br /&gt;
&lt;br /&gt;
The requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Hardware&#039;&#039;&#039; (unless you are using a hosted server). &lt;br /&gt;
* Disk space: 160MB free (min). You will require more free space to store your teaching materials.&lt;br /&gt;
* Memory: 256MB (min), 1GB (recommended). The general rule of thumb is that Moodle can support 50 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination. &lt;br /&gt;
&#039;&#039;&#039;Software&#039;&#039;&#039;&lt;br /&gt;
* Web server software. Most people use [[Apache]], but Moodle should work fine under any web server that supports [[PHP]], such as [[IIS]] on Windows platforms. PHP does impose requirements on versions of web servers, however these are complex and the general advice is to use the newest version possible of your chosen web server. &lt;br /&gt;
* PHP scripting language. (Please note that there have been issues installing Moodle with [http://www.php-accelerator.co.uk PHP-Accelerator]). There are currently two versions (or branches) of PHP available: PHP4 and PHP5 and the version requirements are listed below.&lt;br /&gt;
** For Moodle version 1.4 or later: PHP4 (version 4.1.0 or later) or PHP5 (version 5.1.0 or later) are supported.&lt;br /&gt;
** For Moodle version 1.6 or later: the PHP4 (version 4.3.0 or later) or PHP5 (version 5.1.0 or later) are supported. &lt;br /&gt;
** Future Moodle versions 2.0 or later will not support PHP4 and will require PHP5 (version 5.2.0 or later).&lt;br /&gt;
** PHP Settings. 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. &lt;br /&gt;
*** &#039;&#039;safe_mode&#039;&#039; needs to be OFF.&lt;br /&gt;
*** &#039;&#039;memory_limit&#039;&#039; should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.&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 ON. (It will be recommended to turn it off in 2.0.)&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.&lt;br /&gt;
** PHP Extensions and libraries&lt;br /&gt;
*** The mbstring extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** The iconv extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** [http://www.libgd.org/ GD library] and the [http://www.freetype.org/ FreeType 2] library and extensions are needed to be able to look at the dynamic graphs that the logs pages make.&lt;br /&gt;
*** The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.&lt;br /&gt;
*** The pgsql extension is required if you are using the PostgreSQL database.&lt;br /&gt;
*** The zlib extension is required for zip/unzip functionality.&lt;br /&gt;
*** The curl extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The tokenizer extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).&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;
* A working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is &#039;&#039;the&#039;&#039; choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment. &lt;br /&gt;
** For Moodle 1.5, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later). &lt;br /&gt;
** For Moodle 1.6, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).&lt;br /&gt;
** For Moodle 1.7, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
** For Moodle 1.8 or later, MySQL (version 4.1.12 or later), PostgreSQL (8.0 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
: MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting &amp;quot;strict mode&amp;quot; must be OFF (set to &amp;quot;&amp;quot; or &amp;quot;MYSQL40&amp;quot;) in the MySQL configuration file. &lt;br /&gt;
: PostgreSQL Notes: PostgreSQL 7.4 is recommended for earlier Moodle versions, since Moodle 1.8 only PostgreSQL 8.0 and above are supported.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== How many users? ==&lt;br /&gt;
&lt;br /&gt;
In addition to the hardware and software requirements, you will also need to think about the capacity of your Moodle installation in terms of the number of users it can handle. There are two numbers to plan for:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Browsing users&#039;&#039;&#039;: the maximum number of users able to browse your Moodle site. This is the number of computers in your organization or on your course (whichever is greater).&lt;br /&gt;
* &#039;&#039;&#039;Concurrent database users&#039;&#039;&#039;: the maximum number of concurrent database users (needed for Moodle activities such as quizzes). This is the number of users who will be using Moodle at the same time. In an educational institution, use your timetable/roster to obtain this figure.&lt;br /&gt;
&lt;br /&gt;
Once you know these figures for your users, you can start work out if your Moodle installation can support this capacity. The exact number of users depends on your hardware/software/network combination. Usually the amount of memory installed (RAM) is the deciding factor but a faster overall processor speed will also help in reducing waiting times for pages to load. &lt;br /&gt;
&lt;br /&gt;
The general rule of thumb for a single server is that the approx max concurrent users = RAM (GB) * 50 and the approx max browsing users = Approx max concurrent users * 5. As an example, a university with 500 total computers on campus and 100 concurrent users at any time will need approx 2GB of RAM on the one server to support the number of concurrent users.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Ask your provider what limits are placed on the number of concurrent database connections and the processor load. This will give a good estimate of the number of users your Moodle install can manage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; As of August 31, 2007, Moodle 1.8.2+ is not recommended for large installations, especially if you have large number (e.g. 20,000+) of courses. The main reason is the codes related to ROLES are still not fully optimized with database queries and still need some work. If you are planning to use 1.8.x codes for a larger institution, please make sure that you have sufficient time to do your own testing and performance profiling.  Upgrade to Moodle 1.9!!&lt;br /&gt;
&lt;br /&gt;
[Update] This performance issue has been improved quite a bit in the most recent 1.8.3+ version (see this thread discussion: http://moodle.org/mod/forum/discuss.php?d=83281).  Moodle 1.9 has even more improvements in all areas and is the recommended version.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to get Moodle, either as a compressed package or via CVS. &lt;br /&gt;
* There are two types of compressed packages on the  [http://download.moodle.org/ download page: http://download.moodle.org/], the standard distribution with Moodle only files and the [[Complete install packages|complete install]], which contains programs to operate Moodle in a web environment.  &lt;br /&gt;
* To use CVS, helpful instructions are available at the [[CVS_for_Administrators | CVS for Administrators]] page. The full [http://cvs.moodle.org/moodle/ Moodle CVS repository] is also available for browsing. &lt;br /&gt;
&lt;br /&gt;
After downloading, unpack the archive using either &lt;br /&gt;
 tar -zxvf [filename]&lt;br /&gt;
or&lt;br /&gt;
 unzip [filename]&lt;br /&gt;
as appropriate. &lt;br /&gt;
&lt;br /&gt;
If using CVS, run the CVS Checkout command.&lt;br /&gt;
&lt;br /&gt;
You will now be left with a directory called &amp;quot;moodle&amp;quot;, 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;.&lt;br /&gt;
&lt;br /&gt;
If you are downloading Moodle to your local computer and then uploading it to your web site, it is usually better to upload the whole archive as one file, and then do the unpacking on the server. Even web hosting interfaces like cPanel allow you to uncompress archives in the &amp;quot;File Manager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Structure of moodle directory ===&lt;br /&gt;
&lt;br /&gt;
You can safely skip this section, but here is a quick summary of the contents of the Moodle folder, to help get you oriented:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;config.php&#039;&#039; - contains basic settings. This file does not come with Moodle - you will create it.&lt;br /&gt;
:&#039;&#039;install.php&#039;&#039; - the script you will run to create config.php&lt;br /&gt;
:&#039;&#039;version.php&#039;&#039; - defines the current version of Moodle code&lt;br /&gt;
:&#039;&#039;index.php&#039;&#039; - the front page of the site&lt;br /&gt;
:&#039;&#039;admin/&#039;&#039; - code to administrate the whole server&lt;br /&gt;
:&#039;&#039;auth/&#039;&#039; - plugin modules to authenticate users&lt;br /&gt;
:&#039;&#039;blocks/&#039;&#039; - plugin modules for the little side blocks on many pages&lt;br /&gt;
:&#039;&#039;calendar/&#039;&#039; - all the code for managing and displaying calendars&lt;br /&gt;
:&#039;&#039;course/&#039;&#039; - code to display and manage courses&lt;br /&gt;
:&#039;&#039;doc/&#039;&#039; - help documentation for Moodle (eg this page)&lt;br /&gt;
:&#039;&#039;files/&#039;&#039; - code to display and manage uploaded files&lt;br /&gt;
:&#039;&#039;lang/&#039;&#039; - texts in different languages, one directory per language&lt;br /&gt;
:&#039;&#039;lib/&#039;&#039; - libraries of core Moodle code&lt;br /&gt;
:&#039;&#039;login/&#039;&#039; - code to handle login and account creation&lt;br /&gt;
:&#039;&#039;mod/&#039;&#039; - all the main Moodle course modules are in here&lt;br /&gt;
:&#039;&#039;pix/&#039;&#039; - generic site graphics&lt;br /&gt;
:&#039;&#039;theme/&#039;&#039; - theme packs/skins to change the look of the site.&lt;br /&gt;
:&#039;&#039;user/&#039;&#039; - code to display and manage users&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Setting-up your system==&lt;br /&gt;
To ensure that Moodle will install successfully, you need to check that the web server settings are correct, then create a blank database for Moodle to use and finally create a directory on your hard disk for Moodle to save your materials and other files you upload into your courses.&lt;br /&gt;
&lt;br /&gt;
=== Check web server settings ===&lt;br /&gt;
&lt;br /&gt;
*Firstly, make sure that your web server is set up to use index.php as a default page (perhaps in addition to index.html, default.htm and so on). In Apache, this is done using a DirectoryIndex parameter in your httpd.conf file. Mine usually looks like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
:Just make sure index.php is in the list (and preferably towards the start of the list, for efficiency).&lt;br /&gt;
&lt;br /&gt;
*Secondly, &#039;&#039;&#039;if you are using Apache 2&#039;&#039;&#039;, then you should turn on the &#039;&#039;AcceptPathInfo&#039;&#039; variable, which allows scripts to be passed arguments like &amp;lt;nowiki&amp;gt;http://server/file.php/arg1/arg2&amp;lt;/nowiki&amp;gt;. This is essential to allow relative links between your resources, and also provides a performance boost for people using your Moodle web site. You can turn this on by adding these lines to your httpd.conf file. (NB: This setting, or any equivalent, is not required in Apache 1)&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
=== Recheck PHP settings ===&lt;br /&gt;
Moodle requires a number of PHP settings to be active for it to work. These were given in the Requirements section and &#039;&#039;&#039;On most servers these will already be the default settings&#039;&#039;&#039;.  However, some PHP servers (and some of the more recent PHP versions) may have things set differently, so it is useful to double-check that the settings are correct. These are defined in PHP&#039;s configuration file (usually called &#039;&#039;&#039;php.ini&#039;&#039;&#039;) or in the Apache &#039;&#039;&#039;.htaccess&#039;&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
 safe_mode = 0 (necessary)&lt;br /&gt;
 memory_limit = 40M (varies: minimum 16M, 32M Moodle v1.7, 40M Moodle v1.8, 128M large sites)&lt;br /&gt;
 session.save_handler = files (unless you are using another handler, e.g. mm)   &lt;br /&gt;
 magic_quotes_gpc = 1    (preferred but not necessary, 0 will be recommended in 2.0)&lt;br /&gt;
 magic_quotes_runtime = 0    (necessary)&lt;br /&gt;
 file_uploads = 1&lt;br /&gt;
 session.auto_start = 0&lt;br /&gt;
 session.bug_compat_warn = 0&lt;br /&gt;
&lt;br /&gt;
You may also want to set other, optional php.ini file settings while you are already editing it. For instance, you may want to reset the maximum upload size of file attachments, which usually defaults to 2M(egabytes). For instance, to set these to 16 Megabytes:&lt;br /&gt;
 &lt;br /&gt;
 post_max_size = 16M&lt;br /&gt;
 upload_max_filesize = 16M&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Using a .htaccess file for webserver and PHP settings ===&lt;br /&gt;
&lt;br /&gt;
Use the above if you can directly edit your server&#039;s files, but if you are setting-up Moodle on a webhost, or don&#039;t have access to &#039;&#039;&#039;httpd.conf&#039;&#039;&#039; or &#039;&#039;&#039;php.ini&#039;&#039;&#039; on your server, or you have Moodle on a server with other applications that require different settings, then don&#039;t worry, you can often still override the default settings. This only works on Apache servers and only when Overrides have been allowed in the main Apache configuration. Moodle is supplied with a htaccess file which you can use, or you can create your own file manually.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Use the default htaccess file&#039;&#039;&#039;. The easiest thing to do is just copy the sample file from moodle/lib/htaccess and edit it to suit your needs. It contains further instructions. For example, in a Unix shell:&lt;br /&gt;
&lt;br /&gt;
 cd moodle&lt;br /&gt;
 cp moodle/lib/htaccess .htaccess&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Create your own file&#039;&#039;&#039;. Alternatively you can create your own file called &#039;&#039;&#039;.htaccess&#039;&#039;&#039; in Moodle&#039;s main directory that contains lines like the following. &lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
 php_value memory_limit 40M (adjust to your version of Moodle)&lt;br /&gt;
 php_flag magic_quotes_gpc 1&lt;br /&gt;
 php_flag magic_quotes_runtime 0&lt;br /&gt;
 php_flag file_uploads 1&lt;br /&gt;
 php_flag session.auto_start 0&lt;br /&gt;
 php_flag session.bug_compat_warn 0&lt;br /&gt;
&lt;br /&gt;
:If you have Apache version 2 installed, add these lines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IfDefine APACHE2&amp;gt;&lt;br /&gt;
     AcceptPathInfo on&lt;br /&gt;
 &amp;lt;/IfDefine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Otherwise add this single line:&lt;br /&gt;
&lt;br /&gt;
 AcceptPathInfo on&lt;br /&gt;
&lt;br /&gt;
:Optionally, you can also do things like define the maximum size for uploaded files, etc by adding these lines:&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 0&lt;br /&gt;
 php_value upload_max_filesize 2M&lt;br /&gt;
 php_value post_max_size 2M&lt;br /&gt;
&lt;br /&gt;
:The value given in these lines is 2M. You may want to change this at a later date to allow uploading of larger files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
Several hosting services that uses Apache 2 and php 5.x does not allow php flags and values to be set from within .htaccess file. It may be necessary to place a php.ini file within each sub-directory of the site :-( .&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Make one php.ini file in the main moodle directory tree and later copy it to all sub-directories. the syntax is a little bit different than the one used in .htaccess. (see sample after section 2)&lt;br /&gt;
# Run the script http://tips-scripts.com/php_ini_copy or copy php.ini manually to all sub-directories.&lt;br /&gt;
:php.ini (sample):&lt;br /&gt;
 upload_max_filesize = 2M&lt;br /&gt;
 post_max_size = 2M&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Before you go into this adventure make sure you really need those php instructions in your site.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Note&#039;&#039;&#039;: Use a .htaccess file only [http://httpd.apache.org/docs/1.3/howto/htaccess.html#when as a last resort] as it can have an impact on the performance of your Moodle site and cause pages to load slowly on your browser.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating an empty database ===&lt;br /&gt;
&lt;br /&gt;
You need to create an empty database (eg &amp;quot;&#039;&#039;moodle&#039;&#039;&amp;quot;) in your database system along with a special user (eg &amp;quot;moodleuser&amp;quot;) that has access to that database (and that database only). You could use the &amp;quot;root&amp;quot; user if you wanted to for a test server, but this is not recommended for a production system: if hackers manage to discover the password then your whole database system would be at risk, rather than just one database.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Warning&#039;&#039;&#039;: Bear in mind that, as of Moodle version 1.5.x, Moodle doesn&#039;t work with MySQL 5.x&#039;s strict mode setting (STRICT_TRANS_TABLES and/or STRICT_ALL_TABLES) -- see [http://moodle.org/mod/forum/discuss.php?d=58552 forum discussion]. So if you are using MySQL 5.x, edit MySQL&#039;s configuration file (called &amp;quot;my.ini&amp;quot; in Windows and &amp;quot;my.cnf&amp;quot; on Unix/Linux) and comment out that option or set it to &amp;lt;code&amp;gt;sql-mode=&#039;&#039;&amp;lt;/code&amp;gt;. You have to restart MySQL after changing this setting. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; If you do not have access to your server, use PHPMyAdmin (or another MySQL client) and enter the command &amp;lt;code&amp;gt;SET @@global.sql_mode=&#039;&#039;;&amp;lt;/code&amp;gt; (be sure to use single quotes, and don&#039;t forget the semicolon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
====Using a hosted server====&lt;br /&gt;
If you are using a webhost, they will probably have a control panel web interface for you to create your database.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;[http://www.cpanel.com/ cPanel]&#039;&#039;&#039; system is one of the most popular of these. &lt;br /&gt;
To create a database using cPanel:&lt;br /&gt;
&lt;br /&gt;
# Click on the &#039;&#039;&#039;MySQL Databases&#039;&#039;&#039; icon.&lt;br /&gt;
# Type &#039;&#039;&#039;moodle&#039;&#039;&#039; in the New Database field and click &#039;&#039;&#039;Create Database&#039;&#039;&#039;.&lt;br /&gt;
# Type a &#039;&#039;username&#039;&#039; and &#039;&#039;password&#039;&#039; (not one you use elsewhere) in the respective fields and click &#039;&#039;&#039;Create  User&#039;&#039;&#039;.&amp;lt;br&amp;gt;Note that the &#039;&#039;username&#039;&#039; and &#039;&#039;database&#039;&#039; names may be prefixed by your cPanel account name and an underscore, and truncated to 16 characters. When entering this information into the Moodle installer - use the full names.&lt;br /&gt;
# Now use the &#039;&#039;&#039;Add Users to Databases&#039;&#039;&#039; button and give this new user account &#039;&#039;&#039;ALL&#039;&#039;&#039; rights to the new database.&lt;br /&gt;
&lt;br /&gt;
Continue with [[Installing_Moodle#CreatDataDir |Creating the data directory]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Using the command line====&lt;br /&gt;
&lt;br /&gt;
If you have access to Unix or Windows command lines then you can do the same sort of thing by typing commands. You should do this using the MySQL Client program as follows (commands which you type-in are shown in bold):&lt;br /&gt;
&lt;br /&gt;
- Start the MySQL Client program:&lt;br /&gt;
 #&#039;&#039;&#039;mysql -u root -p&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;
 Your MySQL connection id is 2 to server version: 5.0.22-log&lt;br /&gt;
 &lt;br /&gt;
 Type &#039;help;&#039; or &#039;\h&#039; for help. Type &#039;\c&#039; to clear the buffer.&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The prompt changes to &amp;quot;mysql&amp;gt;&amp;quot; to indicate that you are now working in the MySQL Client program. When working in MySQL, all commands which you type-in must end in a semi-colon. (If you hit the Enter key without the final semi-colon, you&#039;ll get the line continuation symbol &#039;-&amp;gt;&#039;; this is your second chance to type the semi-colon and hit Enter.) &lt;br /&gt;
&lt;br /&gt;
- Begin by checking for any existing databases called &amp;quot;moodle&amp;quot; - if there are any you should change the name in all the commands which follow:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;SHOW DATABASES;&#039;&#039;&#039;&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | Database                |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | information_schema      |&lt;br /&gt;
 | mysql                   |&lt;br /&gt;
 | test                    |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 3 rows in set (0.03 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a database to store the Moodle tables. We&#039;ll call this &amp;quot;moodle&amp;quot;, as there are none with that name already in the above list, but change it if you need to.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;CREATE DATABASE moodle;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Change the default character set and collation of the &amp;quot;moodle&amp;quot; database to UTF8. Leave this out if you are installing Moodle 1.5 or earlier):&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a username and password to access the database &amp;quot;moodle&amp;quot; and grant database access permissions. We&#039;ll call the user &amp;quot;moodleuser&amp;quot; and set the password as &amp;quot;yourpassword&amp;quot;. It&#039;s a good idea to change these for your installation however most people keep the username as &amp;quot;moodleuser&amp;quot;. Remember the username and password you have set, as you&#039;ll need it in the configuration screens later. This is a long command so has been split over several lines by pressing the Return key.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;DROP,INDEX,ALTER ON moodle.*&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 0 rows affected (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Security Warnings&#039;&#039;&#039;: Never leave the password as the one shown here. Make sure you have a strong password (a mixture of letters and numbers, upper and lower case). Avoid granting &amp;quot;ALL&amp;quot; permissions on the database.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: For MySQL 4.0.1 or earlier, you don&#039;t need the CREATE TEMPORARY TABLES permission. &lt;br /&gt;
&lt;br /&gt;
- Exit the MySQL Client program:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;QUIT&#039;&#039;&#039;&lt;br /&gt;
 Bye&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
- Reload the grant tables using the mysqladmin program:&lt;br /&gt;
 #&#039;&#039;&#039;mysqladmin -u root -p reload&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
And some example command lines for PostgreSQL:&lt;br /&gt;
&lt;br /&gt;
   # su - postgres&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create user moodleuser createdb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create database moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;with encoding &#039;unicode&#039;&amp;lt;/font&amp;gt;;&amp;quot; -U moodleuser template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser nocreatedb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser with encrypted password &#039;yourpassword&#039;;&amp;quot; template1&lt;br /&gt;
   &amp;gt; su - root&lt;br /&gt;
   # /etc/init.d/postgresql reload&lt;br /&gt;
&lt;br /&gt;
If the Postgres create database command above (&amp;gt;psql -c &amp;quot;create database moodle...&amp;quot;) gives an error message you may want to try:&lt;br /&gt;
 psql -c &amp;quot;create database moodle with template=template1 encoding = &#039;unicode&#039; owner =  moodleuser &amp;lt;br&amp;gt;     location = &#039;/var/mydata&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the create database command asks you for a password, run the line containing &#039;encrypted password&#039; first before proceeding.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
* Step-by-step instructions on  [https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Ubuntu installation for Ubuntu(Debian)]&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating the data directory  ===&lt;br /&gt;
&lt;br /&gt;
Moodle will also need some space on your server&#039;s hard disk to store uploaded files, such as course documents and user pictures. The Moodle installer tries hard to create the &#039;&#039;&#039;moodledata&#039;&#039;&#039; directory for you but if it fails then you will have to create a directory for this purpose manually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Security warning&#039;&#039;&#039;: For security purposes, it is &#039;&#039;&#039;CRITICAL&#039;&#039;&#039; that this directory is &#039;&#039;&#039;NOT&#039;&#039;&#039; accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web site root directory (it is the folder that the main part of your URL -that is, the part up to the first single / - points to; for example, in &amp;lt;nowiki&amp;gt;http://your.domain.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;, it is &amp;lt;nowiki&amp;gt;http://your.domain.com/&amp;lt;/nowiki&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
But if you must have it in the web directory (and you are using Apache AND the web server configuration allows .htaccess files to restrict access to directories) then protect it by creating a file in the data directory called &#039;&#039;&#039;.htaccess&#039;&#039;&#039;, containing these lines:&lt;br /&gt;
&lt;br /&gt;
 order deny,allow&lt;br /&gt;
 deny from all&lt;br /&gt;
&lt;br /&gt;
If you are using IIS, you need to edit the properties of the data directory (from the Internet Information Services Manager console) and deny access to that folder to everybody from the web.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;If you don&#039;t protect the data directory from direct web access, anybody will be able to impersonate any user of your Moodle site (including the admin user!!!), and all of your course materials will be available to the web at large.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ownership &amp;amp; Permissions&#039;&#039;&#039;: To make sure that Moodle can save uploaded files in this directory, check that the web server software has permission to read, write and execute in this directory. On Unix machines, this means setting the owner of the directory to be something like &amp;quot;nobody&amp;quot; or &amp;quot;apache&amp;quot;, and then giving that user read, write and execute permissions. As an example, to change the owner to &amp;quot;nobody&amp;quot; you could use:&lt;br /&gt;
&lt;br /&gt;
 chown -R nobody:apache moodledata&lt;br /&gt;
&lt;br /&gt;
To change the permissions so that the owner has read,write and execute permissions, use something like this:&lt;br /&gt;
&lt;br /&gt;
 chmod -R 0770 moodledata&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are receiving permission denied messages, try &#039;&#039;chmod -R 0770 moodledata&#039;&#039; and then adjust the settings so that they are more secure. A more secure setting is &#039;&#039;chmod -R 0750 moodledata&#039;&#039;. According to the comments in config-dist.php, &amp;quot;On hosting systems you might need to make sure that your group has no permissions at all while others have full permissions.&amp;quot; To do this you could use &#039;&#039;chmod -R 707 moodledata&#039;&#039;. See also the [[Security | security page]].&lt;br /&gt;
&lt;br /&gt;
Remember that by default moodle will issue a warning about moodle data directories created inside the web directory, but otherwise this directory can be located where you wish. You can later move or change the location of this directory, but if you do, be sure to edit the setting in the &#039;&#039;&#039;config.php&#039;&#039;&#039; file that sets this; e.g. if moodledata is under a directory called data, then it would look like this:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dataroot  = &#039;/data/moodledata&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=background-color:lightCyan border=1 cellpadding=5 cellspacing=0 &amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CPanel and webhosts&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On cPanel systems you can use the &amp;quot;File Manager&amp;quot; to find the folder, click on it, then choose &amp;quot;Change Permissions&amp;quot;. On many shared hosting servers, you will probably need to restrict all file access to your &amp;quot;group&amp;quot; (to prevent other webhost customers from looking at or changing your files), but provide full read/write access to everyone else (which will allow the web server to access your files). Speak to your server administrator if you are having trouble setting this up securely. In particular it will not be possible to create a usable data directory on sites that use a PHP feature known as &amp;quot;&#039;&#039;&#039;Safe Mode&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Run the installer script to create config.php ==&lt;br /&gt;
&lt;br /&gt;
To run the installer script (install.php), just try to access your Moodle main URL using a web browser, or access &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourserver/install.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; directly.&lt;br /&gt;
&lt;br /&gt;
(The Installer will try to set a session cookie. If you get a popup warning in your browser make sure you accept that cookie!)&lt;br /&gt;
&lt;br /&gt;
Moodle will detect that configuration is necessary and will lead you through some screens to help you create a new configuration file called &#039;&#039;&#039;config.php&#039;&#039;&#039;. At the end of the process Moodle will try and write the file into the right location, otherwise you can press a button to download it from the installer and then upload &#039;&#039;&#039;config.php&#039;&#039;&#039; into the main Moodle directory on the server.&lt;br /&gt;
&lt;br /&gt;
Along the way the installer will test your server environment and give you suggestions about how to fix any problems. For most common issues these suggestions should be sufficient, but if you get stuck, check in the Installation Forum for more help.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Go to the admin page to continue configuration ==&lt;br /&gt;
&lt;br /&gt;
Once the basic config.php has been correctly created in the previous step, trying to access the front page of your site will take you to the &amp;quot;admin&amp;quot; page for the rest of the configuration.&lt;br /&gt;
&lt;br /&gt;
The first time you access this admin page, you will be presented with a GPL &amp;quot;shrink wrap&amp;quot; agreement with which you must agree before you can continue with the setup.&lt;br /&gt;
&lt;br /&gt;
Now Moodle will start setting up your database and creating tables to store data. Firstly, the main database tables are created. You should see a number of SQL statements followed by status messages that look like this:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE course (&lt;br /&gt;
    id int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
    category int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    password varchar(50) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    fullname varchar(254) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    shortname varchar(15) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    summary text NOT NULL,&lt;br /&gt;
    format tinyint(4) NOT NULL default &#039;1&#039;,&lt;br /&gt;
    teacher varchar(100) NOT NULL default &#039;Teacher&#039;,&lt;br /&gt;
    startdate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    enddate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    timemodified int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    PRIMARY KEY (id)&lt;br /&gt;
 ) TYPE=MyISAM;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;SUCCESS&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and so on, followed by: &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Main databases set up successfully.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see these, then there must have been some problem with the database or the configuration settings you defined in config.php. Check that PHP isn&#039;t in a restricted &amp;quot;Safe Mode&amp;quot; (commercial web hosts sometimes have safe mode turned on). You can check PHP variables by creating a little file containing &#039;&#039;&#039;&amp;lt;?php phpinfo() ?&amp;gt;&#039;&#039;&#039; and looking at it through a browser. Check all these and try this page again.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
You should now see a form where you can define more configuration variables for your installation, such as the default language, SMTP hosts and so on. Don&#039;t worry too much about getting everything right just now - you can always come back and edit these later on using the admin interface. The defaults are designed to be useful and secure for most sites. Scroll down to the bottom and click &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If (and only if) you find yourself getting stuck on this page, unable to continue, then your server probably has what I call the &amp;quot;buggy referrer&amp;quot; problem. This is easy to fix: just turn off the &amp;quot;secureforms&amp;quot; setting, then try to continue again.&lt;br /&gt;
&lt;br /&gt;
Next you will see more pages that print lots of status messages as they set up all the tables required by the various Moodle module. As before, they should all be &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;green&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
The next page is a form where you can define parameters for your Moodle site and the front page, such as the name, format, description and so on. Fill this out (you can always come back and change these later) and then press &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finally, you will then be asked to create a top-level administration user for future access to the admin pages. Fill out the details with your own name, email etc and then click &amp;quot;Save changes&amp;quot;. Not all the fields are required, but if you miss any important fields you&#039;ll be re-prompted for them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure you remember the username and password you chose for the administration user account, as they will be necessary to access the administration page in future.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(If for any reason your install is interrupted, or there is a system error of some kind that prevents you from logging in using the admin account, you can usually log in using the default username of &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;, with password &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Once successful, you will be returned to the home page of your new site! Note the administration links that appear down the left hand side of the page (these items also appear on a separate Admin page) - these items are only visible to you because you are logged in as the admin user. All your further administration of Moodle can now be done using this menu, such as:&lt;br /&gt;
&lt;br /&gt;
* creating and deleting courses&lt;br /&gt;
* creating and editing user accounts&lt;br /&gt;
* administering teacher accounts&lt;br /&gt;
* changing site-wide settings like themes etc&lt;br /&gt;
&lt;br /&gt;
But you are not done installing yet! There is one very important thing still to do (see the next section on cron).&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Installing Moodle Using Command Line ==&lt;br /&gt;
&lt;br /&gt;
Installing Moodle Using command line is just as easy as installing Moodle using web browser. &lt;br /&gt;
* First Go to the moodle root directory and then to admin directory inside the moodle root. &lt;br /&gt;
&lt;br /&gt;
 $cd /var/www/html/moodle/admin&lt;br /&gt;
&lt;br /&gt;
* Then simply use the following syntax to run the moodle command line installer&lt;br /&gt;
 $php cliupgrade.php --lang=en --webaddr=http://www.example.com --moodledir=/var/www/html/moodle --datadir=/var/moodledata --dbtype=mysql --dbhost=localhost --dbname=moodle --dbuser=root --prefix=mdl --verbose=1 --interactivelevel=2 &lt;br /&gt;
&lt;br /&gt;
More information about the options can be found using &lt;br /&gt;
$php cliupgrad.php --help&lt;br /&gt;
&lt;br /&gt;
Then you will see the following list of available options&lt;br /&gt;
&lt;br /&gt;
 --lang		 		Valid installed language for installation. Default is English(en)&lt;br /&gt;
 --webaddr			Web address for the Moodle site&lt;br /&gt;
 --moodledir			Location of the moodle web folder&lt;br /&gt;
 --datadir			Location of the moodle data folder (should not be web visible)&lt;br /&gt;
 --dbtype			Database type. Default it mysql&lt;br /&gt;
 --dbhost			Database host. Default localhost&lt;br /&gt;
 --dbname			Database name. Default is moodle&lt;br /&gt;
 --dbuser			Database user. Default is blank&lt;br /&gt;
 --dbpass			Database password. Default is blank&lt;br /&gt;
 --prefix			        Table prefix for above database tables. Default is mdl&lt;br /&gt;
 --verbose			0 No output, 1 Summarized output(Default), 2 Detailed output&lt;br /&gt;
 --interactivelevel	        0 Non interactive, 1 Semi interactive(Default), 2 Interactive&lt;br /&gt;
 --help				print out this help&lt;br /&gt;
&lt;br /&gt;
When you choose non interactive mode without any options all the default values are assumed.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Set up cron ==&lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
== Set up backups ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Backup settings| backup instructions]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Create a new course ==&lt;br /&gt;
&lt;br /&gt;
Now that Moodle is running properly, you can try creating a new course to play with.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Create a new course&amp;quot; from the Admin page (or the admin links on the home page).&lt;br /&gt;
&lt;br /&gt;
Fill out the form, paying special attention to the course format. You don&#039;t have to worry about the details too much at this stage, as everything can be changed later by the teacher. Note that the yellow help icons are everywhere to provide contextual help on any aspect.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;Save changes&amp;quot;, and you will be taken to a new form where you can assign teachers to the course. You can only add existing user accounts from this form - if you want to create a new teacher account then either ask the teacher to create one for themselves (see the login page), or create one for them using the &amp;quot;Add a new user&amp;quot; on the Admin page.&lt;br /&gt;
&lt;br /&gt;
Once done, the course is ready to customize, and is accessible via the &amp;quot;Courses&amp;quot; link on the home page.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
* [[Complete install packages]] might be an easier first time installs on some systems&lt;br /&gt;
* Help forum:  [http://moodle.org/mod/forum/view.php?id=28 Installation problems]&lt;br /&gt;
* [[Installing Apache, MySQL and PHP]] - Open source programs that can run Moodle on the web or on a desktop&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=42688 Selecting a web host for Moodle] forum discussion&lt;br /&gt;
* [[masquerading|Masquerading]] - Running Moodle behind a masquerading/NAT firewall&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[cs:Instalace]]&lt;br /&gt;
[[de:Installieren von Moodle]]&lt;br /&gt;
[[es:Instalación de moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;br /&gt;
[[nl:Installatiegids]]&lt;br /&gt;
[[pl:Instalacja Moodle]]&lt;br /&gt;
[[pt:Instalação do Moodle]]&lt;br /&gt;
[[ru:Установка Moodle]]&lt;br /&gt;
[[sk:Inštalácia]]&lt;br /&gt;
[[zh:安装Moodlezh:]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=37222</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=37222"/>
		<updated>2008-06-09T12:35:42Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Introduction */  grammar and punctuation corrections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 1.7}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 1.7 (and upwards) using the SQL*Server (MSSQL) RDBMS. Steps detailed below must be performed &#039;&#039;&#039;before&#039;&#039;&#039; installing Moodle itself.&lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9), although it &#039;&#039;&#039;might work with MSSQL 2000 (v.8) or newer&#039;&#039;&#039;. All the development process has been performed using MSSQL 2005 and there could be some &#039;&#039;&#039;unknown problems&#039;&#039;&#039; with previous releases.&lt;br /&gt;
&lt;br /&gt;
While PHP comes with one, more or less, standard extension (mssql) that provides access to MSSQL databases, early we found some hard limits on it. Basically such default extension has some limits that prevent us to use it at all (you can find more info about these problems [[Development:XMLDB problems#MSSQL, PHP, UTF-8 and UCS-2|here]]).&lt;br /&gt;
&lt;br /&gt;
So, in order to allow PHP (i.e. Moodle) to access to MSSQL DBs properly we have to install a &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; to save us from the problems related above. See the sections below for details about the various options.&lt;br /&gt;
&lt;br /&gt;
== Installation overview ==&lt;br /&gt;
&lt;br /&gt;
1. Get MSSQL Server installed and running. ([http://www.microsoft.com/sql/editions/express/default.mspx A free limited version, SQL Server Express Edition] is available for testing.)&lt;br /&gt;
:Make sure that you choose mixed authentication (Windows and local accounts) to keep things simpler later.  You&#039;ll be asked to define the  &amp;quot;sa&amp;quot; account password (it&#039;s the default System Administrator account which has full access to all databases by default).&lt;br /&gt;
&lt;br /&gt;
2. Make sure MS SQL Server can accept incoming TCP/IP connections on port 1433 (the standard one).&lt;br /&gt;
:You might need to explicitly allow this in your Windows firewall (see the Control Panel).  You may also need to edit options in the :&#039;&#039;&#039;SQL Server Configuration Manager&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Network Configuration&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Protocols&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;TCP/IP enabled&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Open the &amp;quot;SQL Server Management Studio&amp;quot; and create a new empty database.  If you are using the &amp;quot;sa&amp;quot; account then you don&#039;t need to do anything else here.&lt;br /&gt;
&lt;br /&gt;
4. Configure these settings in your created (and still empty) database:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true&lt;br /&gt;
:* Quoted Identifiers Enabled = true&lt;br /&gt;
&lt;br /&gt;
5. Get PHP installed with a web server.   Unless you want to do it under IIS or some other way, the packages on the [http://download.moodle.org Moodle download page] are a good solution.&lt;br /&gt;
&lt;br /&gt;
6. Choose one of the following specific sections for your server to install the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; installed and running properly on your PHP box.&lt;br /&gt;
&lt;br /&gt;
7. Set the following settings in your php.ini file&lt;br /&gt;
:* mssql.textlimit = 20971520&lt;br /&gt;
:* mssql.textsize = 20971520&lt;br /&gt;
:Also, don&#039;t forget to set one of the following &#039;&#039;&#039;alternatives&#039;&#039;&#039;, in order to get all the data properly &amp;quot;slashed&amp;quot;:&lt;br /&gt;
:* magic_quotes_gpc = Off  &#039;&#039;&#039;or&#039;&#039;&#039;&lt;br /&gt;
:* magic_quotes_gpc = On &#039;&#039;&#039;and&#039;&#039;&#039; magic_quotes_sybase = On &lt;br /&gt;
&lt;br /&gt;
8. With all this properly configured, you can continue with a [[Installing Moodle|standard Moodle installation]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Unix ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Important Note 1:&#039;&#039;&#039; Due to [http://bugs.php.net/bug.php?id=39213 one bug in PHP] it&#039;s highly recommendable to use PHP &amp;gt; 5.1.6 with FreeTDS ([http://tracker.moodle.org/browse/MDL-11810 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Important Note 2:&#039;&#039;&#039; Due to one bug in how FreeTDS handles nulls and empty values for some text types it&#039;s highly recommendable to use a recent version of FreeTDS (0.64 + official patches) ([http://tracker.moodle.org/browse/MDL-11810#action_38005 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you web server is on Linux or some other flavour of Unix, try FreeTDS, http://www.freetds.org (documentation at http://www.freetds.org/docs.html)&lt;br /&gt;
&lt;br /&gt;
Note that the download link above is a &#039;&#039;&#039;source download&#039;&#039;&#039;, so you will need to install and compile it properly.&lt;br /&gt;
&lt;br /&gt;
Once downloaded and uncompressed you must &#039;&#039;&#039;&amp;quot;configure, make, make install&amp;quot;&#039;&#039;&#039; it. This will deploy some stuff in the &amp;quot;/usr/local&amp;quot; directory of your machine, mainly:&lt;br /&gt;
* /usr/local/etc: where the freetds conf files will reside.&lt;br /&gt;
* /usr/local/lib: where compiled libraries will reside.&lt;br /&gt;
* /usr/local/bin: where some executables will reside.&lt;br /&gt;
&lt;br /&gt;
Then, you must configure FreeTDS to point to your MSSQL DB server. To do so, edit (or create) the /usr/local/etc/freetds.conf file and put in there exclusively these lines:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 7.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
At this point, and previously to build the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039;, you can test conectivity with your MSSQL DB using the &amp;quot;/usr/local/bin/tsql&amp;quot; executable. Just do this:&lt;br /&gt;
&lt;br /&gt;
  tsql -S serverhost -U dbowner -P dbpassword&lt;br /&gt;
&lt;br /&gt;
If everything is ok, you&#039;ll get this output:&lt;br /&gt;
&lt;br /&gt;
  locale is &amp;quot;es_ES.UTF-8&amp;quot;&lt;br /&gt;
  locale charset is &amp;quot;UTF-8&amp;quot;&lt;br /&gt;
  1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
just type, for example:&lt;br /&gt;
&lt;br /&gt;
  sp_help sysobjects&lt;br /&gt;
&lt;br /&gt;
and you might get some output from DB. Finally type:&lt;br /&gt;
&lt;br /&gt;
  exit&lt;br /&gt;
&lt;br /&gt;
and you&#039;ll be out from the &amp;quot;tsql&amp;quot; command line interpreter.&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve successfully built, configured and tested FreeTDS it is time to create the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; that will provide us with the capacity of handling MSSQL DBs from within Moodle. To do so, you&#039;ll need configure your PHP server adding this new option to the usual ones:&lt;br /&gt;
&lt;br /&gt;
  --with-mssql=/usr/local/ &lt;br /&gt;
&lt;br /&gt;
then, after the standard &amp;quot;make and make install&amp;quot; steps, your PHP server will be built with MSSQL support provided by FreeTDS.&lt;br /&gt;
&lt;br /&gt;
Finally, configure your Moodle config.php with this DB related info and continue with a normal Moodle install:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dbtype    = &#039;mssql_n&#039;;         // Required&lt;br /&gt;
 $CFG-&amp;gt;dbhost    = &#039;xxx.xxx.xxx.xxx&#039;; // IP of the MSSQL server (also proper hostname is allowed)&lt;br /&gt;
 $CFG-&amp;gt;dbname    = &#039;moodle&#039;;          // or whatever you called the database you created&lt;br /&gt;
 $CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;    // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
 $CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
 $CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
 $CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but &#039;&#039;&#039;never&#039;&#039;&#039; leave it blank.&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039; from Frank Kromann ([http://kromann.info/article.php?Id=11062598797760000 original details here]). Despite the name, it&#039;s FreeTDS compiled for Windows.  Many thanks to Frank for providing this DLL.  Here&#039;s how to set it up:&lt;br /&gt;
&lt;br /&gt;
1. Download the appropriate copy of php_dblib.dll from the list below, and save it into your /PHP/ext directory. (php_dblib.dll does not appear to be available for PHP 4.x at this time.)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://kromann.info/php5_1-Release_TS/php_dblib.dll php_dblib.dll for PHP 5.1.x]&lt;br /&gt;
&lt;br /&gt;
[http://kromann.info/php5_2-Release_TS/php_dblib.dll php_dblib.dll for PHP 5.2.x]&lt;br /&gt;
&lt;br /&gt;
[http://kromann.info/php6-Release_TS/php_dblib.dll php_dblib.dll for PHP 6.x]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. FreeTDS requires the .NET Framework v1.1 to be installed.  You can [http://www.microsoft.com/downloads/details.aspx?FamilyID=262d25e3-f589-4842-8157-034d1e7cf3a3&amp;amp;DisplayLang=en download it from the Microsoft website] along with its [http://www.microsoft.com/downloads/details.aspx?FamilyID=a8f5654f-088e-40b2-bbdb-a83353618b38&amp;amp;DisplayLang=en service pack].  Alternatively, if you do not wish to install this framework, you can [http://kromann.info/ms-libs/msvcr71.dll download the required DLL] from Frank&#039;s site, and save it into your /PHP root directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Edit your /PHP/php.ini file and add this line:&lt;br /&gt;
&lt;br /&gt;
  extension=php_dblib.dll &lt;br /&gt;
&lt;br /&gt;
Make sure that any lines referring to the php_mssql.dll extension are DISABLED (commented out).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Create a file called C:\freetds.conf with:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 7.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle config.php should include lines like these:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dbtype    = &#039;mssql_n&#039;;        // Required&lt;br /&gt;
 $CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // assuming MS SQL is on the same server, otherwise use an IP&lt;br /&gt;
 $CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // or whatever you called the database you created&lt;br /&gt;
 $CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
 $CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
 $CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
 $CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but &#039;&#039;&#039;never&#039;&#039;&#039; leave it blank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have a config.php file yet, it can be generated as normal from the Moodle installer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Restart or start your web server.  If Moodle still cannot communicate with the database server, please turn display_startup_errors to &amp;quot;On&amp;quot; in your /PHP/php.ini file, then restart the web server and check for any errors that may indicate incorrect DLL versions or missing dependencies.  These error reports, turned off by default in PHP, can be vital in locating a problem with new extension installations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
== Using ODBTP on Unix or Windows ==&lt;br /&gt;
&lt;br /&gt;
You can download ODBTP from http://odbtp.sourceforge.net/. Also you will access to the documentation from the same page.&lt;br /&gt;
&lt;br /&gt;
The downloaded package includes both the source code and some binaries to be installed in the server and some ready-to-use &#039;&#039;&#039;mssql extension alternatives&#039;&#039;&#039; for some platforms/PHP versions (so you won&#039;t need to compile it if your PHP server/version binary package is present).&lt;br /&gt;
&lt;br /&gt;
First of all, we have to install the Win32 service that comes with the package. Let&#039;s assume that it&#039;s going to run in the same Win32 machine where your MSSQL server is running (although it can run in any other Win32 server in your network).&lt;br /&gt;
&lt;br /&gt;
To do do, following the instructions present in http://odbtp.sourceforge.net/install.html, you must:&lt;br /&gt;
&lt;br /&gt;
# Create a directory on the Windows host where the service program files will reside, i.e., md odbtp.&lt;br /&gt;
# Copy the files odbtpctl.exe, odbtpsrv.exe and odbtpsrv.ini files from the winservice directory into the directory created in step 1.&lt;br /&gt;
# Edit the file odbtpsrv.ini of the previous step and this line: &amp;lt;pre&amp;gt;MaxRequestSize=20971520&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Open a command prompt (cmd) window on the Windows host.&lt;br /&gt;
# Change to the directory to which the service program files were copied, i.e., cd odbtp.&lt;br /&gt;
# Run the following commands to install and start the service:&lt;br /&gt;
#*   odbtpctl install&lt;br /&gt;
#*   odbtpctl start&lt;br /&gt;
# With these steps you should have one new service running in your host called &amp;quot;odbtp&amp;quot;. Verify it&#039;s present and running in the &amp;quot;Services&amp;quot; control panel.&lt;br /&gt;
# Don&#039;t forget to enable TCP/IP incoming connections to port 2799 in the host you have installed the service!&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s time to build the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039;. First of all, verify if, in the downloaded package, under the &amp;quot;php&amp;quot; dir, there is one extension suitable for your PHP server/version. If it&#039;s present, you can simply copy it to the php/extensions dir in your PHP server and skip next points about compiling it from source. It&#039;s important to point that, inside each directory, you&#039;ll find &#039;&#039;&#039;two different&#039;&#039;&#039; libraries/dll files. The one that must be copied to the extensions dir is the one called &#039;&#039;&#039;&amp;quot;php_odbtp_mssql.xxx&amp;quot;&#039;&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
If in the downloaded package isn&#039;t present the extension matching your PHP platform/version, you should build if from source files. To do that, just &#039;&#039;&#039;&amp;quot;configure, make, make install&amp;quot;&#039;&#039;&#039;. That will create some stuff under &amp;quot;/usr/local&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve successfully built ODBTP is time to create the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; that will provide us with the capacity of handling MSSQL DBs from within Moodle. To do so, just configure your PHP server adding this new option to the usual ones:&lt;br /&gt;
&lt;br /&gt;
  --with-odbtp-mssql&lt;br /&gt;
&lt;br /&gt;
then, after the standard &amp;quot;make and make install&amp;quot; steps, your PHP server will be built with MSSQL support provided by ODBTP.&lt;br /&gt;
&lt;br /&gt;
Finally, independently if we are using the binary extension provided in the download or if you have built it from source files, it&#039;s time to configure the extension. To do so, add this lines, if no present, to your php.ini file:&lt;br /&gt;
&lt;br /&gt;
  extension=php_odbtp.dll&lt;br /&gt;
&lt;br /&gt;
(only for Win32 PHP servers!)&lt;br /&gt;
&lt;br /&gt;
And, for all the server platforms: &lt;br /&gt;
&lt;br /&gt;
  [odbtp]&lt;br /&gt;
  odbtp.interface_file = &amp;quot;/path/to/your/odbtp.conf&amp;quot;&lt;br /&gt;
  odbtp.datetime_format = mdyhmsf&lt;br /&gt;
  odbtp.detach_default_queries = yes&lt;br /&gt;
&lt;br /&gt;
(where &#039;&#039;/path/to/your/odbtp.conf&amp;quot; is usually &amp;quot;/usr/local/etc/odbtp.conf&amp;quot;&amp;quot; for Unix systems and &amp;quot;C:\odbtp\odbtp.conf&amp;quot; for Windows systems)&lt;br /&gt;
&lt;br /&gt;
Then, edit such &amp;quot;odbtp.conf&amp;quot; file and put there these contents:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
  odbtp host = xxx.xxx.xxx (ip or hostname of the Win32 box running the ODBTP service)&lt;br /&gt;
  type = mssql&lt;br /&gt;
  unicode sql = yes&lt;br /&gt;
  use row cache = yes&lt;br /&gt;
  right trim text = yes&lt;br /&gt;
  var data size = 20971520&lt;br /&gt;
&lt;br /&gt;
With this, your PHP server will be able to connect with the MSSQL DB server using ODBTP. From here, just continue with the installation.&lt;br /&gt;
&lt;br /&gt;
Finally, if you find the ODBTP executables and &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; in binary formats, it only will be necessary to install them in your server (binary packages...) without the need to recompile anything (just the php.ini and odbtp.conf edition steps above will be necessary). Of course, it will be really welcome to have all those binary alternatives documented here.&lt;br /&gt;
&lt;br /&gt;
== Using ODBC on Windows ==&lt;br /&gt;
&lt;br /&gt;
{{Not for production sites}}&lt;br /&gt;
&lt;br /&gt;
1. Go to the &#039;&#039;&#039;Administrative Tools&#039;&#039;&#039;  control panel, then the &#039;&#039;&#039;Data Sources (ODBC)&#039;&#039;&#039; panel.&lt;br /&gt;
&lt;br /&gt;
2. Configure one new System/User DSN (call it, for example &amp;quot;moodle&amp;quot;). Dont forget to enable these options if the driver asks for them:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true&lt;br /&gt;
:* Quoted Identifiers Enabled = true&lt;br /&gt;
&lt;br /&gt;
3. Your Moodle config.php should include lines like these:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dbtype    = &#039;odbc_mssql&#039;;     // Note this is different to all the other configs on this page!&lt;br /&gt;
 $CFG-&amp;gt;dbhost    = &#039;moodle&#039;;         // Where this matches the Data source name you chose above&lt;br /&gt;
 $CFG-&amp;gt;dbname    = &#039;&#039;&#039;&#039;&#039;&#039;&#039;;               // Keep it blank!!&lt;br /&gt;
 $CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
 $CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
 $CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
 $CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but &#039;&#039;&#039;never&#039;&#039;&#039; leave it blank.&lt;br /&gt;
&lt;br /&gt;
4. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
&lt;br /&gt;
[[Installing Oracle for PHP]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:XMLDB]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=34602</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=34602"/>
		<updated>2008-04-05T18:34:38Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Maximum upload file size - how to change it? */  fixed broken link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FAQ}}&lt;br /&gt;
==Table of Contents==&lt;br /&gt;
__TOC__&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;?PHP phpinfo() ?&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== System information needed for Installation Forum ==&lt;br /&gt;
When posting questions to the installation forum, try to provide as much background information as possible about your moodle system. Use this template to copy and paste into your post:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* Browser name (version also if possible):&lt;br /&gt;
* Moodle version:&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached?(Y/N):&lt;br /&gt;
* Phpinfo attached? (Y/N):&lt;br /&gt;
&lt;br /&gt;
For the last two items, try to include the following in your post as an attachment:&lt;br /&gt;
* A copy of your phpinfo output as shown in your browser (see the instructions above for an explanation of how to obtain this).&lt;br /&gt;
* A copy of the Moodle configuration file. This is located in the directory moodle and is named config.php&lt;br /&gt;
&lt;br /&gt;
Copy and paste both of these into a single text file (using vi, Notepad, etc) and attach this to your post.&lt;br /&gt;
&lt;br /&gt;
If you cannot provide your phpinfo, try to copy &amp;amp; paste and complete these in your post:&lt;br /&gt;
* Webserver (e.g. Apache/IIS) version:&lt;br /&gt;
* Database server (e.g. MySQL, PostgreSQL) version:&lt;br /&gt;
* PHP version:&lt;br /&gt;
&lt;br /&gt;
For installation on web hosting accounts: contact your support desk who should be able to tell you this information.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Security Warning&#039;&#039;&#039;: Make sure you edit any files and delete any passwords before posting onto the forum.&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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. Please remember that manually editing the file is not recommended and may lead to blank pages, especially if there are additional spaces and/or lines after the final php closing tag &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==Running a health check==&lt;br /&gt;
Moodle contains a script that will help identify common php and webserver configuration problems as well as configuration problems. It is a good idea to run this script to check if you are having post-installation problems. Use your browser to run this file:&lt;br /&gt;
&lt;br /&gt;
 http://www.mymoodle.com/moodle/admin/health.php&lt;br /&gt;
&lt;br /&gt;
Change the above line if you have installed moodle in the webroot instead of a folder inside the webroot.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
* &#039;&#039;&#039;Generic Packages&#039;&#039;&#039;: If your server does not meet the [[Installing_Moodle#Requirements | requirements]] for the current version of Moodle, 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 http://download.moodle.org/stable15. 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, or alternatively use these URLs for zip or tgz downloads:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].tgz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Changes made in the version in the last month are listed in the &amp;quot;CHANGES&amp;quot; file in the directory listing. The files you download contain Moodle code and are not the Windows or Mac packages - so you need to have a webserver, a database server and PHP already installed. The earliest version available is Moodle 1.3.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download previous releases of the 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 previous releases of the Mac pacakges, 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;
* &#039;&#039;&#039;Using CVS&#039;&#039;&#039;: You can also use CVS to download older releases and incremental releases of the Moodle generic packages, e.g. Moodle 1.5.4 - see the [[CVS_for_Administrators | CVS documentation]].&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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. &lt;br /&gt;
* &#039;&#039;&#039;Using the php.ini file&#039;&#039;&#039;: The log settings are contained in the php.ini file stored on the server. If you don&#039;t know where that is, edit your Moodle &#039;&#039;config.php&#039;&#039; and add the following as the second line&lt;br /&gt;
&lt;br /&gt;
  phpinfo();&lt;br /&gt;
&lt;br /&gt;
:then reload the web page. Look for the entry &#039;&#039;&#039;Configuration File (php.ini) Path&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:When you have located php.ini open it in your favorite text editor. Find the &#039;&#039;&#039;Error handling and logging&#039;&#039;&#039; section of the php.ini file. Make sure that both &#039;&#039;&#039;display_errors = On&#039;&#039;&#039;, &#039;&#039;&#039;display_startup_errors = On&#039;&#039;&#039; and &#039;&#039;&#039;log_errors = On&#039;&#039;&#039; are present and uncommented. Check the value of &#039;&#039;&#039;error_log&#039;&#039;&#039; - this tells you the location of the file errors are logged to. If it is commented out then errors will be sent to the web server error log file. Remember, if you make any changes to this file you will need to restart the web server (or just reboot the server).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Using ini_set commands&#039;&#039;&#039;: If you are using Moodle 1.7 or higher, the previous steps are not enough. In those versions error logging parameters are dependant on certain administrative settings that you specify in the debugging section. The problem is that if you can&#039;t access the administrative pages, you can&#039;t set the debugging options. So the only way to modify them is by adding the following lines to your config.php file, just before the last line (the one containing a single&#039;?&amp;gt;&#039; only):&lt;br /&gt;
&lt;br /&gt;
  ini_set (&#039;display_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;log_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;display_startup_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;error_reporting&#039;, E_ALL);&lt;br /&gt;
&lt;br /&gt;
:This will enable the same settings specified above even if Moodle sets them otherwise. &lt;br /&gt;
:&#039;&#039;&#039;Important&#039;&#039;&#039;: Remember to put them just before the last line of config.php.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==Any text I add with an apostrophe (&#039;) or a quote (&amp;quot;) causes errors or comes up with a slash added==&lt;br /&gt;
&lt;br /&gt;
Problems caused by apostrophes are caused by incorrect &amp;quot;magic quotes&amp;quot; settings. Moodle requires the following settings in the php.ini file (which are usually the default):&lt;br /&gt;
&lt;br /&gt;
 magic_quotes_gpc = On&lt;br /&gt;
 magic_quotes_runtime = Off&lt;br /&gt;
&lt;br /&gt;
Please see [[Installing Moodle]] for more details.&lt;br /&gt;
&lt;br /&gt;
If you are using [[Debian_GNU/Linux_installation|Debian]] then the problem might be in the version of PHP that you have installed. Have a look at this [http://tracker.moodle.org/browse/MDL-9691 bug report ]  to see if it matches your situation.&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.&lt;br /&gt;
&lt;br /&gt;
Basically, you need to set up a process to regularly call the script &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://yoursite/admin/cron.php&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
Tips:&lt;br /&gt;
* Try the default settings in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039;. This generally works.&lt;br /&gt;
*Make sure that &#039;&#039;allowuseremailcharset&#039;&#039; in &#039;&#039;Administration &amp;gt; Server &amp;gt; Email&#039;&#039; is set to No. Setting this to Yes can cause a problem in some versions of Moodle.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
==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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==I can&#039;t log in - I just stay stuck on the login screen==&lt;br /&gt;
&lt;br /&gt;
The most common cause for this is that your own computer (not your Moodle server) has 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;
&lt;br /&gt;
The server admin can also fix this for everyone by changing the &#039;&#039;secureforms&#039;&#039; variable to &#039;No&#039; in the security section of Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]].&lt;br /&gt;
&lt;br /&gt;
Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script &amp;lt;nowiki&amp;gt;http://yourserver/moodle/lib/session-test.php&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==I keep getting this error: A server error that affects your login session was detected.==&lt;br /&gt;
&lt;br /&gt;
Please refer to the Using Moodle forum discussion [http://moodle.org/mod/forum/discuss.php?d=73716 A server error that affects your login session was detected. Please login again or restart your browser.].&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==I keep getting this 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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
If you are not using Apache 2 and you still have this problem (unlikely) then you can switch Moodle to use an alternative method. The disadvantages are a slight loss of performance for your users and you won&#039;t be able to use relative links within HTML resources.&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
 $CFG-&amp;gt;dirroot = &amp;quot;d:\inetpub\sites\www.yoursite.com\web\moodle&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL. 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, set these lines in your &#039;&#039;php.ini&#039;&#039; file and reload the web page.&lt;br /&gt;
&lt;br /&gt;
 display_errors = On&lt;br /&gt;
 display_startup_errors = On&lt;br /&gt;
&lt;br /&gt;
To determine if MySQL 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;
 phpinfo();&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if MySQL is supported. If not look for a package you are missing.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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 [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your 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. &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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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. This will be an abrupt hang with half the page displayed in the browser and/or other outputs removed, e.g. the “Scroll to continue” link is displayed but no “Continue” button is there. If this is the case, it is usually a mysql error and not a php error. Check that there is no limit placed on your mysql database, e.g. a &amp;quot;questions&amp;quot; limit.&lt;br /&gt;
&lt;br /&gt;
*If the install is on a webhost, adding the following line to the .htaccess file in the moodle directory has been known to solve the problem.&lt;br /&gt;
 AddType x-mapp-php5 .php&lt;br /&gt;
&lt;br /&gt;
*Try also renaming the .htaccess file so that it is disabled.&lt;br /&gt;
&lt;br /&gt;
*You may also want to look and see if you&#039;ve customized any of your code.  Look at the last successful table, and then look at the block, mod, or other code that is referenced by that table.  For example, if your install hangs and continues to say that the forum tables were successful as the last message, look at /mod/forum/ for any custom code.  If you have customized code, backup those files and replace with the correct files.  You can then restart the install by renaming config.php or reinstalling your database from the backup.  If your install is successful, you can make your code changes back into the stock Moodle code.&lt;br /&gt;
&lt;br /&gt;
*It may also be that the &amp;quot;memory_limit&amp;quot; in your php.ini is set too low. Please check your php.ini file and allocate the recommended amount (see [https://docs.moodle.org/en/Installing_Moodle#Requirements Moodle requirements]). For Moodle version 1.8 and above at least 40MB is  recommended.&lt;br /&gt;
&lt;br /&gt;
*A work-around to this problem is to setup a working Moodle system on your local PC or server using the [http://download.moodle.org Moodle Packages]. Once you have a running Moodle, [https://docs.moodle.org/en/Upgrading_Moodle#Backup_important_data backup the database] and import to your webhost. Then backup the Moodle code itself (the &amp;quot;moodle&amp;quot; directory on your PC) and copy this to your webhost using (for example) FTP. Finally, edit the moodle/config.php file for the new settings that have to be changed for the webhost.&lt;br /&gt;
&lt;br /&gt;
*To avoid this problem when upgrading, prefer to upgrade incrementally. For example: upgrade from 1.6.* to 1.7.* and then to 1.8.* rather than straight from 1.6.* to 1.8.*&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: When upgrading an existing database, the installation may appear to hang at the roles generation phase. This process can take a very long time - so please be patient.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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 because GD is not enabled on your server. GD is a library that allows image processing.&lt;br /&gt;
&lt;br /&gt;
1. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going into Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[Variables]] 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;
&lt;br /&gt;
2. 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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
&lt;br /&gt;
==I receive this error &amp;quot;500:Internal Server Error&amp;quot;==&lt;br /&gt;
You&#039;ll get this error message if there is a syntax error in your .htaccess or httpd.conf files. You will also see this error if your server does not support .htaccess files, especially if it is running PHPsuexec. Also, you may have a directive in your .htaccess or httpd.conf files which are not compatible with your web server version.&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==How do I uninstall Moodle?==&lt;br /&gt;
&#039;&#039;&#039;Moodle package installation&#039;&#039;&#039;: If you have downloaded a Moodle package, simply uninstall using your system commands. On Windows PCs, you should access the Control Panel -&amp;gt; Add/Remove Programs. Select the package name and click Change or Remove Programs.&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
==How do I upgrade Moodle? Do I just overwrite the files?==&lt;br /&gt;
Do not overwrite files, it may cause strange errors. You should read the [[Upgrade]] documentation before proceeding.&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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, 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;
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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&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;
The second place to check are the server files.  The php.ini file has a limit which will override any other setting. (Hint: remember to restart your server for changes to take effect).  For more help see:&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;
&lt;br /&gt;
&lt;br /&gt;
[[Installation_FAQ#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[nl:Installatie FAQ]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[ru:Установка FAQ]]&lt;br /&gt;
[[pl:Instalacja FAQ]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Converting_files_to_UTF-8&amp;diff=31754</id>
		<title>Converting files to UTF-8</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Converting_files_to_UTF-8&amp;diff=31754"/>
		<updated>2008-01-31T10:34:59Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: made it clear that &amp;quot;-script&amp;quot; is not part of the filename ToUtf8.txt&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 1.6}}&lt;br /&gt;
Some files, like custom language packs or language files from third party modules need to be converted to UTF-8 before they may be used in Moodle 1.6 with UTF-8 database.&lt;br /&gt;
&lt;br /&gt;
==*nix like computers (including Mac OS X)==&lt;br /&gt;
Generally, this may be done with the &#039;&#039;iconv&#039;&#039; command on Unix, Linux or a Mac. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;iconv -f original_charset -t utf-8 originalfile &amp;gt; newfile&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;see also the windows explanation - the script there is one for *nix computers, but used in a cygwin environment&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Windows computers==&lt;br /&gt;
For Windows, there are three methods of performing the conversion. &lt;br /&gt;
&lt;br /&gt;
=== Method 1 ===&lt;br /&gt;
* Open the flat file in PSPad (a freeware editor) : http://www.pspad.com&lt;br /&gt;
* Click on Format, UTF-8&lt;br /&gt;
* Save the file&lt;br /&gt;
&lt;br /&gt;
=== Method 2 ===&lt;br /&gt;
Download the [http://gnuwin32.sourceforge.net/packages/libiconv.htm Windows version] of the iconv program. Download the &amp;quot;Complete package, except source&amp;quot; and run the setup program. The executable is located in the bin folder. Run from the command prompt (Start -&amp;gt; Run -&amp;gt; cmd) and follow the instructions as above.&lt;br /&gt;
&lt;br /&gt;
=== Method 3 ===&lt;br /&gt;
The conversion may also be done by using [http://www.cygwin.com Cygwin], a Linux-like environment for Windows, and excecuting the iconv command in that environment. Here is an example of a working solution on Windows with [http://www.cygwin.com Cygwin]:&lt;br /&gt;
&lt;br /&gt;
* Create a text file, named ToUtf8.txt&lt;br /&gt;
* Fill it with the following code&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/bash&lt;br /&gt;
FROM=iso-8859-1&lt;br /&gt;
TO=UTF-8&lt;br /&gt;
ICONV=&amp;quot;iconv -f $FROM -t $TO&amp;quot;&lt;br /&gt;
# Convert&lt;br /&gt;
find ToUTF/ -type f -name &amp;quot;*&amp;quot; | while read fn; do&lt;br /&gt;
cp ${fn} ${fn}.bak&lt;br /&gt;
$ICONV &amp;lt; ${fn}.bak &amp;gt; ${fn}&lt;br /&gt;
rm ${fn}.bak&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two things should be changed for your local situation:&lt;br /&gt;
&lt;br /&gt;
# FROM is the originating encoding (the one your original files are in)&lt;br /&gt;
# ToUTF is the foldername where the files that need to be converted are in. This folder may contain subfolders. Make sure you have a backup!&lt;br /&gt;
&lt;br /&gt;
* Start Cygwin.&lt;br /&gt;
* With the &#039;&#039;cd foldername, cd.., ls&#039;&#039; commands, go to the folder on your windows machine where the ToUtf8.txt script and the ToUTF8 folder are in.&lt;br /&gt;
* Execute the script by typing &#039;&#039;sh ToUtf8.txt&#039;&#039; and your files will be converted.&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Language]]&lt;br /&gt;
[[Category:UTF-8]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Conversion de fichiers en UTF-8]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=31573</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=31573"/>
		<updated>2008-01-24T15:32:54Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Requirements */  fix grammar and punctuation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Firstly don&#039;t panic! :-)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install Moodle for the first time. For some of these steps it goes into a lot of detail to try and cover the majority of possible web server setups, so this page may look long and complicated. Don&#039;t panic, once you know how to do it you can install Moodle in minutes!&lt;br /&gt;
&lt;br /&gt;
If you have problems please read this page carefully - most common issues are answered in here. If you still have trouble, you can seek help from the Moodle community via  [http://moodle.org/course/view.php?id=5 moodle.org Using Moodle].&lt;br /&gt;
&lt;br /&gt;
Another option is to contact a [http://moodle.com/hosting/ Moodle Partner providing Moodle hosting] who can completely maintain Moodle for you, so that you can ignore all this and get straight into educating! A Moodle partner is the preferred option but if you decide to choose a hosting company that has cpanel then [http://otaru-jc.ac.jp/hagley/settingupmoodleonhostingwithcpanel.swf this tutorial will guide you]  through the process of choosing a host and setting up moodle via cpanel. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; some hosting companies offer one-click moodle install options, which whilst sometimes effective, usually use old (sometimes years old) versions of moodle and sometimes simply don&#039;t work. If one of these goes wrong, your best bet is often to start from scratch following the instructions here yourself. Its almost certainly quicker.&lt;br /&gt;
&lt;br /&gt;
If you want to run Moodle on your own computer and this page looks a bit daunting, then please see our guides: [[Installing AMP |Installing Apache, MySQL and PHP(AMP)]] or [[Complete install packages| how to install one of Moodle&#039;s complete packages]]. They provide alternative instructions to install all this on most popular platforms.&lt;br /&gt;
==Table of Contents==&lt;br /&gt;
__TOC__&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), but is also regularly tested with Windows XP/2000/2003 (WAMP), Solaris 10 (Sparc and x64), Mac OS X and Netware 6 operating systems. Support for PostgreSQL, Oracle and Microsoft SQL Server is also available.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Blank page problem while installing Moodle on Windows Vista may occur; following these steps: [[Installing Moodle on Windows Vista]] might help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Most web hosts support all of these requirements by default. You should contact your web host&#039;s support desk to check that this is the case &#039;&#039;&#039;before&#039;&#039;&#039; signing-up with them. It is especially important to ask about any PHP memory limits or MySQL question limits. If your prospective host does not provide a service which meets these requirements, or you are already signed up with them, ask them why and consider taking your business elsewhere if they do not change.&lt;br /&gt;
&lt;br /&gt;
The requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Hardware&#039;&#039;&#039; (unless you are using a hosted server). &lt;br /&gt;
* Disk space: 160MB free (min). You will require more free space to store your teaching materials.&lt;br /&gt;
* Memory: 256MB (min), 1GB (recommended). The general rule of thumb is that Moodle can support 50 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination. &lt;br /&gt;
&#039;&#039;&#039;Software&#039;&#039;&#039;&lt;br /&gt;
* Web server software. Most people use [[Apache]], but Moodle should work fine under any web server that supports [[PHP]], such as [[IIS]] on Windows platforms. PHP does impose requirements on versions of web servers, however these are complex and the general advice is to use the newest version possible of your chosen web server. &lt;br /&gt;
* PHP scripting language. (Please note that there have been issues installing Moodle with [http://www.php-accelerator.co.uk PHP-Accelerator]). There are currently two versions (or branches) of PHP available: PHP4 and PHP5 and the version requirements are listed below.&lt;br /&gt;
** For Moodle version 1.4 or later: PHP4 (version 4.1.0 or later) or PHP5 (version 5.1.0 or later) are supported.&lt;br /&gt;
** For Moodle version 1.6 or later: the PHP4 (version 4.3.0 or later) or PHP5 (version 5.1.0 or later) are supported. &lt;br /&gt;
** Future Moodle versions 2.0 or later will not support PHP4 and will require PHP5 (version 5.2.0 or later).&lt;br /&gt;
** PHP Settings&lt;br /&gt;
*** &#039;&#039;safe_mode&#039;&#039; needs to be OFF (check in your php.ini or Apache configuration file).&lt;br /&gt;
*** &#039;&#039;memory_limit&#039;&#039; should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.&lt;br /&gt;
*** &#039;&#039;session.save_handler&#039;&#039; needs to be set to files. &lt;br /&gt;
** PHP Extensions and libraries&lt;br /&gt;
*** The mbstring extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** The iconv extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** [http://www.libgd.org/ GD library] and the [http://www.freetype.org/ FreeType 2] library and extensions are needed to be able to look at the dynamic graphs that the logs pages make.&lt;br /&gt;
*** The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.&lt;br /&gt;
*** The pgsql extension is required if you are using the PostgreSQL database.&lt;br /&gt;
*** The zlib extension is required for zip/unzip functionality.&lt;br /&gt;
*** The curl extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The tokenizer extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).&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;
* A working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is &#039;&#039;the&#039;&#039; choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment. &lt;br /&gt;
** For Moodle 1.5 or later, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later). &lt;br /&gt;
** For Moodle 1.6 or later, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).&lt;br /&gt;
** For Moodle 1.7 or later, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
: MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting &amp;quot;strict mode&amp;quot; must be OFF (set to &amp;quot;&amp;quot; or &amp;quot;MYSQL40&amp;quot;) in the MySQL configuration file. &lt;br /&gt;
: PostgreSQL Notes: The minimum version of PostgreSQL is 7.4 and Moodle is widely used with 8.0 and 8.1.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== How many users? ==&lt;br /&gt;
&lt;br /&gt;
In addition to the hardware and software requirements, you will also need to think about the capacity of your Moodle installation in terms of the number of users it can handle. There are two numbers to plan for:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Browsing users&#039;&#039;&#039;: the maximum number of users able to browse your Moodle site. This is the number of computers in your organization or on your course (whichever is greater).&lt;br /&gt;
* &#039;&#039;&#039;Concurrent database users&#039;&#039;&#039;: the maximum number of concurrent database users (needed for Moodle activities such as quizzes). This is the number of users who will be using Moodle at the same time. In an educational institution, use your timetable/roster to obtain this figure.&lt;br /&gt;
&lt;br /&gt;
Once you know these figures for your users, you can start work out if your Moodle installation can support this capacity. The exact number of users depends on your hardware/software/network combination. Usually the amount of memory installed (RAM) is the deciding factor but a faster overall processor speed will also help in reducing waiting times for pages to load. &lt;br /&gt;
&lt;br /&gt;
The general rule of thumb for a single server is that the approx max concurrent users = RAM (GB) * 50 and the approx max browsing users = Approx max concurrent users * 5. As an example, a university with 500 total computers on campus and 100 concurrent users at any time will need approx 2GB of RAM on the one server to support the number of concurrent users.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Ask your provider what limits are placed on the number of concurrent database connections and the processor load. This will give a good estimate of the number of users your Moodle install can manage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; As of August 31, 2007, the moodle 1.8.2+ codes are still not suitable for large installation, especially if you have large number (e.g. 20,000+) of courses. The main reason is the codes related to ROLES are still not fully optimized with database queries and still need some work. If you are planning to use 1.8.x codes for a larger institution, please make sure that you have sufficient time to do your own testing and performance profiling.&lt;br /&gt;
&lt;br /&gt;
[Update] This performance issue has been improved quite a bit in the most recent 1.8.3+ version (see this thread discussion: http://moodle.org/mod/forum/discuss.php?d=83281). However, you should still plan with caution if you are planning to use Moodle 1.8.x code base for larger installation.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to get Moodle, either as a compressed package or via CVS. &lt;br /&gt;
* There are two types of compressed packages on the  [http://download.moodle.org/ download page: http://download.moodle.org/], the standard distribution with Moodle only files and the [[Complete install packages|complete install]], which contains programs to operate Moodle in a web environment.  &lt;br /&gt;
* To use CVS, helpful instructions are available at the [[CVS_for_Administrators | CVS for Administrators]] page. The full [http://cvs.moodle.org/moodle/ Moodle CVS repository] is also available for browsing. &lt;br /&gt;
&lt;br /&gt;
After downloading, unpack the archive using either &lt;br /&gt;
 tar -zxvf [filename]&lt;br /&gt;
or&lt;br /&gt;
 unzip [filename]&lt;br /&gt;
as appropriate. &lt;br /&gt;
&lt;br /&gt;
If using CVS, run the CVS Checkout command.&lt;br /&gt;
&lt;br /&gt;
You will now be left with a directory called &amp;quot;moodle&amp;quot;, 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;.&lt;br /&gt;
&lt;br /&gt;
If you are downloading Moodle to your local computer and then uploading it to your web site, it is usually better to upload the whole archive as one file, and then do the unpacking on the server. Even web hosting interfaces like cPanel allow you to uncompress archives in the &amp;quot;File Manager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Structure of moodle directory ===&lt;br /&gt;
&lt;br /&gt;
You can safely skip this section, but here is a quick summary of the contents of the Moodle folder, to help get you oriented:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;config.php&#039;&#039; - contains basic settings. This file does not come with Moodle - you will create it.&lt;br /&gt;
:&#039;&#039;install.php&#039;&#039; - the script you will run to create config.php&lt;br /&gt;
:&#039;&#039;version.php&#039;&#039; - defines the current version of Moodle code&lt;br /&gt;
:&#039;&#039;index.php&#039;&#039; - the front page of the site&lt;br /&gt;
:&#039;&#039;admin/&#039;&#039; - code to administrate the whole server&lt;br /&gt;
:&#039;&#039;auth/&#039;&#039; - plugin modules to authenticate users&lt;br /&gt;
:&#039;&#039;blocks/&#039;&#039; - plugin modules for the little side blocks on many pages&lt;br /&gt;
:&#039;&#039;calendar/&#039;&#039; - all the code for managing and displaying calendars&lt;br /&gt;
:&#039;&#039;course/&#039;&#039; - code to display and manage courses&lt;br /&gt;
:&#039;&#039;doc/&#039;&#039; - help documentation for Moodle (eg this page)&lt;br /&gt;
:&#039;&#039;files/&#039;&#039; - code to display and manage uploaded files&lt;br /&gt;
:&#039;&#039;lang/&#039;&#039; - texts in different languages, one directory per language&lt;br /&gt;
:&#039;&#039;lib/&#039;&#039; - libraries of core Moodle code&lt;br /&gt;
:&#039;&#039;login/&#039;&#039; - code to handle login and account creation&lt;br /&gt;
:&#039;&#039;mod/&#039;&#039; - all the main Moodle course modules are in here&lt;br /&gt;
:&#039;&#039;pix/&#039;&#039; - generic site graphics&lt;br /&gt;
:&#039;&#039;theme/&#039;&#039; - theme packs/skins to change the look of the site.&lt;br /&gt;
:&#039;&#039;user/&#039;&#039; - code to display and manage users&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Setting-up your system==&lt;br /&gt;
To ensure that Moodle will install successfully, you need to check that the web server settings are correct, then create a blank database for Moodle to use and finally create a directory on your hard disk for Moodle to save your materials and other files you upload into your courses.&lt;br /&gt;
&lt;br /&gt;
=== Check web server settings ===&lt;br /&gt;
&lt;br /&gt;
*Firstly, make sure that your web server is set up to use index.php as a default page (perhaps in addition to index.html, default.htm and so on). In Apache, this is done using a DirectoryIndex parameter in your httpd.conf file. Mine usually looks like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
:Just make sure index.php is in the list (and preferably towards the start of the list, for efficiency).&lt;br /&gt;
&lt;br /&gt;
*Secondly, &#039;&#039;&#039;if you are using Apache 2&#039;&#039;&#039;, then you should turn on the &#039;&#039;AcceptPathInfo&#039;&#039; variable, which allows scripts to be passed arguments like &amp;lt;nowiki&amp;gt;http://server/file.php/arg1/arg2&amp;lt;/nowiki&amp;gt;. This is essential to allow relative links between your resources, and also provides a performance boost for people using your Moodle web site. You can turn this on by adding these lines to your httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
=== Check PHP settings ===&lt;br /&gt;
Moodle requires a number of PHP settings to be active for it to work. &#039;&#039;&#039;On most servers these will already be the default settings&#039;&#039;&#039;.  However, some PHP servers (and some of the more recent PHP versions) may have things set differently. These are defined in PHP&#039;s configuration file (usually called &#039;&#039;&#039;php.ini&#039;&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
 magic_quotes_gpc = 1    (preferred but not necessary)&lt;br /&gt;
 magic_quotes_runtime = 0    (necessary)&lt;br /&gt;
 file_uploads = 1&lt;br /&gt;
 session.auto_start = 0&lt;br /&gt;
 session.bug_compat_warn = 0&lt;br /&gt;
&lt;br /&gt;
:You may also want to set other, optional php.ini file settings while you are already editing it. For instance, you may want to reset the maximum upload size of file attachments, which usually defaults to 2M(egabytes). For instance, to set these to 16 Megabytes:&lt;br /&gt;
 &lt;br /&gt;
 post_max_size = 16M&lt;br /&gt;
 upload_max_filesize = 16M&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Using a .htaccess file for webserver and PHP settings ===&lt;br /&gt;
&lt;br /&gt;
Use the above if you can directly edit your server&#039;s files, but if you are setting-up Moodle on a webhost, or don&#039;t have access to &#039;&#039;&#039;httpd.conf&#039;&#039;&#039; or &#039;&#039;&#039;php.ini&#039;&#039;&#039; on your server, or you have Moodle on a server with other applications that require different settings, then don&#039;t worry, you can often still override the default settings. This only works on Apache servers and only when Overrides have been allowed in the main Apache configuration.&lt;br /&gt;
&lt;br /&gt;
* Create a file called &#039;&#039;&#039;.htaccess&#039;&#039;&#039; in Moodle&#039;s main directory that contains lines like the following. &lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
 php_flag magic_quotes_gpc 1&lt;br /&gt;
 php_flag magic_quotes_runtime 0&lt;br /&gt;
 php_flag file_uploads 1&lt;br /&gt;
 php_flag session.auto_start 0&lt;br /&gt;
 php_flag session.bug_compat_warn 0&lt;br /&gt;
&lt;br /&gt;
:If you have Apache version 2 installed, add these lines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IfDefine APACHE2&amp;gt;&lt;br /&gt;
     AcceptPathInfo on&lt;br /&gt;
 &amp;lt;/IfDefine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Otherwise add this single line:&lt;br /&gt;
&lt;br /&gt;
 AcceptPathInfo on&lt;br /&gt;
&lt;br /&gt;
* Optionally, you can also do things like define the maximum size for uploaded files, etc by adding these lines:&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 0&lt;br /&gt;
 php_value upload_max_filesize 2M&lt;br /&gt;
 php_value post_max_size 2M&lt;br /&gt;
     &lt;br /&gt;
* The easiest thing to do is just copy the sample file from lib/htaccess and edit it to suit your needs. It contains further instructions. For example, in a Unix shell:&lt;br /&gt;
&lt;br /&gt;
 cp lib/htaccess .htaccess&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Use a .htaccess file only [http://httpd.apache.org/docs/1.3/howto/htaccess.html#when as a last resort] as it can have an impact on the performance of your Moodle site and cause pages to load slowly on your browser.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating an empty database ===&lt;br /&gt;
&lt;br /&gt;
You need to create an empty database (eg &amp;quot;&#039;&#039;moodle&#039;&#039;&amp;quot;) in your database system along with a special user (eg &amp;quot;moodleuser&amp;quot;) that has access to that database (and that database only). You could use the &amp;quot;root&amp;quot; user if you wanted to for a test server, but this is not recommended for a production system: if hackers manage to discover the password then your whole database system would be at risk, rather than just one database.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Warning&#039;&#039;&#039;: Bear in mind that, as of Moodle version 1.5.x, Moodle doesn&#039;t work with MySQL 5.x&#039;s strict mode setting (STRICT_TRANS_TABLES and/or STRICT_ALL_TABLES) -- see [http://moodle.org/mod/forum/discuss.php?d=58552 forum discussion]. So if you are using MySQL 5.x, edit MySQL&#039;s configuration file (called &amp;quot;my.ini&amp;quot; in Windows and &amp;quot;my.cnf&amp;quot; on Unix/Linux) and comment out that option or set it to &amp;lt;code&amp;gt;sql-mode=&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. You have to restart MySQL after changing this setting. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; If you do not have access to your server, use PHPMyAdmin (or another MySQL client) and enter the command &amp;lt;code&amp;gt;SET @@global.sql_mode=&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;;&amp;lt;/code&amp;gt; (be sure to use single quotes, and don&#039;t forget the semicolon).&lt;br /&gt;
&lt;br /&gt;
====Using a hosted server====&lt;br /&gt;
If you are using a webhost, they will probably have a control panel web interface for you to create your database.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;[http://www.cpanel.com/ cPanel]&#039;&#039;&#039; system is one of the most popular of these. To create a database in cPanel,&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;quot;&#039;&#039;&#039;MySQL Databases&#039;&#039;&#039;&amp;quot; icon.&lt;br /&gt;
# Type &amp;quot;moodle&amp;quot; in the database field and click &amp;quot;&#039;&#039;&#039;Add Database&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
# Type a username and password (not one you use elsewhere) in the respective fields and click &amp;quot;&#039;&#039;&#039;Add User&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
# Now use the &amp;quot;&#039;&#039;&#039;Add User to Database&#039;&#039;&#039;&amp;quot; button to give this new user account &amp;quot;&#039;&#039;&#039;ALL&#039;&#039;&#039;&amp;quot; rights to the new database.&lt;br /&gt;
# Note that the username and database names may be prefixed by your cPanel account name. When entering this information into the Moodle installer - use the full names.&lt;br /&gt;
&lt;br /&gt;
====Using the command line====&lt;br /&gt;
&lt;br /&gt;
If you have access to Unix or Windows command lines then you can do the same sort of thing by typing commands. You should do this using the MySQL Client program as follows (commands which you type-in are shown in bold):&lt;br /&gt;
&lt;br /&gt;
- Start the MySQL Client program:&lt;br /&gt;
 #&#039;&#039;&#039;mysql -u root -p&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;
 Your MySQL connection id is 2 to server version: 5.0.22-log&lt;br /&gt;
 &lt;br /&gt;
 Type &#039;help;&#039; or &#039;\h&#039; for help. Type &#039;\c&#039; to clear the buffer.&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The prompt changes to &amp;quot;mysql&amp;gt;&amp;quot; to indicate that you are now working in the MySQL Client program. When working in MySQL, all commands which you type-in must end in a semi-colon. (If you hit the Enter key without the final semi-colon, you&#039;ll get the line continuation symbol &#039;-&amp;gt;&#039;; this is your second chance to type the semi-colon and hit Enter.) &lt;br /&gt;
&lt;br /&gt;
- Begin by checking for any existing databases called &amp;quot;moodle&amp;quot; - if there are any you should change the name in all the commands which follow:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;SHOW DATABASES;&#039;&#039;&#039;&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | Database                |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | information_schema      |&lt;br /&gt;
 | mysql                   |&lt;br /&gt;
 | test                    |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 3 rows in set (0.03 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a database to store the Moodle tables. We&#039;ll call this &amp;quot;moodle&amp;quot;, as there are none with that name already in the above list, but change it if you need to.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;CREATE DATABASE moodle;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Change the default character set and collation of the &amp;quot;moodle&amp;quot; database to UTF8. Leave this out if you are installing Moodle 1.5 or earlier):&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a username and password to access the database &amp;quot;moodle&amp;quot; and grant database access permissions. We&#039;ll call the user &amp;quot;moodleuser&amp;quot; and set the password as &amp;quot;yourpassword&amp;quot;. It&#039;s a good idea to change these for your installation however most people keep the username as &amp;quot;moodleuser&amp;quot;. Remember the username and password you have set, as you&#039;ll need it in the configuration screens later. This is a long command so has been split over several lines by pressing the Return key.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;DROP,INDEX,ALTER ON moodle.*&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 0 rows affected (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Security Warnings&#039;&#039;&#039;: Never leave the password as the one shown here. Make sure you have a strong password (a mixture of letters and numbers, upper and lower case). Avoid granting &amp;quot;ALL&amp;quot; permissions on the database.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: For MySQL 4.0.1 or earlier, you don&#039;t need the CREATE TEMPORARY TABLES permission. &lt;br /&gt;
&lt;br /&gt;
- Exit the MySQL Client program:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;QUIT&#039;&#039;&#039;&lt;br /&gt;
 Bye&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
- Reload the grant tables using the mysqladmin program:&lt;br /&gt;
 #&#039;&#039;&#039;mysqladmin -u root -p reload&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
And some example command lines for PostgreSQL:&lt;br /&gt;
&lt;br /&gt;
   # su - postgres&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create user moodleuser createdb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create database moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;with encoding &#039;unicode&#039;&amp;lt;/font&amp;gt;;&amp;quot; -U moodleuser template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser nocreatedb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser with encrypted password &#039;yourpassword&#039;;&amp;quot; template1&lt;br /&gt;
   &amp;gt; su - root&lt;br /&gt;
   # /etc/init.d/postgresql reload&lt;br /&gt;
&lt;br /&gt;
If the Postgres create database command above (&amp;gt;psql -c &amp;quot;create database moodle...&amp;quot;) gives an error message you may want to try:&lt;br /&gt;
 psql -c &amp;quot;create database moodle with template=template1 encoding = &#039;unicode&#039; owner =  moodleuser &amp;lt;br&amp;gt;     location = &#039;/var/mydata&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the create database command asks you for a password, run the line containing &#039;encrypted password&#039; first before proceeding.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
* Step-by-step instructions on  [https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Ubuntu installation for Ubuntu(Debian)]&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
=== Creating the data directory (moodledata) ===&lt;br /&gt;
&lt;br /&gt;
Moodle will also need some space on your server&#039;s hard disk to store uploaded files, such as course documents and user pictures. The Moodle installer tries hard to create this directory for you but if it fails then you will have to create a directory for this purpose manually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Security warning&#039;&#039;&#039;: For security purposes, it&#039;s best that this directory is NOT accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web directory, but if you must have it in the web directory (and you are using Apache) then protect it by creating a file in the data directory called &#039;&#039;&#039;.htaccess&#039;&#039;&#039;, containing these lines:&lt;br /&gt;
&lt;br /&gt;
 order deny,allow&lt;br /&gt;
 deny from all&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ownership &amp;amp; Permissions&#039;&#039;&#039;: To make sure that Moodle can save uploaded files in this directory, check that the web server software has permission to read, write and execute in this directory. On Unix machines, this means setting the owner of the directory to be something like &amp;quot;nobody&amp;quot; or &amp;quot;apache&amp;quot;, and then giving that user read, write and execute permissions. As an example, to change the owner to &amp;quot;nobody&amp;quot; you could use:&lt;br /&gt;
&lt;br /&gt;
 chown -R nobody:apache moodledata&lt;br /&gt;
&lt;br /&gt;
To change the permissions so that the owner has read,write and execute permissions, use something like this:&lt;br /&gt;
&lt;br /&gt;
 chmod -R 0770 moodledata&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are receiving permission denied messages, try &#039;&#039;chmod -R 0770 moodledata&#039;&#039; and then adjust the settings so that they are more secure. A more secure setting is &#039;&#039;chmod -R 0750 moodledata&#039;&#039;. According to the comments in config-dist.php, &amp;quot;On hosting systems you might need to make sure that your group has no permissions at all while others have full permissions.&amp;quot; To do this you could use &#039;&#039;chmod -R 707 moodledata&#039;&#039;. See also the [[Security | security page]].&lt;br /&gt;
&lt;br /&gt;
Remember that by default moodle will issue a warning about moodle data directories created inside the web directory, but otherwise this directory can be located where you wish. You can later move or change the location of this directory, but if you do, be sure to edit the setting in the &#039;&#039;&#039;config.php&#039;&#039;&#039; file that sets this; e.g. if moodledata is under a directory called data, then it would look like this:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dataroot  = &#039;/data/moodledata&#039;;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CPanel and webhosts&#039;&#039;&#039;: On cPanel systems you can use the &amp;quot;File Manager&amp;quot; to find the folder, click on it, then choose &amp;quot;Change Permissions&amp;quot;. On many shared hosting servers, you will probably need to restrict all file access to your &amp;quot;group&amp;quot; (to prevent other webhost customers from looking at or changing your files), but provide full read/write access to everyone else (which will allow the web server to access your files). Speak to your server administrator if you are having trouble setting this up securely. In particular it will not be possible to create a usable data directory on sites that use a PHP feature known as &amp;quot;&#039;&#039;&#039;Safe Mode&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Run the installer script to create config.php ==&lt;br /&gt;
&lt;br /&gt;
To run the installer script (install.php), just try to access your Moodle main URL using a web browser, or access &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourserver/install.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; directly.&lt;br /&gt;
&lt;br /&gt;
(The Installer will try to set a session cookie. If you get a popup warning in your browser make sure you accept that cookie!)&lt;br /&gt;
&lt;br /&gt;
Moodle will detect that configuration is necessary and will lead you through some screens to help you create a new configuration file called &#039;&#039;&#039;config.php&#039;&#039;&#039;. At the end of the process Moodle will try and write the file into the right location, otherwise you can press a button to download it from the installer and then upload &#039;&#039;&#039;config.php&#039;&#039;&#039; into the main Moodle directory on the server.&lt;br /&gt;
&lt;br /&gt;
Along the way the installer will test your server environment and give you suggestions about how to fix any problems. For most common issues these suggestions should be sufficient, but if you get stuck, check in the Installation Forum for more help.&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Go to the admin page to continue configuration ==&lt;br /&gt;
&lt;br /&gt;
Once the basic config.php has been correctly created in the previous step, trying to access the front page of your site will take you to the &amp;quot;admin&amp;quot; page for the rest of the configuration.&lt;br /&gt;
&lt;br /&gt;
The first time you access this admin page, you will be presented with a GPL &amp;quot;shrink wrap&amp;quot; agreement with which you must agree before you can continue with the setup.&lt;br /&gt;
&lt;br /&gt;
Now Moodle will start setting up your database and creating tables to store data. Firstly, the main database tables are created. You should see a number of SQL statements followed by status messages that look like this:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE course (&lt;br /&gt;
    id int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
    category int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    password varchar(50) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    fullname varchar(254) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    shortname varchar(15) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    summary text NOT NULL,&lt;br /&gt;
    format tinyint(4) NOT NULL default &#039;1&#039;,&lt;br /&gt;
    teacher varchar(100) NOT NULL default &#039;Teacher&#039;,&lt;br /&gt;
    startdate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    enddate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    timemodified int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    PRIMARY KEY (id)&lt;br /&gt;
 ) TYPE=MyISAM;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;SUCCESS&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and so on, followed by: &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Main databases set up successfully.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see these, then there must have been some problem with the database or the configuration settings you defined in config.php. Check that PHP isn&#039;t in a restricted &amp;quot;Safe Mode&amp;quot; (commercial web hosts sometimes have safe mode turned on). You can check PHP variables by creating a little file containing &#039;&#039;&#039;&amp;lt;?php phpinfo() ?&amp;gt;&#039;&#039;&#039; and looking at it through a browser. Check all these and try this page again.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
You should now see a form where you can define more configuration variables for your installation, such as the default language, SMTP hosts and so on. Don&#039;t worry too much about getting everything right just now - you can always come back and edit these later on using the admin interface. The defaults are designed to be useful and secure for most sites. Scroll down to the bottom and click &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If (and only if) you find yourself getting stuck on this page, unable to continue, then your server probably has what I call the &amp;quot;buggy referrer&amp;quot; problem. This is easy to fix: just turn off the &amp;quot;secureforms&amp;quot; setting, then try to continue again.&lt;br /&gt;
&lt;br /&gt;
Next you will see more pages that print lots of status messages as they set up all the tables required by the various Moodle module. As before, they should all be &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;green&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
The next page is a form where you can define parameters for your Moodle site and the front page, such as the name, format, description and so on. Fill this out (you can always come back and change these later) and then press &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finally, you will then be asked to create a top-level administration user for future access to the admin pages. Fill out the details with your own name, email etc and then click &amp;quot;Save changes&amp;quot;. Not all the fields are required, but if you miss any important fields you&#039;ll be re-prompted for them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure you remember the username and password you chose for the administration user account, as they will be necessary to access the administration page in future.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(If for any reason your install is interrupted, or there is a system error of some kind that prevents you from logging in using the admin account, you can usually log in using the default username of &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;, with password &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Once successful, you will be returned to the home page of your new site! Note the administration links that appear down the left hand side of the page (these items also appear on a separate Admin page) - these items are only visible to you because you are logged in as the admin user. All your further administration of Moodle can now be done using this menu, such as:&lt;br /&gt;
&lt;br /&gt;
* creating and deleting courses&lt;br /&gt;
* creating and editing user accounts&lt;br /&gt;
* administering teacher accounts&lt;br /&gt;
* changing site-wide settings like themes etc&lt;br /&gt;
&lt;br /&gt;
But you are not done installing yet! There is one very important thing still to do (see the next section on cron).&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Set up cron ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
&lt;br /&gt;
== Set up backups ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Backup settings| backup instructions]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Installing_Moodle#Table_of_Contents|Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
== Create a new course ==&lt;br /&gt;
&lt;br /&gt;
Now that Moodle is running properly, you can try creating a new course to play with.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Create a new course&amp;quot; from the Admin page (or the admin links on the home page).&lt;br /&gt;
&lt;br /&gt;
Fill out the form, paying special attention to the course format. You don&#039;t have to worry about the details too much at this stage, as everything can be changed later by the teacher. Note that the yellow help icons are everywhere to provide contextual help on any aspect.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;Save changes&amp;quot;, and you will be taken to a new form where you can assign teachers to the course. You can only add existing user accounts from this form - if you want to create a new teacher account then either ask the teacher to create one for themselves (see the login page), or create one for them using the &amp;quot;Add a new user&amp;quot; on the Admin page.&lt;br /&gt;
&lt;br /&gt;
Once done, the course is ready to customize, and is accessible via the &amp;quot;Courses&amp;quot; link on the home page.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
*[[Complete install packages]] might be an easier first time installs on some systems&lt;br /&gt;
* [[Installing Apache, MySQL and PHP]] - Open source programs that can run Moodle on the web or on a desktop&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=42688 Selecting a web host for Moodle] forum discussion&lt;br /&gt;
* [[masquerading|Masquerading]] - Running Moodle behind a masquerading/NAT firewall&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[cs:Instalace]]&lt;br /&gt;
[[de:Installieren von Moodle]]&lt;br /&gt;
[[es:Instalación de moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;br /&gt;
[[nl:Installatiegids]]&lt;br /&gt;
[[pl:Instalacja Moodle]]&lt;br /&gt;
[[pt:Instalação do Moodle]]&lt;br /&gt;
[[ru:Установка Moodle]]&lt;br /&gt;
[[sk:Inštalácia]]&lt;br /&gt;
[[zh:安装Moodlezh:]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Moodle_migration&amp;diff=30287</id>
		<title>Moodle migration</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Moodle_migration&amp;diff=30287"/>
		<updated>2007-12-16T06:45:21Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* See also */  added reference on internal/external access&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are times when you will need to move your Moodle site from one server to another. This is known as migrating your Moodle site and occurs when you need to change the &amp;lt;code&amp;gt;$CFG-&amp;gt;wwwroot&amp;lt;/code&amp;gt; value in your Moodle &#039;&#039;config.php&#039;&#039;. The process is divided into the following tasks:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Upgrade Moodle==&lt;br /&gt;
&lt;br /&gt;
When migrating Moodle it is often a good idea to take the opportunity to upgrade Moodle to the latest version. If you manage your own server, follow the instructions in [[Upgrading | upgrading moodle]], otherwise check if your host can upgrade for you.&lt;br /&gt;
&lt;br /&gt;
==Restore a single course==&lt;br /&gt;
&lt;br /&gt;
You may need to restore a single course from an old site to a new one, especially if you are testing the migration. When restoring a Moodle backup file to Moodle on a different server than the one used to create the backup, the absolute referenced links to files maybe broken. To fix this problem open the &#039;&#039;backup-coursename.zip&#039;&#039; file and edit the &#039;&#039;moodle.xml&#039;&#039; file replacing links with &amp;lt;code&amp;gt;$@FILEPHP@$&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, replace &amp;lt;nowiki&amp;gt;http://yourserver.com/file.php/243/&amp;lt;/nowiki&amp;gt; with &amp;lt;code&amp;gt;$@FILEPHP@$&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
When the file is restored it will use the correct file path for the new course.&lt;br /&gt;
&lt;br /&gt;
==Migrating a complete Moodle site==&lt;br /&gt;
&lt;br /&gt;
This involves moving a whole site from one server to another. If you are changing the domain/IP address to the new server you need to do these steps:&lt;br /&gt;
* &#039;&#039;&#039;Maintenance mode&#039;&#039;&#039;. Place your current Moodle site in maintenance mode to prevent any further additions to the Moodle database. Don&#039;t let administrators login during the migration as they are not affected by the maintenance mode setting.&lt;br /&gt;
* &#039;&#039;&#039;Backup your current Moodle database&#039;&#039;&#039;. Do this by following the instructions in the [[Upgrading | upgrading Moodle]] page. This will give you a text file containing the mysql dump.&lt;br /&gt;
* &#039;&#039;&#039;Copy the Moodle software&#039;&#039;&#039;. You will need to copy the Moodle code itself to the new server - upgrade the code to the latest version if you can.&lt;br /&gt;
* &#039;&#039;&#039;Change &amp;lt;code&amp;gt;$CFG-&amp;gt;wwwroot&amp;lt;/code&amp;gt;&#039;&#039;&#039;. In your (possibly new) Moodle directory, change the &amp;lt;code&amp;gt;$CFG-&amp;gt;wwwroot&amp;lt;/code&amp;gt; variable in the &#039;&#039;config.php&#039;&#039; file for the new server.&lt;br /&gt;
* &#039;&#039;&#039;Copy data directory contents (moodledata)&#039;&#039;&#039;. Copy the contents of your data directory (check for the value in &amp;lt;code&amp;gt;$CFG-&amp;gt;dataroot&amp;lt;/code&amp;gt;) to the new server. Check also that permissions remain the same on the new dataroot folder and change the value if you have changed its location on the new server.&lt;br /&gt;
* &#039;&#039;&#039;Change your Moodle URL&#039;&#039;&#039;. If you have a new URL, you&#039;ll need to change this in the Moodle database to the new server. This is needed as links to pictures, files, etc are stored as absolute links and will reference the old &amp;lt;code&amp;gt;$CFG-&amp;gt;wwwroot&amp;lt;/code&amp;gt; value. So when loading a mysql backup dump of the Moodle server into mysql on another server the absolute referenced links will be broken. There are two methods of doing this:&lt;br /&gt;
:(a) The first method changes the Moodle URL using the Moodle script &#039;&#039;replace.php&#039;&#039; while your site is currently running just before you backup the Moodle database. Point your browser to &amp;lt;nowiki&amp;gt;http://yourserver.com/admin/replace.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Enter the url for your old server (&amp;lt;nowiki&amp;gt;http://oldserver.com/&amp;lt;/nowiki&amp;gt;) and new server (&amp;lt;nowiki&amp;gt;http://newserver.com/&amp;lt;/nowiki&amp;gt;) and it will fix the mysql tables. You will also need to clear out any cached links by restarting your webserver. Now, take another backup of the Moodle database - this one will have the correct URLs.&lt;br /&gt;
&lt;br /&gt;
:(b) The second method is to backup the Moodle database first, then use the search and replace feature of your text editor (or use a unix tool like sed) to replace the old URL with the new one in the mysql backup file. Here is an example sed command:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;#sed -e &#039;s/oldserver.com/newserver.com/&#039; oldmysqldump.sql &amp;gt; newmysqldump.sql&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Tip&#039;&#039;&#039;: You may want to check the mysqldump file to see how the old server was referenced.&lt;br /&gt;
:After changing the URL, restore the mysql database&lt;br /&gt;
* &#039;&#039;&#039;Test the migration&#039;&#039;&#039;. To test the new install, access Moodle using your browser and the new server&#039;s URL. When you have tested that a number of links in the courses work, take the new Moodle site out of maintenance mode.&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;: [http://moodle.org/mod/forum/discuss.php?d=85812 Forum discussion] on migrating Moodle&#039;s data directory on a Windows system.&lt;br /&gt;
&lt;br /&gt;
==DNS changes==&lt;br /&gt;
&lt;br /&gt;
You may have had to change the DNS entries for the new Moodle site. If you have done so, it will take some time for the changes to replicate, so be patient.&lt;br /&gt;
&lt;br /&gt;
==Internal and external access==&lt;br /&gt;
&lt;br /&gt;
Lastly, check that the new site can be accessed internally and externally.  &lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=62959 Changing Moodle URL] forum discussion&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57477 Changing site address] forum discussion&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=76704 Upgrading whilst migrating] forum discussion&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=65450 Internal and external access] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Migration de Moodle]]&lt;br /&gt;
[[nl:Moodle verhuizen]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=admin/environment/php_extension/iconv&amp;diff=29259</id>
		<title>admin/environment/php extension/iconv</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=admin/environment/php_extension/iconv&amp;diff=29259"/>
		<updated>2007-11-26T01:45:09Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: removed false impression that enabling effects installation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To enable iconv in Windows package installations of Moodle: &lt;br /&gt;
&lt;br /&gt;
#Open the &#039;&#039;php.ini&#039;&#039; file found in the &#039;&#039;moodle/apache/bin&#039;&#039; folder&lt;br /&gt;
#Find the line: &amp;lt;code&amp;gt;;extension=php_iconv.dll&amp;lt;/code&amp;gt;&lt;br /&gt;
#Remove the &amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt; at the beginning of the line&lt;br /&gt;
#Restart apache for the change to take effect.&lt;br /&gt;
&lt;br /&gt;
This page needs to be enhanced by adding corresponding instructions for other kinds of Moodle installations.&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|PHP]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=admin/environment/php_extension/mbstring&amp;diff=29258</id>
		<title>admin/environment/php extension/mbstring</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=admin/environment/php_extension/mbstring&amp;diff=29258"/>
		<updated>2007-11-26T01:43:54Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: corrected scope of instructions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To enable the mbstring library in Windows package installations of Moodle:&lt;br /&gt;
&lt;br /&gt;
# Open the &#039;&#039;php.ini&#039;&#039; file found in the &#039;&#039;moodle/apache/bin&#039;&#039; folder or Windows folder&lt;br /&gt;
# Find the line: &amp;lt;code&amp;gt;;extension=php_mbstring.dll&amp;lt;/code&amp;gt;&lt;br /&gt;
# Remove the &amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt; at the beginning of the line&lt;br /&gt;
# Restart apache if necessary&lt;br /&gt;
&lt;br /&gt;
This page needs to be enhanced by adding corresponding instructions for other kinds of Moodle installations.&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|php extension]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=admin/environment/php_extension/iconv&amp;diff=29257</id>
		<title>admin/environment/php extension/iconv</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=admin/environment/php_extension/iconv&amp;diff=29257"/>
		<updated>2007-11-26T01:41:05Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: corrected scope of instructions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To install/enable iconv in Windows package installations of Moodle: &lt;br /&gt;
&lt;br /&gt;
#Open the &#039;&#039;php.ini&#039;&#039; file found in the &#039;&#039;moodle/apache/bin&#039;&#039; folder&lt;br /&gt;
#Find the line: &amp;lt;code&amp;gt;;extension=php_iconv.dll&amp;lt;/code&amp;gt;&lt;br /&gt;
#Remove the &amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt; at the beginning of the line&lt;br /&gt;
#Restart apache for the change to take effect.&lt;br /&gt;
&lt;br /&gt;
This page needs to be enhanced by adding corresponding instructions for other kinds of Moodle installations.&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|PHP]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Cron&amp;diff=29256</id>
		<title>Cron</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Cron&amp;diff=29256"/>
		<updated>2007-11-26T01:27:07Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: made description of cron.php more complete&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some of Moodle&#039;s modules require continual checks to perform tasks. For example, Moodle needs to check the discussion forums so it can mail out copies of posts to people who have subscribed.&lt;br /&gt;
&lt;br /&gt;
The script that does all this is located in the admin directory, and is called cron.php. However, it can not run itself, so you need to set up a mechanism where this script is run regularly (eg every five or ten minutes). This provides a &amp;quot;heartbeat&amp;quot; so that the script can perform functions at periods defined by each module. This kind of regular mechanism is known as a &#039;&#039;&#039;cron service&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The cron.php script looks through the mdl_modules table (assuming the default table prefix of course) in the Moodle database for modules scheduled to have their cron functions run; it then looks in each such module directory for a function called module-name_cron in the lib.php file and runs it.  It also looks through the mdl_block table for blocks scheduled for their cron mehtods (object functions) to be run; it then, for each such block, runs the cron method for a new object associated with that block (I&#039;m omitting details for the benefit of non-programmers; programmers can read admin/cron.php for themselves). These files (the lib.php files and the files where the block classes are defined) can contain cleanup functions, email functions or anything that needs to be run on a regular basis. For example, cron will trigger the system to create the backups of courses at the time specified in the administration settings. It also triggers any messaging module or forum email notifications, but not all functions are called each time the cron runs. Some functions, such as unenrolling students who have not logged in or deleting old copies of log files, are only run occasionally. The cron.php file has a section which will randomly call these core tasks approximately 1 in 5 times the cron runs.&lt;br /&gt;
&lt;br /&gt;
Note that the machine performing the cron &#039;&#039;&#039;does not need to be the same machine that is running Moodle&#039;&#039;&#039;. For example, if you have a limited web hosting service that does not have a cron service, then you might choose to run cron on another server or on your home computer. All that matters is that the cron.php file is called regularly.&lt;br /&gt;
&lt;br /&gt;
The load of this script is not very high, so 5 minutes is usually reasonable, but if you&#039;re worried about it you can reduce the time period to something like 15 minutes or even 30 minutes. It&#039;s best not to make the time period too long, as delaying mail-outs can slow down activity within the course. Remember that mail-outs also wait for the editing time to expire before being queued for sending.&lt;br /&gt;
&lt;br /&gt;
First, test that the script works by running it directly from your browser: &#039;&#039;&amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If cron is called from the command line by any user logged in to your Moodle it will create a temporary admin environment in order to run and then log the user out. You can disable command line running of cron by disabling the appropriate section in the cron.php file.&lt;br /&gt;
&lt;br /&gt;
Now, you need to set up some of way of running the script automatically and regularly.&lt;br /&gt;
&lt;br /&gt;
==On Windows systems==&lt;br /&gt;
&lt;br /&gt;
There are two different ways for setting-up Moodle cron.php on Windows systems:&lt;br /&gt;
&lt;br /&gt;
*Use the &#039;&#039;&#039;Moodle Cron package&#039;&#039;&#039;. The simplest way is to use this little package [http://download.moodle.org/download.php/sourceforge/MoodleCron-Setup.exe MoodleCron-Setup.exe], which makes this whole thing very easy by installing a small Windows service. Run it and forget about it! :-)&lt;br /&gt;
*Use a &#039;&#039;&#039;Scheduled Task&#039;&#039;&#039;. If you prefer to use the built-in Windows Scheduler or are having trouble with moodle-cron-for-windows package, you can use wget for windows or php from the command line and setup a scheduled task. Just follow these steps:&lt;br /&gt;
** Choose either the &#039;&#039;&#039;php.exe/php-win.exe (command line binary)&#039;&#039;&#039; or &#039;&#039;&#039;wget&#039;&#039;&#039;&lt;br /&gt;
::The php.exe or php-win.exe binary (for PHP version 5 or later) is installed in your php folder (e.g. c:\php) will give you better performance when running the cron script.&lt;br /&gt;
::If you want to use wget, download a compiled version of wget for windows from the native GNU Win32 ports (http://unxutils.sourceforge.net/), from Heiko Herold&#039;s wget for windows page (http://xoomer.virgilio.it/hherold/) or Bart Puype&#039;s wget for windows page (http://users.ugent.be/~bpuype/wget/). If you use Heiko Herold&#039;s package, copy all of the .DLL files to your C:\Windows\system32 directory. Copy the wget.exe file to c:\windows (this makes sure wget is always in the search path).&lt;br /&gt;
:* Setup a &#039;&#039;&#039;Scheduled Task&#039;&#039;&#039;. &lt;br /&gt;
:: - Go to Start &amp;gt;&amp;gt; Control Panel &amp;gt;&amp;gt; Scheduled Tasks &amp;gt;&amp;gt; Add Scheduled Task.&lt;br /&gt;
:: - Click &amp;quot;Next&amp;quot; to start the wizard:&lt;br /&gt;
:: - Click in the &amp;quot;Browse...&amp;quot; button and browse to c:\php\php.exe or c:\windows\wget.exe and click &amp;quot;Open&amp;quot;&lt;br /&gt;
:: - Type &amp;quot;Moodle Cron&amp;quot; as the name of the task and select &amp;quot;Daily&amp;quot; as the schedule. Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
:: - Select &amp;quot;12:00 AM&amp;quot; as the start time, perform the task &amp;quot;Every Day&amp;quot; and choose today&#039;s date as the starting date. Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
:: - Enter the username and password of the user the task will run under (it doesn&#039;t have to be a priviledged account at all). Make sure you type the password correctly. Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
:: - Mark the checkbox titled &amp;quot;Open advanced properties for this task when I click Finish&amp;quot; and click &amp;quot;Finish&amp;quot;.&lt;br /&gt;
:: - In the new dialog box, type the following in the &amp;quot;Run:&amp;quot; text box: &amp;lt;pre&amp;gt;c:\windows\wget.exe -q -O NUL http://my.moodle.site/moodle/admin/cron.php&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;c:\php\php-win.exe -f c:\moodle\admin\cron.php&amp;lt;/pre&amp;gt; Replace &amp;quot;c:\moodle&amp;quot; with the path to your moodle directory or &amp;quot;my.moode.site&amp;quot; with the name of your site.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
:: - Click on the &amp;quot;Schedule&amp;quot; tab and there in the &amp;quot;Advanced...&amp;quot; button.&lt;br /&gt;
:: - Mark the &amp;quot;Repeat task&amp;quot; checkbox and set &amp;quot;Every:&amp;quot; to 5 minutes, and set &amp;quot;Until:&amp;quot; to &amp;quot;Duration&amp;quot; and type &amp;quot;23&amp;quot; hours and &amp;quot;59&amp;quot; minutes.&lt;br /&gt;
:: - Click &amp;quot;OK&amp;quot; and you are done.&lt;br /&gt;
* &#039;&#039;&#039;Test your scheduled task&#039;&#039;&#039;. You can test that your scheduled task can run successfully by clicking it with the right button and chosing &amp;quot;Run&amp;quot;. If everything is correctly setup, you will briefly see a DOS command window while wget/php executes and fetches the cron page and then it disappears. If you refresh the scheduled tasks folder, you will see the &#039;&#039;Last Run Time column&#039;&#039; (in detailed folder view) reflects the current time, and that the Last Result column displays &amp;quot;0x0&amp;quot; (everything went OK). If either of these is different, then you should recheck your setup.&lt;br /&gt;
* &#039;&#039;&#039;Logging cron output&#039;&#039;&#039;. You may want to log the output of the cron script as it executes, in case you see the job is producing errors, backups are not being completed or users are experiencing delays in receiving forum emails. To do this, adjust the command so that it uses the php.exe and stores the output in a file called (for example c:\moodle\admin\cron.log). Here is an example of the php.exe command:&lt;br /&gt;
&amp;lt;pre&amp;gt;c:\php\php.exe -f c:\moodle\admin\cron.php &amp;gt; c:\moodle\admin\cron.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==On web hosting services==&lt;br /&gt;
&lt;br /&gt;
Your web-based control panel may have a web page that allows you to set up this cron process. &lt;br /&gt;
&lt;br /&gt;
If you are using CPanel, login then look for the heading &amp;quot;Advanced&amp;quot; on the page. Click on Cron Jobs -&amp;gt; Advanced (unix style). Enter the following for the cron to run every 30 minutes.&lt;br /&gt;
&lt;br /&gt;
 Email address for output: emailaddress@mydomain.con&lt;br /&gt;
 Minute:*/30&lt;br /&gt;
 Hour:*&lt;br /&gt;
 Day:*&lt;br /&gt;
 Month:*&lt;br /&gt;
 Weekday:* &lt;br /&gt;
 Command: wget -q -O /dev/null http://www.mydomain.com/moodle/admin/cron.php&lt;br /&gt;
&lt;br /&gt;
Click Commit Changes. Check your email for the output. An example is shown below:&lt;br /&gt;
&lt;br /&gt;
[[Image:Cpanel-cron-setup.JPG]]&lt;br /&gt;
&lt;br /&gt;
For other systems, look for a button called &amp;quot;Cron jobs&amp;quot;. In there you can put the same sort of Unix commands as listed below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have permissions to run the &#039;wget&#039; command on the server, you can use this php command:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/php -q /real/path/to/script/admin/cron.php&lt;br /&gt;
&lt;br /&gt;
For example: &lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/php -q /home/username/public_html/moodle/admin/cron.php&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t know what is the real path of your Moodle folder you can use the PHP command realpath.&lt;br /&gt;
&lt;br /&gt;
Another alternative, if you do not have permission to run the &#039;wget&#039; command, may be to use a curl command.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
curl --silent --compressed http://mydomain.com/moodle/admin/cron.php&lt;br /&gt;
&lt;br /&gt;
==Using the command line on Unix==&lt;br /&gt;
&lt;br /&gt;
There are different command line programs you can use to call the page from the command line. Not all of them may be available on a given server.&lt;br /&gt;
&lt;br /&gt;
For example, you can use a Unix utility like &#039;wget&#039;:&lt;br /&gt;
&lt;br /&gt;
 wget -q -O /dev/null &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note in this example that the output is thrown away (to /dev/null).&lt;br /&gt;
&lt;br /&gt;
A number of users of Moodle have found that &#039;wget&#039; sometimes fails. Especially if you have trouble with email digests not being sent on a daily basis to all users, an alternative command that solves the problem is:&lt;br /&gt;
&lt;br /&gt;
 php &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same thing using lynx:&lt;br /&gt;
&lt;br /&gt;
 lynx -dump &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt; &amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
Note in this example that the output is thrown away (to /dev/null).&lt;br /&gt;
&lt;br /&gt;
Alternatively you could use a standalone version of PHP, compiled to be run on the command line. The advantage with doing this is that your web server logs aren&#039;t filled with constant requests to cron.php. The disadvantage is that you need to have access to a command-line version of php.&lt;br /&gt;
&lt;br /&gt;
 /opt/bin/php /web/moodle/admin/cron.php&lt;br /&gt;
&lt;br /&gt;
==Using the crontab program on Unix==&lt;br /&gt;
&lt;br /&gt;
All that Cpanel does is provide a web interface to a Unix utility known as crontab. If you have a command line, you can set up crontab yourself using the command:&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and then adding one of the above commands like:&lt;br /&gt;
&lt;br /&gt;
 */30 * * * * wget -q -O /dev/null &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first five entries are the times to run values, followed by the command to run. The asterisk is a wildard, indicating any time. The above example means run the command &#039;&#039;wget -q -O /dev/null...&#039;&#039; every 30 minutes (*/30), every hour (*), every day of the month (*), every month (*), every day of the week (*). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;O&amp;quot; of &amp;quot;-O&amp;quot; is the capital letter not zero, and refers the output file destination, in this case &amp;quot;/dev/null&amp;quot; which is a black hole and discards the output. If you want to see the output of your cron.php then enter its url in your browser. &lt;br /&gt;
&lt;br /&gt;
* [http://linuxweblog.com/node/24 A basic crontab tutorial] &lt;br /&gt;
* [http://www.freebsd.org/cgi/man.cgi?query=crontab&amp;amp;apropos=0&amp;amp;sektion=5&amp;amp;manpath=FreeBSD+6.0-RELEASE+and+Ports&amp;amp;format=html Online version of the man page] &lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;&#039;beginners&#039;&#039;&#039;, &amp;quot;EDITOR=nano crontab -e&amp;quot; will allow you to edit the crontab using the [http://www.nano-editor.org/dist/v1.2/faq.html nano] editor. Ubuntu defaults to using the nano editor.&lt;br /&gt;
&lt;br /&gt;
Usually, the &amp;quot;crontab -e&amp;quot; command will put you into the &#039;vi&#039; editor. You enter &amp;quot;insert mode&amp;quot; by pressing &amp;quot;i&amp;quot;, then type in the line as above, then exit insert mode by pressing ESC. You save and exit by typing &amp;quot;:wq&amp;quot;, or quit without saving using &amp;quot;:q!&amp;quot; (without the quotes). Here is an [http://www.unix-manuals.com/tutorials/vi/vi-in-10-1.html intro] to the &#039;vi&#039; editor.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=41827 Cron - can someone give me a quick confirmation of function?] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Cron]]&lt;br /&gt;
[[fr:Cron]]&lt;br /&gt;
[[nl:Cron]]&lt;br /&gt;
[[sk:Cron]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=29100</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=29100"/>
		<updated>2007-11-23T10:35:22Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Creating the data directory (moodledata) */  added Apache &amp;quot;order&amp;quot; directive to make sure &amp;quot;deny&amp;quot; directive works&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Firstly don&#039;t panic! :-)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install Moodle for the first time. For some of these steps it goes into a lot of detail to try and cover the majority of possible web server setups, so this page may look long and complicated. Don&#039;t panic, once you know how to do it you can install Moodle in minutes!&lt;br /&gt;
&lt;br /&gt;
If you have problems please read this page carefully - most common issues are answered in here. If you still have trouble, you can seek help from the Moodle community via  [http://moodle.org/course/view.php?id=5 moodle.org Using Moodle].&lt;br /&gt;
&lt;br /&gt;
Another option is to contact a [http://moodle.com/hosting/ Moodle Partner providing Moodle hosting] who can completely maintain Moodle for you, so that you can ignore all this and get straight into educating! A Moodle partner is the preferred option but if you decide to choose a hosting company that has cpanel then [http://otaru-jc.ac.jp/hagley/settingupmoodleonhostingwithcpanel.swf this tutorial will guide you]  through the process of choosing a host and setting up moodle via cpanel. &lt;br /&gt;
&lt;br /&gt;
If you want to run Moodle on your own computer and this page looks a bit daunting, then please see our guides: [[Installing AMP |Installing Apache, MySQL and PHP(AMP)]] or [[Complete install packages| how to install one of Moodle&#039;s complete packages]]. They provide alternative instructions to install all this on most popular platforms.&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), but is also regularly tested with Windows XP/2000/2003 (WAMP), Solaris 10 (Sparc and x64), Mac OS X and Netware 6 operating systems. Support for PostgreSQL, Oracle and Microsoft SQL Server is also available.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Most web hosts support all of these requirements by default. You should contact your web host&#039;s support desk to check that this is the case &#039;&#039;&#039;before&#039;&#039;&#039; signing-up with them. It is especially important to ask about any PHP memory limits or MySQL question limits. If your prospective host does not provide a service which meets these requirements, or you are already signed up with them, ask them why and consider taking your business elsewhere if they do not change.&lt;br /&gt;
&lt;br /&gt;
The requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Hardware&#039;&#039;&#039; (unless you are using a hosted server). &lt;br /&gt;
* Disk space: 160MB free (min). You will require more free space to store your teaching materials.&lt;br /&gt;
* Memory: 256MB (min), 1GB (recommended). The general rule of thumb is that Moodle can support 50 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination. &lt;br /&gt;
&#039;&#039;&#039;Software&#039;&#039;&#039;&lt;br /&gt;
* Web server software. Most people use [[Apache]], but Moodle should work fine under any web server that supports [[PHP]], such as [[IIS]] on Windows platforms. PHP does impose requirements on versions of web servers, however these are complex and the general advice is to use the newest version possible of your chosen web server. &lt;br /&gt;
* PHP scripting language. (Please note that there have been issues installing Moodle with [http://www.php-accelerator.co.uk PHP-Accelerator]). There are currently two versions (or branches) of PHP available: PHP4 and PHP5 and the version requirements are listed below.&lt;br /&gt;
** For Moodle version 1.4 or later: PHP4 (version 4.1.0 or later) or PHP5 (version 5.1.0 or later) are supported.&lt;br /&gt;
** For Moodle version 1.6 or later: the PHP4 (version 4.3.0 or later) or PHP5 (version 5.1.0 or later) are supported. &lt;br /&gt;
** Future Moodle versions 2.0 or later will not support PHP4 and will require PHP5 (version 5.2.0 or later).&lt;br /&gt;
** PHP Settings&lt;br /&gt;
*** &#039;&#039;safe_mode&#039;&#039; needs to be OFF (check in your php.ini or Apache configuration file).&lt;br /&gt;
*** &#039;&#039;memory_limit&#039;&#039; should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operation systems require even more memory.&lt;br /&gt;
*** &#039;&#039;session.save_handler&#039;&#039; needs to be set to files. &lt;br /&gt;
** PHP Extensions and libraries&lt;br /&gt;
*** The mbstring extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** The iconv extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** [http://www.libgd.org/ GD library] and the [http://www.freetype.org/ FreeType 2] library and extensions are needed to be able to look at the dynamic graphs that the logs pages make.&lt;br /&gt;
*** The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.&lt;br /&gt;
*** The pgsql extension is required if you are using the PostgreSQL database.&lt;br /&gt;
*** The zlib extension is required for zip/unzip functionality.&lt;br /&gt;
*** The curl extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The tokenizer extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).&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;
* A working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is &#039;&#039;the&#039;&#039; choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment. &lt;br /&gt;
** For Moodle 1.5 or later, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later). &lt;br /&gt;
** For Moodle 1.6 or later, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).&lt;br /&gt;
** For Moodle 1.7 or later, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
: MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting &amp;quot;strict mode&amp;quot; must be OFF (set to &amp;quot;&amp;quot; or &amp;quot;MYSQL40&amp;quot;) in the MySQL configuration file. &lt;br /&gt;
: PostgreSQL Notes: The minimum version of PostgreSQL is 7.4 and Moodle is widely used with 8.0 and 8.1.&lt;br /&gt;
&lt;br /&gt;
== How many users? ==&lt;br /&gt;
&lt;br /&gt;
In addition to the hardware and software requirements, you will also need to think about the capacity of your Moodle installation in terms of the number of users it can handle. There are two numbers to plan for:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Browsing users&#039;&#039;&#039;: the maximum number of users able to browse your Moodle site. This is the number of computers in your organization or on your course (whichever is greater).&lt;br /&gt;
* &#039;&#039;&#039;Concurrent database users&#039;&#039;&#039;: the maximum number of concurrent database users (needed for Moodle activities such as quizzes). This is the number of users who will be using Moodle at the same time. In an educational institution, use your timetable/roster to obtain this figure.&lt;br /&gt;
&lt;br /&gt;
Once you know these figures for your users, you can start work out if your Moodle installation can support this capacity. The exact number of users depends on your hardware/software/network combination. Usually the amount of memory installed (RAM) is the deciding factor but a faster overall processor speed will also help in reducing waiting times for pages to load. &lt;br /&gt;
&lt;br /&gt;
The general rule of thumb for a single server is that the approx max concurrent users = RAM (GB) * 50 and the approx max browsing users = Approx max concurrent users * 5. As an example, a university with 500 total computers on campus and 100 concurrent users at any time will need approx 2GB of RAM on the one server to support the number of concurrent users.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Ask your provider what limits are placed on the number of concurrent database connections and the processor load. This will give a good estimate of the number of users your Moodle install can manage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; As of August 31, 2007, the moodle 1.8.2+ codes are still not suitable for large installation, especially if you have large number (e.g. 20,000+) of courses. The main reason is the codes related to ROLES are still not fully optimized with database queries and still need some work. If you are planning to use 1.8.x codes for a larger institution, please make sure that you have sufficient time to do your own testing and performance profiling.&lt;br /&gt;
&lt;br /&gt;
[Update] This performance issue has been improved quite a bit in the most recent 1.8.3+ version (see this thread discussion: http://moodle.org/mod/forum/discuss.php?d=83281). However, you should still plan with caution if you are planning to use Moodle 1.8.x code base for larger installation.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to get Moodle, either as a compressed package or via CVS. &lt;br /&gt;
* There are two types of compressed packages on the  [http://download.moodle.org/ download page: http://download.moodle.org/], the standard distribution with Moodle only files and the [[Complete install packages|complete install]], which contains programs to operate Moodle in a web environment.  &lt;br /&gt;
* To use CVS, helpful instructions are available at the [[CVS_for_Administrators | CVS for Administrators]] page. The full [http://moodle.cvs.sourceforge.net/moodle/moodle/ Moodle Sourceforge CVS repository] is also available for browsing. &lt;br /&gt;
&lt;br /&gt;
After downloading, unpack the archive using either &lt;br /&gt;
 tar -zxvf [filename]&lt;br /&gt;
or&lt;br /&gt;
 unzip [filename]&lt;br /&gt;
as appropriate. &lt;br /&gt;
&lt;br /&gt;
If using CVS, run the CVS Checkout command.&lt;br /&gt;
&lt;br /&gt;
You will now be left with a directory called &amp;quot;moodle&amp;quot;, 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;.&lt;br /&gt;
&lt;br /&gt;
If you are downloading Moodle to your local computer and then uploading it to your web site, it is usually better to upload the whole archive as one file, and then do the unpacking on the server. Even web hosting interfaces like cPanel allow you to uncompress archives in the &amp;quot;File Manager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Structure of moodle directory ===&lt;br /&gt;
&lt;br /&gt;
You can safely skip this section, but here is a quick summary of the contents of the Moodle folder, to help get you oriented:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;config.php&#039;&#039; - contains basic settings. This file does not come with Moodle - you will create it.&lt;br /&gt;
:&#039;&#039;install.php&#039;&#039; - the script you will run to create config.php&lt;br /&gt;
:&#039;&#039;version.php&#039;&#039; - defines the current version of Moodle code&lt;br /&gt;
:&#039;&#039;index.php&#039;&#039; - the front page of the site&lt;br /&gt;
:&#039;&#039;admin/&#039;&#039; - code to administrate the whole server&lt;br /&gt;
:&#039;&#039;auth/&#039;&#039; - plugin modules to authenticate users&lt;br /&gt;
:&#039;&#039;blocks/&#039;&#039; - plugin modules for the little side blocks on many pages&lt;br /&gt;
:&#039;&#039;calendar/&#039;&#039; - all the code for managing and displaying calendars&lt;br /&gt;
:&#039;&#039;course/&#039;&#039; - code to display and manage courses&lt;br /&gt;
:&#039;&#039;doc/&#039;&#039; - help documentation for Moodle (eg this page)&lt;br /&gt;
:&#039;&#039;files/&#039;&#039; - code to display and manage uploaded files&lt;br /&gt;
:&#039;&#039;lang/&#039;&#039; - texts in different languages, one directory per language&lt;br /&gt;
:&#039;&#039;lib/&#039;&#039; - libraries of core Moodle code&lt;br /&gt;
:&#039;&#039;login/&#039;&#039; - code to handle login and account creation&lt;br /&gt;
:&#039;&#039;mod/&#039;&#039; - all the main Moodle course modules are in here&lt;br /&gt;
:&#039;&#039;pix/&#039;&#039; - generic site graphics&lt;br /&gt;
:&#039;&#039;theme/&#039;&#039; - theme packs/skins to change the look of the site.&lt;br /&gt;
:&#039;&#039;user/&#039;&#039; - code to display and manage users&lt;br /&gt;
&lt;br /&gt;
== Setting-up your system==&lt;br /&gt;
To ensure that Moodle will install successfully, you need to check that the web server settings are correct, then create a blank database for Moodle to use and finally create a directory on your hard disk for Moodle to save your materials and other files you upload into your courses.&lt;br /&gt;
&lt;br /&gt;
=== Check web server settings ===&lt;br /&gt;
&lt;br /&gt;
*Firstly, make sure that your web server is set up to use index.php as a default page (perhaps in addition to index.html, default.htm and so on). In Apache, this is done using a DirectoryIndex parameter in your httpd.conf file. Mine usually looks like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
:Just make sure index.php is in the list (and preferably towards the start of the list, for efficiency).&lt;br /&gt;
&lt;br /&gt;
*Secondly, &#039;&#039;&#039;if you are using Apache 2&#039;&#039;&#039;, then you should turn on the &#039;&#039;AcceptPathInfo&#039;&#039; variable, which allows scripts to be passed arguments like &amp;lt;nowiki&amp;gt;http://server/file.php/arg1/arg2&amp;lt;/nowiki&amp;gt;. This is essential to allow relative links between your resources, and also provides a performance boost for people using your Moodle web site. You can turn this on by adding these lines to your httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
=== Check PHP settings ===&lt;br /&gt;
Moodle requires a number of PHP settings to be active for it to work. &#039;&#039;&#039;On most servers these will already be the default settings&#039;&#039;&#039;.  However, some PHP servers (and some of the more recent PHP versions) may have things set differently. These are defined in PHP&#039;s configuration file (usually called &#039;&#039;&#039;php.ini&#039;&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
 magic_quotes_gpc = 1    (preferred but not necessary)&lt;br /&gt;
 magic_quotes_runtime = 0    (necessary)&lt;br /&gt;
 file_uploads = 1&lt;br /&gt;
 session.auto_start = 0&lt;br /&gt;
 session.bug_compat_warn = 0&lt;br /&gt;
&lt;br /&gt;
:You may also want to set other, optional php.ini file settings while you are already editing it. For instance, you may want to reset the maximum upload size of file attachments, which usually defaults to 2M(egabytes). For instance, to set these to 16 Megabytes:&lt;br /&gt;
 &lt;br /&gt;
 post_max_size = 16M&lt;br /&gt;
 upload_max_filesize = 16M&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Using a .htaccess file for webserver and PHP settings ===&lt;br /&gt;
&lt;br /&gt;
Use the above if you can directly edit your server&#039;s files, but if you are setting-up Moodle on a webhost, or don&#039;t have access to &#039;&#039;&#039;httpd.conf&#039;&#039;&#039; or &#039;&#039;&#039;php.ini&#039;&#039;&#039; on your server, or you have Moodle on a server with other applications that require different settings, then don&#039;t worry, you can often still override the default settings. This only works on Apache servers and only when Overrides have been allowed in the main Apache configuration.&lt;br /&gt;
&lt;br /&gt;
* Create a file called &#039;&#039;&#039;.htaccess&#039;&#039;&#039; in Moodle&#039;s main directory that contains lines like the following. &lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
 php_flag magic_quotes_gpc 1&lt;br /&gt;
 php_flag magic_quotes_runtime 0&lt;br /&gt;
 php_flag file_uploads 1&lt;br /&gt;
 php_flag session.auto_start 0&lt;br /&gt;
 php_flag session.bug_compat_warn 0&lt;br /&gt;
&lt;br /&gt;
:If you have Apache version 2 installed, add these lines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IfDefine APACHE2&amp;gt;&lt;br /&gt;
     AcceptPathInfo on&lt;br /&gt;
 &amp;lt;/IfDefine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Otherwise add this single line:&lt;br /&gt;
&lt;br /&gt;
 AcceptPathInfo on&lt;br /&gt;
&lt;br /&gt;
* Optionally, you can also do things like define the maximum size for uploaded files, etc by adding these lines:&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 0&lt;br /&gt;
 php_value upload_max_filesize 2M&lt;br /&gt;
 php_value post_max_size 2M&lt;br /&gt;
     &lt;br /&gt;
* The easiest thing to do is just copy the sample file from lib/htaccess and edit it to suit your needs. It contains further instructions. For example, in a Unix shell:&lt;br /&gt;
&lt;br /&gt;
 cp lib/htaccess .htaccess&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Use a .htaccess file only [http://httpd.apache.org/docs/1.3/howto/htaccess.html#when as a last resort] as it can have an impact on the performance of your Moodle site and cause pages to load slowly on your browser.&lt;br /&gt;
&lt;br /&gt;
=== Creating an empty database ===&lt;br /&gt;
&lt;br /&gt;
You need to create an empty database (eg &amp;quot;&#039;&#039;moodle&#039;&#039;&amp;quot;) in your database system along with a special user (eg &amp;quot;moodleuser&amp;quot;) that has access to that database (and that database only). You could use the &amp;quot;root&amp;quot; user if you wanted to for a test server, but this is not recommended for a production system: if hackers manage to discover the password then your whole database system would be at risk, rather than just one database.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Warning&#039;&#039;&#039;: Bear in mind that, as of Moodle version 1.5.x, Moodle doesn&#039;t work with MySQL 5.x&#039;s strict mode setting (STRICT_TRANS_TABLES and/or STRICT_ALL_TABLES) -- see [http://moodle.org/mod/forum/discuss.php?d=58552 forum discussion]. So if you are using MySQL 5.x, edit MySQL&#039;s configuration file (called &amp;quot;my.ini&amp;quot; in Windows and &amp;quot;my.cnf&amp;quot; on Unix/Linux) and comment out that option or set it to &amp;lt;code&amp;gt;sql-mode=&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. You have to restart MySQL after changing this setting. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; If you do not have access to your server, use PHPMyAdmin (or another MySQL client) and enter the command &amp;lt;code&amp;gt;SET @@global.sql_mode=&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;;&amp;lt;/code&amp;gt; (be sure to use single quotes, and don&#039;t forget the semicolon).&lt;br /&gt;
&lt;br /&gt;
====Using a hosted server====&lt;br /&gt;
If you are using a webhost, they will probably have a control panel web interface for you to create your database.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;[http://www.cpanel.com/ cPanel]&#039;&#039;&#039; system is one of the most popular of these. To create a database in cPanel,&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;quot;&#039;&#039;&#039;MySQL Databases&#039;&#039;&#039;&amp;quot; icon.&lt;br /&gt;
# Type &amp;quot;moodle&amp;quot; in the database field and click &amp;quot;&#039;&#039;&#039;Add Database&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
# Type a username and password (not one you use elsewhere) in the respective fields and click &amp;quot;&#039;&#039;&#039;Add User&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
# Now use the &amp;quot;&#039;&#039;&#039;Add User to Database&#039;&#039;&#039;&amp;quot; button to give this new user account &amp;quot;&#039;&#039;&#039;ALL&#039;&#039;&#039;&amp;quot; rights to the new database.&lt;br /&gt;
# Note that the username and database names may be prefixed by your cPanel account name. When entering this information into the Moodle installer - use the full names.&lt;br /&gt;
&lt;br /&gt;
====Using the command line====&lt;br /&gt;
&lt;br /&gt;
If you have access to Unix or Windows command lines then you can do the same sort of thing by typing commands. You should do this using the MySQL Client program as follows (commands which you type-in are shown in bold):&lt;br /&gt;
&lt;br /&gt;
- Start the MySQL Client program:&lt;br /&gt;
 #&#039;&#039;&#039;mysql -u root -p&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;
 Your MySQL connection id is 2 to server version: 5.0.22-log&lt;br /&gt;
 &lt;br /&gt;
 Type &#039;help;&#039; or &#039;\h&#039; for help. Type &#039;\c&#039; to clear the buffer.&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The prompt changes to &amp;quot;mysql&amp;gt;&amp;quot; to indicate that you are now working in the MySQL Client program. When working in MySQL, all commands which you type-in must end in a semi-colon. (If you hit the Enter key without the final semi-colon, you&#039;ll get the line continuation symbol &#039;-&amp;gt;&#039;; this is your second chance to type the semi-colon and hit Enter.) &lt;br /&gt;
&lt;br /&gt;
- Begin by checking for any existing databases called &amp;quot;moodle&amp;quot; - if there are any you should change the name in all the commands which follow:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;SHOW DATABASES;&#039;&#039;&#039;&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | Database                |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | information_schema      |&lt;br /&gt;
 | mysql                   |&lt;br /&gt;
 | test                    |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 3 rows in set (0.03 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a database to store the Moodle tables. We&#039;ll call this &amp;quot;moodle&amp;quot;, as there are none with that name already in the above list, but change it if you need to.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;CREATE DATABASE moodle;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Change the default character set and collation of the &amp;quot;moodle&amp;quot; database to UTF8. Leave this out if you are installing Moodle 1.5 or earlier):&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a username and password to access the database &amp;quot;moodle&amp;quot; and grant database access permissions. We&#039;ll call the user &amp;quot;moodleuser&amp;quot; and set the password as &amp;quot;yourpassword&amp;quot;. It&#039;s a good idea to change these for your installation however most people keep the username as &amp;quot;moodleuser&amp;quot;. Remember the username and password you have set, as you&#039;ll need it in the configuration screens later. This is a long command so has been split over several lines by pressing the Return key.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;DROP,INDEX,ALTER ON moodle.*&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 0 rows affected (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Security Warnings&#039;&#039;&#039;: Never leave the password as the one shown here. Make sure you have a strong password (a mixture of letters and numbers, upper and lower case). Avoid granting &amp;quot;ALL&amp;quot; permissions on the database.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: For MySQL 4.0.1 or earlier, you don&#039;t need the CREATE TEMPORARY TABLES permission. &lt;br /&gt;
&lt;br /&gt;
- Exit the MySQL Client program:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;QUIT&#039;&#039;&#039;&lt;br /&gt;
 Bye&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
- Reload the grant tables using the mysqladmin program:&lt;br /&gt;
 #&#039;&#039;&#039;mysqladmin -u root -p reload&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
And some example command lines for PostgreSQL:&lt;br /&gt;
&lt;br /&gt;
   # su - postgres&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create user moodleuser createdb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create database moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;with encoding &#039;unicode&#039;&amp;lt;/font&amp;gt;;&amp;quot; -U moodleuser template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser nocreatedb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser with encrypted password &#039;yourpassword&#039;;&amp;quot; template1&lt;br /&gt;
   &amp;gt; su - root&lt;br /&gt;
   # /etc/init.d/postgresql reload&lt;br /&gt;
&lt;br /&gt;
If the Postgres create database command above (&amp;gt;psql -c &amp;quot;create database moodle...&amp;quot;) gives an error message you may want to try:&lt;br /&gt;
 psql -c &amp;quot;create database moodle with template=template1 encoding = &#039;unicode&#039; owner =  moodleuser &amp;lt;br&amp;gt;     location = &#039;/var/mydata&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the create database command asks you for a password, run the line containing &#039;encrypted password&#039; first before proceeding.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
* Step-by-step instructions on  [https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Ubuntu installation for Ubuntu(Debian)]&lt;br /&gt;
&lt;br /&gt;
=== Creating the data directory (moodledata) ===&lt;br /&gt;
&lt;br /&gt;
Moodle will also need some space on your server&#039;s hard disk to store uploaded files, such as course documents and user pictures. The Moodle installer tries hard to create this directory for you but if it fails then you will have to create a directory for this purpose manually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Security warning&#039;&#039;&#039;: For security purposes, it&#039;s best that this directory is NOT accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web directory, but if you must have it in the web directory (and you are using Apache) then protect it by creating a file in the data directory called &#039;&#039;&#039;.htaccess&#039;&#039;&#039;, containing these lines:&lt;br /&gt;
&lt;br /&gt;
 order deny,allow&lt;br /&gt;
 deny from all&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ownership &amp;amp; Permissions&#039;&#039;&#039;: To make sure that Moodle can save uploaded files in this directory, check that the web server software has permission to read, write and execute in this directory. On Unix machines, this means setting the owner of the directory to be something like &amp;quot;nobody&amp;quot; or &amp;quot;apache&amp;quot;, and then giving that user read, write and execute permissions. As an example, to change the owner to &amp;quot;nobody&amp;quot; you could use:&lt;br /&gt;
&lt;br /&gt;
 chown -R nobody:nobody moodledata&lt;br /&gt;
&lt;br /&gt;
To change the permissions so that the owner has read,write and execute permissions, use something like this:&lt;br /&gt;
&lt;br /&gt;
 chmod -R 0770 moodledata&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are receiving permission denied messages, try &#039;&#039;chmod -R 0770 moodledata&#039;&#039; and then adjust the settings so that they are more secure. A more secure setting is &#039;&#039;chmod -R 0750 moodledata&#039;&#039;. According to the comments in config-dist.php, &amp;quot;On hosting systems you might need to make sure that your group has no permissions at all while others have full permissions.&amp;quot; To do this you could use &#039;&#039;chmod -R 707 moodledata&#039;&#039;. See also the [[Security | security page]].&lt;br /&gt;
&lt;br /&gt;
Remember that by default moodle will issue a warning about moodle data directories created inside the web directory, but otherwise this directory can be located where you wish. You can later move or change the location of this directory, but if you do, be sure to edit the setting in the &#039;&#039;&#039;config.php&#039;&#039;&#039; file that sets this; e.g. if moodledata is under a directory called data, then it would look like this:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dataroot  = &#039;/data/moodledata&#039;;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CPanel and webhosts&#039;&#039;&#039;: On cPanel systems you can use the &amp;quot;File Manager&amp;quot; to find the folder, click on it, then choose &amp;quot;Change Permissions&amp;quot;. On many shared hosting servers, you will probably need to restrict all file access to your &amp;quot;group&amp;quot; (to prevent other webhost customers from looking at or changing your files), but provide full read/write access to everyone else (which will allow the web server to access your files). Speak to your server administrator if you are having trouble setting this up securely. In particular it will not be possible to create a usable data directory on sites that use a PHP feature known as &amp;quot;&#039;&#039;&#039;Safe Mode&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Run the installer script to create config.php ==&lt;br /&gt;
&lt;br /&gt;
To run the installer script (install.php), just try to access your Moodle main URL using a web browser, or access &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourserver/install.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; directly.&lt;br /&gt;
&lt;br /&gt;
(The Installer will try to set a session cookie. If you get a popup warning in your browser make sure you accept that cookie!)&lt;br /&gt;
&lt;br /&gt;
Moodle will detect that configuration is necessary and will lead you through some screens to help you create a new configuration file called &#039;&#039;&#039;config.php&#039;&#039;&#039;. At the end of the process Moodle will try and write the file into the right location, otherwise you can press a button to download it from the installer and then upload &#039;&#039;&#039;config.php&#039;&#039;&#039; into the main Moodle directory on the server.&lt;br /&gt;
&lt;br /&gt;
Along the way the installer will test your server environment and give you suggestions about how to fix any problems. For most common issues these suggestions should be sufficient, but if you get stuck, check in the Installation Forum for more help. &lt;br /&gt;
&lt;br /&gt;
== Go to the admin page to continue configuration ==&lt;br /&gt;
&lt;br /&gt;
Once the basic config.php has been correctly created in the previous step, trying to access the front page of your site will take you the &amp;quot;admin&amp;quot; page for the rest of the configuration.&lt;br /&gt;
&lt;br /&gt;
The first time you access this admin page, you will be presented with a GPL &amp;quot;shrink wrap&amp;quot; agreement with which you must agree before you can continue with the setup.&lt;br /&gt;
&lt;br /&gt;
Now Moodle will start setting up your database and creating tables to store data. Firstly, the main database tables are created. You should see a number of SQL statements followed by status messages that look like this:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE course (&lt;br /&gt;
    id int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
    category int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    password varchar(50) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    fullname varchar(254) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    shortname varchar(15) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    summary text NOT NULL,&lt;br /&gt;
    format tinyint(4) NOT NULL default &#039;1&#039;,&lt;br /&gt;
    teacher varchar(100) NOT NULL default &#039;Teacher&#039;,&lt;br /&gt;
    startdate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    enddate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    timemodified int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    PRIMARY KEY (id)&lt;br /&gt;
 ) TYPE=MyISAM;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;SUCCESS&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and so on, followed by: &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Main databases set up successfully.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see these, then there must have been some problem with the database or the configuration settings you defined in config.php. Check that PHP isn&#039;t in a restricted &amp;quot;Safe Mode&amp;quot; (commercial web hosts sometimes have safe mode turned on). You can check PHP variables by creating a little file containing &#039;&#039;&#039;&amp;lt;?php phpinfo() ?&amp;gt;&#039;&#039;&#039; and looking at it through a browser. Check all these and try this page again.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
You should now see a form where you can define more configuration variables for your installation, such as the default language, SMTP hosts and so on. Don&#039;t worry too much about getting everything right just now - you can always come back and edit these later on using the admin interface. The defaults are designed to be useful and secure for most sites. Scroll down to the bottom and click &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If (and only if) you find yourself getting stuck on this page, unable to continue, then your server probably has what I call the &amp;quot;buggy referrer&amp;quot; problem. This is easy to fix: just turn off the &amp;quot;secureforms&amp;quot; setting, then try to continue again.&lt;br /&gt;
&lt;br /&gt;
Next you will see more pages that print lots of status messages as they set up all the tables required by the various Moodle module. As before, they should all be &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;green&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
The next page is a form where you can define parameters for your Moodle site and the front page, such as the name, format, description and so on. Fill this out (you can always come back and change these later) and then press &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finally, you will then be asked to create a top-level administration user for future access to the admin pages. Fill out the details with your own name, email etc and then click &amp;quot;Save changes&amp;quot;. Not all the fields are required, but if you miss any important fields you&#039;ll be re-prompted for them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure you remember the username and password you chose for the administration user account, as they will be necessary to access the administration page in future.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(If for any reason your install is interrupted, or there is a system error of some kind that prevents you from logging in using the admin account, you can usually log in using the default username of &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;, with password &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Once successful, you will be returned to the home page of your new site! Note the administration links that appear down the left hand side of the page (these items also appear on a separate Admin page) - these items are only visible to you because you are logged in as the admin user. All your further administration of Moodle can now be done using this menu, such as:&lt;br /&gt;
&lt;br /&gt;
* creating and deleting courses&lt;br /&gt;
* creating and editing user accounts&lt;br /&gt;
* administering teacher accounts&lt;br /&gt;
* changing site-wide settings like themes etc&lt;br /&gt;
&lt;br /&gt;
But you are not done installing yet! There is one very important thing still to do (see the next section on cron).&lt;br /&gt;
&lt;br /&gt;
== Set up cron ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
&lt;br /&gt;
== Set up backups ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Backup (administrator)| Backup instructions]].&lt;br /&gt;
&lt;br /&gt;
== Create a new course ==&lt;br /&gt;
&lt;br /&gt;
Now that Moodle is running properly, you can try creating a new course to play with.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Create a new course&amp;quot; from the Admin page (or the admin links on the home page).&lt;br /&gt;
&lt;br /&gt;
Fill out the form, paying special attention to the course format. You don&#039;t have to worry about the details too much at this stage, as everything can be changed later by the teacher. Note that the yellow help icons are everywhere to provide contextual help on any aspect.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;Save changes&amp;quot;, and you will be taken to a new form where you can assign teachers to the course. You can only add existing user accounts from this form - if you want to create a new teacher account then either ask the teacher to create one for themselves (see the login page), or create one for them using the &amp;quot;Add a new user&amp;quot; on the Admin page.&lt;br /&gt;
&lt;br /&gt;
Once done, the course is ready to customize, and is accessible via the &amp;quot;Courses&amp;quot; link on the home page.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
*[[Complete install packages]] might be an easier first time installs on some systems&lt;br /&gt;
* [[Installing Apache, MySQL and PHP]] - Open source programs that can run Moodle on the web or on a desktop&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=42688 Selecting a web host for Moodle] forum discussion&lt;br /&gt;
* [[masquerading|Masquerading]] - Running Moodle behind a masquerading/NAT firewall&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[cs:Instalace]]&lt;br /&gt;
[[de:Installieren von Moodle]]&lt;br /&gt;
[[es:Instalación de moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;br /&gt;
[[nl:Installatiegids]]&lt;br /&gt;
[[ru:Установка Moodle]]&lt;br /&gt;
[[sk:Inštalácia]]&lt;br /&gt;
[[zh:安装Moodlezh:]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_AMP&amp;diff=29093</id>
		<title>Installing AMP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_AMP&amp;diff=29093"/>
		<updated>2007-11-23T08:25:10Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Windows */ mostly grammatical corrections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMP or AMPPlite stands for &#039;&#039;&#039;A&#039;&#039;&#039;pache, &#039;&#039;&#039;M&#039;&#039;&#039;ySQL &amp;amp; &#039;&#039;&#039;P&#039;&#039;&#039;HP.  Moodle is written in a scripting language called [[PHP]] and stores most of its data in a database. The recommended database is [[MySQL]]. Before installing Moodle you must have a working PHP installation and a working database to turn your computer into a functional web server platform. XAMP is a Windows and MAMP is a Mac OS version. &lt;br /&gt;
Moodle does have [[Complete install packages]] in the [http://download.moodle.org/ download section] as well as the Moodle only package.&lt;br /&gt;
&lt;br /&gt;
The AMP individual applications can be tricky to set up for average computer users.  This page has been written to try to make this process as simple as possible for different platforms.     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hosting Service ==&lt;br /&gt;
&lt;br /&gt;
Unfortunately hosting services vary quite a lot in the way they work. Some will even install Moodle for you.&lt;br /&gt;
&lt;br /&gt;
Most will offer a web-based control panel to control your site, create databases and set up cron. Some may also offer terminal access via ssh, so that you can use the command shell to do things.&lt;br /&gt;
&lt;br /&gt;
You should work your way through the [[Installing Moodle|Installation guide]] and take each step at a time. Ask your hosting provider if you get stuck.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mac OS X ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to do this is use the [[Apache]] server that Apple provides, and add PHP and MySQL using Marc Liyanage&#039;s packages. Both of the pages below come with good instructions that we won&#039;t duplicate here:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;PHP&#039;&#039;&#039;: Download from here: http://www.entropy.ch/software/macosx/php/&lt;br /&gt;
* &#039;&#039;&#039;MySQL&#039;&#039;&#039;: Download here: http://www.entropy.ch/software/macosx/mysql/&lt;br /&gt;
&lt;br /&gt;
Once these are installed the standard [[Installing Moodle|Installation guide]] should be fairly straightforward.&lt;br /&gt;
&lt;br /&gt;
Go here for a [[Step-by-step Guide for Installing Moodle on Mac OS X 10.4 Client]] (not server) Mac.&lt;br /&gt;
&lt;br /&gt;
== Red Hat Linux ==&lt;br /&gt;
&lt;br /&gt;
You should install all available RPM packages for Apache, PHP and MySQL. One package that people frequently forget is the php-mysql package which is necessary for PHP to talk to MySQL.&lt;br /&gt;
&lt;br /&gt;
Once these are installed the standard [[Installing Moodle|Installation guide]] should be fairly straightforward.&lt;br /&gt;
&lt;br /&gt;
A more detailed walkthrough is here: [[RedHat Linux installation]]&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
Installing Moodle &#039;&#039;&#039;for the first time&#039;&#039;&#039; on a [[Localhost]] (a stand alone computer) is easy and can be a very useful tool even if a web based production Moodle Server is available for use. These instructions work on a Windows XP computer.&lt;br /&gt;
#On the [http://download.moodle.org/windows/ Windows packages] download page, choose the version you would like. Click on the download link in the rightmost column. This will download a large zip file.&lt;br /&gt;
#Unzip the downloaded file at c: and keep the path structure for all the files.   &lt;br /&gt;
#Rename the just created c:\moodle to c:\xampplite (c:\xampplite will be our example) but you could rename it c:\moodle16 or c:\moodle17 or C:\testMoodle or whatever .&lt;br /&gt;
#Using Windows Explorer run the file c:\xampplite\setup_xampp.bat which will make sure all the configuration files use c:\xampplite as the home or root directory.&lt;br /&gt;
#The following steps assume that the web server will be able to use port 80 on your computer. See [[Windows_installation_using_XAMPP#Skype |troubleshooting if you are running Skype]] which also likes to use this port as a default. &lt;br /&gt;
#There many ways to start the localhost webserver from this point for the Moodle install.  Here are two ways.&lt;br /&gt;
##Slightly faster&lt;br /&gt;
###Using Windows Explorer run the file c:\xampplite\restart_xampp.bat and do not close the window that opens.&lt;br /&gt;
##Still fast&lt;br /&gt;
###In Windows Explorer click on  c:\xampplite\apache_start to start the Apache web server. This opens a new window that you should leave open.&lt;br /&gt;
###In Windows Explorer click on  c:\xampplite\mysql_start to start the MySQL database server. This opens yet another new window that you should leave open.&lt;br /&gt;
#In your favorite Web browser, go to the address bar and type &amp;quot;localhost&amp;quot; or &amp;quot;127.0.0.1&amp;quot; and press enter or click go.&lt;br /&gt;
#This will start the Moodle Install process, which the [[Installing Moodle]] [[Installing_Moodle#Go_to_the_admin_page_to_continue_configuration| MoodleDoc page section]] describes in a little bit more detail. This can take some time for a new user. &#039;&#039;&#039;Don&#039;t panic&#039;&#039;&#039;, you can change things later and the install process will tell you what you absolutely have to fill in or correct.&lt;br /&gt;
&lt;br /&gt;
===Easier Moodle restarts===&lt;br /&gt;
There are lots of ways to start a Moodle after an install.   Most Moodlers will have one or more &amp;quot;localhost&amp;quot; links on their computer installed in &amp;quot;Favorites&amp;quot; or even as a browser&#039;s default opening screen. But first a web server has to be started. Here are two ways to start them.  &lt;br /&gt;
====Automatic Windows services startup====&lt;br /&gt;
In order to make starting Moodle more convenient in the future you could install the web  and database servers as Windows services that are started automatically. To do this go to Start -&amp;gt; Run... and type the command &amp;quot;c:/xampplite/service.exe -install&amp;quot; into Open box. Then click OK.&lt;br /&gt;
&lt;br /&gt;
Start Moodle by typing localhost in the web browser and/or adding localhost as a favorite site.&lt;br /&gt;
====Single button service startups====&lt;br /&gt;
Sometimes there are more than one localhost installed on a computer. Create a shortcut on the start menu, favorites or desktop that points to each specific file like c:\xampplite\restart_xampp.bat . Label each shortcut to a localhost differently, for example C_MoodleXampp, or Moodle16 or Moodle17 or whatever.   &lt;br /&gt;
&lt;br /&gt;
Start Moodle by placing localhost in the web browser or adding it as a favorite site. Whichever localhost you restarted, that is the Moodle your web browser will find.&lt;br /&gt;
&lt;br /&gt;
==Other install options==&lt;br /&gt;
Instead of using this package you can also install XAMPP and Moodle separately as explained on the page [[Windows_installation_using_XAMPP]]. &lt;br /&gt;
&lt;br /&gt;
As an alternative to the above package you could use a package like EasyPHP that bundles all the software you need into a single Windows application.  Note that the EasyPHP 1.8 uses older versions of the software that are too old for Moodle 1.6.  Also many menus for EasyPHP are still in French. EasyPHP may be a good option again once its version 2.0 is released.&lt;br /&gt;
&lt;br /&gt;
Here you can find steps for an [[IIS]]: [[Windows installation]] for XAMPP or Windows 2003 .&lt;br /&gt;
&lt;br /&gt;
==Testing PHP==&lt;br /&gt;
Once you have installed your web server and PHP you should be able to create a file (for example phpinfo.php in the document root) with the following in it:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;?php phpinfo()?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be able to open this file in a web browser by going to to the URL &#039;&#039;&#039;localhost/phpinfo&#039;&#039;&#039; and see a web page that has PHP status information in it such as [[phpinfo|this]].&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Installing Moodle]]&lt;br /&gt;
*[[Installation FAQ]]&lt;br /&gt;
*[[Upgrading Moodle]]&lt;br /&gt;
*[[Debian GNU/Linux installation]]&lt;br /&gt;
*[[Complete install packages]], also includes instructions for creating a stand alone (localhost) installation on a single computer.&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Instalación AMP]]&lt;br /&gt;
[[fr:Installation de AMP]]&lt;br /&gt;
[[ja:AMPのインストール]]&lt;br /&gt;
[[ru:Установка AMP]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=28559</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installation_FAQ&amp;diff=28559"/>
		<updated>2007-11-10T06:06:46Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: clarified meaning of webroot; corrected spelling; added link to masquerading page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FAQ}}&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;?PHP phpinfo() ?&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;
== System information needed for Installation Forum ==&lt;br /&gt;
When posting questions to the installation forum, try to provide as much background information as possible about your moodle system. Use this template to copy and paste into your post:&lt;br /&gt;
* Server Operating System name (version also if possible): &lt;br /&gt;
* Browser name (version also if possible):&lt;br /&gt;
* Moodle version:&lt;br /&gt;
* Moodle install type? (New/Upgrade):&lt;br /&gt;
* Moodle config.php attached?(Y/N):&lt;br /&gt;
* Phpinfo attached? (Y/N):&lt;br /&gt;
&lt;br /&gt;
For the last two items, try to include the following in your post as an attachment:&lt;br /&gt;
* A copy of your phpinfo output as shown in your browser (see the instructions above for an explanation of how to obtain this).&lt;br /&gt;
* A copy of the Moodle configuration file. This is located in the directory moodle and is named config.php&lt;br /&gt;
&lt;br /&gt;
Copy and paste both of these into a single text file (using vi, Notepad, etc) and attach this to your post.&lt;br /&gt;
&lt;br /&gt;
If you cannot provide your phpinfo, try to copy &amp;amp; paste and complete these in your post:&lt;br /&gt;
* Webserver (e.g. Apache/IIS) version:&lt;br /&gt;
* Database server (e.g. MySQL, PostgreSQL) version:&lt;br /&gt;
* PHP version:&lt;br /&gt;
&lt;br /&gt;
For installation on web hosting accounts: contact your support desk who should be able to tell you this information.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Security Warning&#039;&#039;&#039;: Make sure you edit any files and delete any passwords before posting onto the forum.&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. Please remember that manually editing the file is not recommended and may lead to blank pages, especially if there are additional spaces and/or lines after the final php closing tag &amp;quot;?&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Running a health check==&lt;br /&gt;
Moodle contains a script that will help identify common php and webserver configuration problems as well as configuration problems. It is a good idea to run this script to check if you are having post-installation problems. Use your browser to run this file:&lt;br /&gt;
&lt;br /&gt;
 http://www.mymoodle.com/moodle/admin/health.php&lt;br /&gt;
&lt;br /&gt;
Change the above line if you have installed moodle in the webroot instead of a folder inside the webroot.&lt;br /&gt;
&lt;br /&gt;
==Downloading previous releases of Moodle==&lt;br /&gt;
* &#039;&#039;&#039;Generic Packages&#039;&#039;&#039;: If your server does not meet the [[Installing_Moodle#Requirements | requirements]] for the current version of Moodle, 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 http://download.moodle.org/stable15. 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, or alternatively use these URLs for zip or tgz downloads:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].zip&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].tgz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Changes made in the version in the last month are listed in the &amp;quot;CHANGES&amp;quot; file in the directory listing. The files you download contain Moodle code and are not the Windows or Mac packages - so you need to have a webserver, a database server and PHP already installed. The earliest version available is Moodle 1.3.&lt;br /&gt;
* &#039;&#039;&#039;Windows Packages&#039;&#039;&#039;: To download previous releases of the 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 previous releases of the Mac pacakges, 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;
* &#039;&#039;&#039;Using CVS&#039;&#039;&#039;: You can also use CVS to download older releases and incremental releases of the Moodle generic packages, e.g. Moodle 1.5.4 - see the [[CVS_for_Administrators | CVS documentation]].&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. &lt;br /&gt;
* &#039;&#039;&#039;Using the php.ini file&#039;&#039;&#039;: The log settings are contained in the php.ini file stored on the server. If you don&#039;t know where that is, edit your Moodle &#039;&#039;config.php&#039;&#039; and add the following as the second line&lt;br /&gt;
&lt;br /&gt;
  phpinfo();&lt;br /&gt;
&lt;br /&gt;
:then reload the web page. Look for the entry &#039;&#039;&#039;Configuration File (php.ini) Path&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:When you have located php.ini open it in your favorite text editor. Find the &#039;&#039;&#039;Error handling and logging&#039;&#039;&#039; section of the php.ini file. Make sure that both &#039;&#039;&#039;display_errors = On&#039;&#039;&#039;, &#039;&#039;&#039;display_startup_errors = On&#039;&#039;&#039; and &#039;&#039;&#039;log_errors = On&#039;&#039;&#039; are present and uncommented. Check the value of &#039;&#039;&#039;error_log&#039;&#039;&#039; - this tells you the location of the file errors are logged to. If it is commented out then errors will be sent to the web server error log file. Remember, if you make any changes to this file you will need to restart the web server (or just reboot the server).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Using ini_set commands&#039;&#039;&#039;: If you are using Moodle 1.7 or higher, the previous steps are not enough. In those versions error logging parameters are dependant on certain administrative settings that you specify in the debugging section. The problem is that if you can&#039;t access the administrative pages, you can&#039;t set the debugging options. So the only way to modify them is by adding the following lines to your config.php file, just before the last line (the one containing a single&#039;?&amp;gt;&#039; only):&lt;br /&gt;
&lt;br /&gt;
  ini_set (&#039;display_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;log_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;display_startup_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;error_reporting&#039;, E_ALL);&lt;br /&gt;
&lt;br /&gt;
:This will enable the same settings specified above even if Moodle sets them otherwise. &lt;br /&gt;
:&#039;&#039;&#039;Important&#039;&#039;&#039;: Remember to put them just before the last line of config.php.&lt;br /&gt;
&lt;br /&gt;
==Any text I add with an apostrophe (&#039;) or a quote (&amp;quot;) causes errors or comes up with a slash added==&lt;br /&gt;
&lt;br /&gt;
Problems caused by apostrophes are caused by incorrect &amp;quot;magic quotes&amp;quot; settings. Moodle requires the following settings in the php.ini file (which are usually the default):&lt;br /&gt;
&lt;br /&gt;
 magic_quotes_gpc = On&lt;br /&gt;
 magic_quotes_runtime = Off&lt;br /&gt;
&lt;br /&gt;
Please see [[Installing Moodle]] for more details.&lt;br /&gt;
&lt;br /&gt;
If you are using [[Debian_GNU/Linux_installation|Debian]] then the problem might be in the version of PHP that you have installed. Have a look at this [http://tracker.moodle.org/browse/MDL-9691 bug report ]  to see if it matches your situation.&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.&lt;br /&gt;
&lt;br /&gt;
Basically, you need to set up a process to regularly call the script &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://yoursite/admin/cron.php&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Try the default setting in Moodle variables page. Leave the smtphost blank. This will be acceptable for the majority of users.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Make sure that allowuseremailcharset in Administration &amp;gt; Configuration &amp;gt; Variables &amp;gt; Mail is set to No. Setting this to Yes might cause this problem in some versions of Moodle.&lt;br /&gt;
&lt;br /&gt;
==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 - I just stay stuck on the login screen==&lt;br /&gt;
&lt;br /&gt;
The most common cause for this is that your own computer (not your Moodle server) has 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;
&lt;br /&gt;
The server admin can also fix this for everyone by changing the &#039;&#039;secureforms&#039;&#039; variable to &#039;No&#039; in the security section of Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]].&lt;br /&gt;
&lt;br /&gt;
Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script &amp;lt;nowiki&amp;gt;http://yourserver/moodle/lib/session-test.php&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page.&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;
==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;
==I keep getting this error: A server error that affects your login session was detected.==&lt;br /&gt;
&lt;br /&gt;
Please refer to the Using Moodle forum discussion [http://moodle.org/mod/forum/discuss.php?d=73716 A server error that affects your login session was detected. Please login again or restart your browser.].&lt;br /&gt;
&lt;br /&gt;
==I keep getting this 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;
==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;
If you are not using Apache 2 and you still have this problem (unlikely) then you can switch Moodle to use an alternative method. The disadvantages are a slight loss of performance for your users and you won&#039;t be able to use relative links within HTML resources.&lt;br /&gt;
&lt;br /&gt;
To use this alternative method, you should change the &#039;&#039;slasharguments&#039;&#039; variable in the Operating System section of Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]]. You should now be able to access your uploaded files.&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 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;
 $CFG-&amp;gt;dirroot = &amp;quot;d:\inetpub\sites\www.yoursite.com\web\moodle&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL. 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, set these lines in your &#039;&#039;php.ini&#039;&#039; file and reload the web page.&lt;br /&gt;
&lt;br /&gt;
 display_errors = On&lt;br /&gt;
 display_startup_errors = On&lt;br /&gt;
&lt;br /&gt;
To determine if MySQL 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;
 phpinfo();&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if MySQL is supported. If not look for a package you are missing.&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 [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your 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 remove them using the admin settings page and start the install process again. However, do also make sure that you have included all required optional plugins that were required by your courses. &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;
==Installation hangs when setting-up database tables==&lt;br /&gt;
*Sometimes the installation will hang when setting up tables. This will be an abrupt hang with half the page displayed in the browser and/or other outputs removed, e.g. the “Scroll to continue” link is displayed but no “Continue” button is there. If this is the case, it is usually a mysql error and not a php error. Check that there is no limit placed on your mysql database, e.g. a &amp;quot;questions&amp;quot; limit.&lt;br /&gt;
&lt;br /&gt;
*If the install is on a webhost, adding the following line to the .htaccess file in the moodle directory has been known to solve the problem.&lt;br /&gt;
 AddType x-mapp-php5 .php&lt;br /&gt;
&lt;br /&gt;
*Try also renaming the .htaccess file so that it is disabled.&lt;br /&gt;
&lt;br /&gt;
*You may also want to look and see if you&#039;ve customized any of your code.  Look at the last successful table, and then look at the block, mod, or other code that is referenced by that table.  For example, if your install hangs and continues to say that the forum tables were successful as the last message, look at /mod/forum/ for any custom code.  If you have customized code, backup those files and replace with the correct files.  You can then restart the install by renaming config.php or reinstalling your database from the backup.  If your install is successful, you can make your code changes back into the stock Moodle code.&lt;br /&gt;
&lt;br /&gt;
*It may also be that the &amp;quot;memory_limit&amp;quot; in your php.ini is set too low. Please check your php.ini file and allocate the recommended amount (see [https://docs.moodle.org/en/Installing_Moodle#Requirements Moodle requirements]). For Moodle version 1.8 and above at least 40MB is  recommended.&lt;br /&gt;
&lt;br /&gt;
*A work-around to this problem is to setup a working Moodle system on your local PC or server using the [http://download.moodle.org Moodle Packages]. Once you have a running Moodle, [https://docs.moodle.org/en/Upgrading_Moodle#Backup_important_data backup the database] and import to your webhost. Then backup the Moodle code itself (the &amp;quot;moodle&amp;quot; directory on your PC) and copy this to your webhost using (for example) FTP. Finally, edit the moodle/config.php file for the new settings that have to be changed for the webhost.&lt;br /&gt;
&lt;br /&gt;
*To avoid this problem when upgrading, prefer to upgrade incrementally. For example: upgrade from 1.6.* to 1.7.* and then to 1.8.* rather than straight from 1.6.* to 1.8.*&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: When upgrading an existing database, the installation may appear to hang at the roles generation phase. This process can take a very long time - so please be patient.&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 because GD is not enabled on your server. GD is a library that allows image processing.&lt;br /&gt;
&lt;br /&gt;
1. Make sure &#039;&#039;&#039;GD has been included in your PHP installation&#039;&#039;&#039;. You can check this by going into Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[Variables]] 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;
&lt;br /&gt;
2. 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 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;
== 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;
&lt;br /&gt;
==I receive this error &amp;quot;500:Internal Server Error&amp;quot;==&lt;br /&gt;
You&#039;ll get this error message if there is a syntax error in your .htaccess or httpd.conf files. You will also see this error if your server does not support .htaccess files, especially if it is running PHPsuexec. Also, you may have a directive in your .htaccess or httpd.conf files which are not compatible with your web server version.&lt;br /&gt;
&lt;br /&gt;
==How do I uninstall Moodle?==&lt;br /&gt;
&#039;&#039;&#039;Moodle package installation&#039;&#039;&#039;: If you have downloaded a Moodle package, simply uninstall using your system commands. On Windows PCs, you should access the Control Panel -&amp;gt; Add/Remove Programs. Select the package name and click Change or Remove Programs.&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;
&lt;br /&gt;
==How do I upgrade Moodle? Do I just overwrite the files?==&lt;br /&gt;
Do not overwrite files, it may cause strange errors. You should read the [[Upgrade]] documentation before proceeding.&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;
==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, 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;
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;
----&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;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[nl:Installatie FAQ]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;br /&gt;
[[ru:Установка FAQ]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Administration_FAQ&amp;diff=28486</id>
		<title>Administration FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Administration_FAQ&amp;diff=28486"/>
		<updated>2007-11-06T07:19:06Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: pointed out that this section does not apply to other db types&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FAQ}}&lt;br /&gt;
&lt;br /&gt;
==Changing text in Moodle==&lt;br /&gt;
&lt;br /&gt;
Text in Moodle may be changed by editing the language files via Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/lang | Language]].&lt;br /&gt;
&lt;br /&gt;
==How do I change the spelling of &amp;quot;enrol&amp;quot; to &amp;quot;enroll&amp;quot;?==&lt;br /&gt;
&lt;br /&gt;
Simply install the American English language pack (en_us) then choose it as the default language for the site.&lt;br /&gt;
&lt;br /&gt;
==How do I make my Moodle site homepage look like the moodle.org homepage?==&lt;br /&gt;
&lt;br /&gt;
Please see the theme how-to [[Homepage design|homepage design of moodle.org]] for full details.&lt;br /&gt;
&lt;br /&gt;
== How do the limits on uploaded files work? ==&lt;br /&gt;
&lt;br /&gt;
File upload sizes are restricted in a number of ways - each one in the list restricts the following ones.&lt;br /&gt;
&lt;br /&gt;
1. Firstly, there is a setting in Apache 2 which you may need to change. On Redhat this setting is very low by default, you can change the limit by adding or editing a line in Apache&#039;s &#039;&#039;/etc/httpd/conf/httpd.conf&#039;&#039; and/or &#039;&#039;/etc/httpd/conf.d/php.conf&#039;&#039; with the upload size in bytes (different operating systems may have these files in different locations):&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 10485760&lt;br /&gt;
&lt;br /&gt;
2. PHP also has two more byte limits, which you can set in &#039;&#039;php.ini&#039;&#039; and sometimes in a &#039;&#039;.htaccess&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
 php_value upload_max_filesize 50000000&lt;br /&gt;
 php_value post_max_size 50000000&lt;br /&gt;
&lt;br /&gt;
To convert from Bytes to Megabytes use [http://www.onlineconversion.com/computer.htm this convertor ]&lt;br /&gt;
&lt;br /&gt;
Please note that a server re-start may be required for the above changes to take effect.&lt;br /&gt;
&lt;br /&gt;
3. Moodle has a site-wide limit called maxbytes that may be set in Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]].&lt;br /&gt;
&lt;br /&gt;
4. A limit may be set by teachers in the [[course/edit|Course settings]].&lt;br /&gt;
&lt;br /&gt;
5. Activity modules such as [[Forums]] and [[Assignments]] have their own limits which may be set when adding or editing the activity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=39625 Detailed instructions to increase the maximum allowed size for uploaded files] forum discussion&lt;br /&gt;
* Instructions below on How to change the maximum execution time&lt;br /&gt;
&lt;br /&gt;
== How to change upload file size on a Windows localhost==&lt;br /&gt;
In a localhost (using a [[Complete install packages]] on a computer) for 1.6 it is easy to change the uploaded file size to something larger than the default 16M. &lt;br /&gt;
&lt;br /&gt;
Here is an example of how to change the upload file size to 100M.&lt;br /&gt;
*Find ..&#039;&#039;&#039;/Apache/bin/php.ini&#039;&#039;&#039; and open it with WordPad by right-clicking -&amp;gt; Open With -&amp;gt; then choose WordPad.  &lt;br /&gt;
*In this file scroll or do a search on the text &amp;quot;_max_&amp;quot; to find &amp;lt;code&amp;gt;upload_max_filesize = 16M&amp;lt;/code&amp;gt;    &lt;br /&gt;
*Change that line to&lt;br /&gt;
 upload_max_filesize = 100M&lt;br /&gt;
*In the same way, find &amp;lt;code&amp;gt;post_max_size = 16M&amp;lt;/code&amp;gt;      &lt;br /&gt;
*Change that line to&lt;br /&gt;
 post_max_size = 100M&lt;br /&gt;
*Save the file.  &lt;br /&gt;
&lt;br /&gt;
After any changes to the php.ini file you need to restart Apache. So restart xampp and browse to localhost. You should find that the Upload file size in Configuration now reads 100M.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Instructions below on How to change the maximum execution time&lt;br /&gt;
&lt;br /&gt;
== How to change the maximum execution time ==&lt;br /&gt;
&lt;br /&gt;
A side-effect of increasing the file upload limit is that the php scripts may execute beyond the limit set by default (300 seconds/5 minutes). To change this, look for max_execution_time in php.ini and change to something like this:&lt;br /&gt;
&lt;br /&gt;
 max_execution_time = 600&lt;br /&gt;
&lt;br /&gt;
If you are using Apache and have a .htaccess file to change php settings, add this line to your .htaccess file:&lt;br /&gt;
&lt;br /&gt;
 php_value max_execution_time 600&lt;br /&gt;
&lt;br /&gt;
Restart your webserver for these changes to take effect, and check that the values have been changed by looking at your phpinfo output in the moodle admin -&amp;gt; environment page.&lt;br /&gt;
&lt;br /&gt;
== I have forgotten the admin password ==&lt;br /&gt;
Firstly, try using the button &amp;quot;Send my details via email&amp;quot;. Otherwise, you will need to access the database using MySQL admin. Passwords for all users, including admin, are stored encrypted in the table &#039;&#039;mdl_user&#039;&#039;. Copy the guest password (guest) into the admin password field then login using it.&lt;br /&gt;
&lt;br /&gt;
Additional solutions are detailed in the discussions [http://moodle.org/mod/forum/discuss.php?d=18103 change admin&#039;s password] and [http://moodle.org/mod/forum/discuss.php?d=4552&amp;amp;parent=38070 login/password].&lt;br /&gt;
&lt;br /&gt;
== My log table has disappeared - No logs found! ==&lt;br /&gt;
The most likely cause is that the mdl_log table has become corrupted. See the [https://docs.moodle.org/en/Administration_FAQ#How_do_I_repair_a_corrupted_Moodle_database.3F database repair section] below.&lt;br /&gt;
&lt;br /&gt;
==My style sheet changes aren&#039;t showing up==&lt;br /&gt;
&lt;br /&gt;
Browsers usually cache style sheets and so a forced refresh (CTRL + F5) is required before any changes show up.&lt;br /&gt;
&lt;br /&gt;
== Site-wide scales ==&lt;br /&gt;
To add a site-wide scale, available in all courses, follow the Scales link in any course Administration block. Add a new scale, then use the move down arrow to move the scale from custom scales to standard scales.&lt;br /&gt;
&lt;br /&gt;
== Users are being unenrolled for no apparent reason ==&lt;br /&gt;
Unenrolment may be controlled by the following:&lt;br /&gt;
*The &#039;&#039;longtimenosee&#039;&#039; variable in Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]] which specifies the time limit for which, if students haven&#039;t logged in, they are unenrolled from courses.&lt;br /&gt;
*The &#039;&#039;Enrolment duration&#039;&#039; in the [[course/edit|Course settings]] which unenrols students after the specified time has elapsed.&lt;br /&gt;
&lt;br /&gt;
==Why do I see &amp;lt;nowiki&amp;gt;[[missing strings]]&amp;lt;/nowiki&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
Double square brackets around text indicate that language strings are missing. Please check for missing strings and update local language packs in Administration &amp;gt;&amp;gt; [[Configuration]] &amp;gt;&amp;gt; [[Language]].&lt;br /&gt;
&lt;br /&gt;
Language strings for non-standard modules and plugins are generally contained in a &#039;&#039;lang&#039;&#039; folder within the module or plugin folder. For sites which have migrated to UTF-8, it may be necessary to re-name the folder e.g. &#039;&#039;en&#039;&#039; should be re-named &#039;&#039;en_utf8&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==How do I find the version of Moodle currently installed?==&lt;br /&gt;
See this document on [https://docs.moodle.org/en/Moodle_version Moodle version] information.&lt;br /&gt;
&lt;br /&gt;
==How do I repair a corrupted Moodle database?==&lt;br /&gt;
Database corruption usually occurs as a result of a hardware (especially disk-based) failure, or when a disk becomes full. Typical symptoms are failure on login, with this message displayed:&lt;br /&gt;
&lt;br /&gt;
 Session Replace: Table &#039;./moodle/mdl_sessions2&#039; is marked as crashed and should be repaired&lt;br /&gt;
&lt;br /&gt;
The problem can be repaired using the mysqlcheck command (the command you type is in bold and we assume the database name is &#039;moodle&#039; and its type is MySQL):&lt;br /&gt;
&lt;br /&gt;
 #&#039;&#039;&#039;mysqlcheck –u moodleuser –p –-auto-repair moodle&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 moodle.adodb_logsql                      OK&lt;br /&gt;
 moodle.mdl_assignment                    OK&lt;br /&gt;
 moodle.mdl_assignment_submissions        OK&lt;br /&gt;
 ...&lt;br /&gt;
 moodle.mdl_log&lt;br /&gt;
 error    : Table &#039;./moodle/mdl_log&#039; is marked as crashed and should be repaired&lt;br /&gt;
 ...&lt;br /&gt;
 moodle.mdl_sessions2&lt;br /&gt;
 error    : Table &#039;./moodle/mdl_sessions2&#039; is marked as crashed and should be repaired&lt;br /&gt;
 &lt;br /&gt;
 Repairing tables&lt;br /&gt;
 moodle_18_latest.mdl_log                           OK&lt;br /&gt;
 moodle_18_latest.mdl_sessions2                     OK&lt;br /&gt;
&lt;br /&gt;
Your mysql database server must be running when executing the mysqlcheck command. If there are problems with the tables, the auto-repair option will fix them as shown above. Note that the repair process can take a long time to complete. Re-run the command again to double-check that all is OK. &lt;br /&gt;
&lt;br /&gt;
Individual Moodle tables may be repaired using MySQL Admin/PHPMyAdmin as follows:&lt;br /&gt;
*In the databases section, select the Moodle database.&lt;br /&gt;
*Click the SQL tab, then in the &amp;quot;Run SQL query/queries on database moodle&amp;quot; field type&lt;br /&gt;
 REPAIR TABLE mdl_tablename&lt;br /&gt;
*Click the Go button.&lt;br /&gt;
For example, to repair the Moodle log tables, type &amp;lt;code&amp;gt;REPAIR TABLE mdl_log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also: &lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=58208#279638 Forum discussion] on a moodle database optimization script&lt;br /&gt;
*[[Performance#MySQL_performance | Performance Documentation]] on database repair and optimization&lt;br /&gt;
*[http://www.databasejournal.com/features/mysql/article.php/10897_3300511_2 Database Journal article on repairing database corruption in MySQL]&lt;br /&gt;
&lt;br /&gt;
==Re. Site files, what does &amp;quot;files placed here can be accessed by anyone&amp;quot; mean?==&lt;br /&gt;
&lt;br /&gt;
Unlike course files, which require a user to have appropriate rights in order to access them, files within the site files folder are accessible by anyone provided with the URI. For example visitors to the site may view images stored in the site files folder without being logged in. Please refer to [[Site files]] for more information.&lt;br /&gt;
&lt;br /&gt;
==My site is stuck in maintenance mode==&lt;br /&gt;
&lt;br /&gt;
Sometimes Moodle gets stuck in maintenance mode and you&#039;ll see the message &amp;quot;This site is undergoing maintenance and is currently unavailable&amp;quot; despite your attempts to turn-off maintenance mode. When you put Moodle into maintenance mode it creates a file called maintenance.html in moodledata/1/maintenance.html (the site files folder). To fix this try the following:&lt;br /&gt;
&lt;br /&gt;
* Check that the web server user has write permissions to the moodledata folder.&lt;br /&gt;
* Manually delete the maintenance.html file.&lt;br /&gt;
&lt;br /&gt;
==Incomplete page displayed when I click &amp;quot;Turn Editing On&amp;quot;==&lt;br /&gt;
This is usually as a result of an incompatible non-standard module or block that you have installed. Follow these steps:&lt;br /&gt;
#Find any non-standard modules or blocks you have installed in the moodle/mod or moodle/blocks folders.&lt;br /&gt;
#Move these to another folder outside the moodle folder. &lt;br /&gt;
#Re-visit your course page and try clicking on the &amp;quot;Turn Editing On&amp;quot; button again. &lt;br /&gt;
#Repeat the process until you find the one that is causing the problems. &lt;br /&gt;
&lt;br /&gt;
Once you have found an incompatible module/block, please report the problem to the author in the [http://moodle.org/mod/data/view.php?id=6009 Modules and Plugins] page. &lt;br /&gt;
&lt;br /&gt;
==&amp;quot;a request parameter (id) was missing&amp;quot; when uploading a file==&lt;br /&gt;
&lt;br /&gt;
This message sometimes is generated when attempting to upload a file larger than the upload limit.&lt;br /&gt;
&lt;br /&gt;
==Why can&#039;t I select &amp;quot;External Database&amp;quot; from the enrolment plugins drop-down menu in the course settings?==&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;interactive&#039;&#039; enrolment methods may be chosen in the course settings. Please refer to the interactive enrolment section of [[Enrolment plugins]].&lt;br /&gt;
&lt;br /&gt;
==I cannot delete the News Forum on a course==&lt;br /&gt;
The News Forum is deleted by setting the number of items to display to zero. To do this, change the setting in Course Admin menu -&amp;gt; Settings -&amp;gt; News Items to Show.&lt;br /&gt;
&lt;br /&gt;
==How can I change the URL of the moodle service==&lt;br /&gt;
&lt;br /&gt;
You should configure your Apache server, at httpd.conf, using Listen, Port and DocumentRoot directives and Directory section. After restarting Apache, you also must open config.php in a text editor, and change the line:&lt;br /&gt;
    $CFG-&amp;gt;wwwroot   = &#039;http://mydomain/testmoodle&#039;;&lt;br /&gt;
&lt;br /&gt;
Your Moodle site will also contain absolute links to resources which point to the previous URL. To change this see the [[Moodle_migration#Migrating_a_complete_Moodle_site | migrating a complete Moodle site]] instructions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;: [http://moodle.org/mod/forum/discuss.php?d=51667 Forum discussion]&lt;br /&gt;
&lt;br /&gt;
==Why is the Moodle Registration button still displayed after I register my site?==&lt;br /&gt;
The registration button is provided so that you can place your moodle site to the http://www.moodle.org/sites list. Before registering, the button is displayed at the top of the Site Administration -&amp;gt; Notifications page. Once you have successfully registered, this is moved to the bottom of the same page. The button remains there so that you can update the details of your registration.&lt;br /&gt;
&lt;br /&gt;
If the registration process fails for some reason to complete fully, there are two methods of letting your local Moodle install know that you have registered:&lt;br /&gt;
&lt;br /&gt;
* The preferred method is to use your mysql client program to execute these commands (assuming your Moodle database is called &amp;quot;moodle&amp;quot;):&lt;br /&gt;
 mysql&amp;gt; USE moodle;&lt;br /&gt;
 mysql&amp;gt; INSERT INTO mdl_config (name,value) VALUES (&#039;registered&#039;,unix_timestamp());&lt;br /&gt;
&lt;br /&gt;
* Alternatively, edit your &amp;lt;nowiki&amp;gt;moodle/config.php&amp;lt;/nowiki&amp;gt; file and add this line:&lt;br /&gt;
 $CFG-&amp;gt;registered = &#039;9999999999&#039;;&lt;br /&gt;
:Note that this line in your config.php will stop the reminders about re-registering.&lt;br /&gt;
&lt;br /&gt;
For an explanation of the idea behind the button see [http://tracker.moodle.org/browse/MDL-7359 MDL-7359] in the moodle tracker.&lt;br /&gt;
&lt;br /&gt;
For an explanation of how sites are checked see [[Verification_of_sites_on_moodle.org | the site verification page]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Administración]]&lt;br /&gt;
[[fr:FAQ d&#039;administration]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Administration_FAQ&amp;diff=28485</id>
		<title>Administration FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Administration_FAQ&amp;diff=28485"/>
		<updated>2007-11-06T07:09:22Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: made reference into a link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FAQ}}&lt;br /&gt;
&lt;br /&gt;
==Changing text in Moodle==&lt;br /&gt;
&lt;br /&gt;
Text in Moodle may be changed by editing the language files via Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/lang | Language]].&lt;br /&gt;
&lt;br /&gt;
==How do I change the spelling of &amp;quot;enrol&amp;quot; to &amp;quot;enroll&amp;quot;?==&lt;br /&gt;
&lt;br /&gt;
Simply install the American English language pack (en_us) then choose it as the default language for the site.&lt;br /&gt;
&lt;br /&gt;
==How do I make my Moodle site homepage look like the moodle.org homepage?==&lt;br /&gt;
&lt;br /&gt;
Please see the theme how-to [[Homepage design|homepage design of moodle.org]] for full details.&lt;br /&gt;
&lt;br /&gt;
== How do the limits on uploaded files work? ==&lt;br /&gt;
&lt;br /&gt;
File upload sizes are restricted in a number of ways - each one in the list restricts the following ones.&lt;br /&gt;
&lt;br /&gt;
1. Firstly, there is a setting in Apache 2 which you may need to change. On Redhat this setting is very low by default, you can change the limit by adding or editing a line in Apache&#039;s &#039;&#039;/etc/httpd/conf/httpd.conf&#039;&#039; and/or &#039;&#039;/etc/httpd/conf.d/php.conf&#039;&#039; with the upload size in bytes (different operating systems may have these files in different locations):&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 10485760&lt;br /&gt;
&lt;br /&gt;
2. PHP also has two more byte limits, which you can set in &#039;&#039;php.ini&#039;&#039; and sometimes in a &#039;&#039;.htaccess&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
 php_value upload_max_filesize 50000000&lt;br /&gt;
 php_value post_max_size 50000000&lt;br /&gt;
&lt;br /&gt;
To convert from Bytes to Megabytes use [http://www.onlineconversion.com/computer.htm this convertor ]&lt;br /&gt;
&lt;br /&gt;
Please note that a server re-start may be required for the above changes to take effect.&lt;br /&gt;
&lt;br /&gt;
3. Moodle has a site-wide limit called maxbytes that may be set in Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]].&lt;br /&gt;
&lt;br /&gt;
4. A limit may be set by teachers in the [[course/edit|Course settings]].&lt;br /&gt;
&lt;br /&gt;
5. Activity modules such as [[Forums]] and [[Assignments]] have their own limits which may be set when adding or editing the activity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=39625 Detailed instructions to increase the maximum allowed size for uploaded files] forum discussion&lt;br /&gt;
* Instructions below on How to change the maximum execution time&lt;br /&gt;
&lt;br /&gt;
== How to change upload file size on a Windows localhost==&lt;br /&gt;
In a localhost (using a [[Complete install packages]] on a computer) for 1.6 it is easy to change the uploaded file size to something larger than the default 16M. &lt;br /&gt;
&lt;br /&gt;
Here is an example of how to change the upload file size to 100M.&lt;br /&gt;
*Find ..&#039;&#039;&#039;/Apache/bin/php.ini&#039;&#039;&#039; and open it with WordPad by right-clicking -&amp;gt; Open With -&amp;gt; then choose WordPad.  &lt;br /&gt;
*In this file scroll or do a search on the text &amp;quot;_max_&amp;quot; to find &amp;lt;code&amp;gt;upload_max_filesize = 16M&amp;lt;/code&amp;gt;    &lt;br /&gt;
*Change that line to&lt;br /&gt;
 upload_max_filesize = 100M&lt;br /&gt;
*In the same way, find &amp;lt;code&amp;gt;post_max_size = 16M&amp;lt;/code&amp;gt;      &lt;br /&gt;
*Change that line to&lt;br /&gt;
 post_max_size = 100M&lt;br /&gt;
*Save the file.  &lt;br /&gt;
&lt;br /&gt;
After any changes to the php.ini file you need to restart Apache. So restart xampp and browse to localhost. You should find that the Upload file size in Configuration now reads 100M.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Instructions below on How to change the maximum execution time&lt;br /&gt;
&lt;br /&gt;
== How to change the maximum execution time ==&lt;br /&gt;
&lt;br /&gt;
A side-effect of increasing the file upload limit is that the php scripts may execute beyond the limit set by default (300 seconds/5 minutes). To change this, look for max_execution_time in php.ini and change to something like this:&lt;br /&gt;
&lt;br /&gt;
 max_execution_time = 600&lt;br /&gt;
&lt;br /&gt;
If you are using Apache and have a .htaccess file to change php settings, add this line to your .htaccess file:&lt;br /&gt;
&lt;br /&gt;
 php_value max_execution_time 600&lt;br /&gt;
&lt;br /&gt;
Restart your webserver for these changes to take effect, and check that the values have been changed by looking at your phpinfo output in the moodle admin -&amp;gt; environment page.&lt;br /&gt;
&lt;br /&gt;
== I have forgotten the admin password ==&lt;br /&gt;
Firstly, try using the button &amp;quot;Send my details via email&amp;quot;. Otherwise, you will need to access the database using MySQL admin. Passwords for all users, including admin, are stored encrypted in the table &#039;&#039;mdl_user&#039;&#039;. Copy the guest password (guest) into the admin password field then login using it.&lt;br /&gt;
&lt;br /&gt;
Additional solutions are detailed in the discussions [http://moodle.org/mod/forum/discuss.php?d=18103 change admin&#039;s password] and [http://moodle.org/mod/forum/discuss.php?d=4552&amp;amp;parent=38070 login/password].&lt;br /&gt;
&lt;br /&gt;
== My log table has disappeared - No logs found! ==&lt;br /&gt;
The most likely cause is that the mdl_log table has become corrupted. See the [https://docs.moodle.org/en/Administration_FAQ#How_do_I_repair_a_corrupted_Moodle_database.3F database repair section] below.&lt;br /&gt;
&lt;br /&gt;
==My style sheet changes aren&#039;t showing up==&lt;br /&gt;
&lt;br /&gt;
Browsers usually cache style sheets and so a forced refresh (CTRL + F5) is required before any changes show up.&lt;br /&gt;
&lt;br /&gt;
== Site-wide scales ==&lt;br /&gt;
To add a site-wide scale, available in all courses, follow the Scales link in any course Administration block. Add a new scale, then use the move down arrow to move the scale from custom scales to standard scales.&lt;br /&gt;
&lt;br /&gt;
== Users are being unenrolled for no apparent reason ==&lt;br /&gt;
Unenrolment may be controlled by the following:&lt;br /&gt;
*The &#039;&#039;longtimenosee&#039;&#039; variable in Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]] which specifies the time limit for which, if students haven&#039;t logged in, they are unenrolled from courses.&lt;br /&gt;
*The &#039;&#039;Enrolment duration&#039;&#039; in the [[course/edit|Course settings]] which unenrols students after the specified time has elapsed.&lt;br /&gt;
&lt;br /&gt;
==Why do I see &amp;lt;nowiki&amp;gt;[[missing strings]]&amp;lt;/nowiki&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
Double square brackets around text indicate that language strings are missing. Please check for missing strings and update local language packs in Administration &amp;gt;&amp;gt; [[Configuration]] &amp;gt;&amp;gt; [[Language]].&lt;br /&gt;
&lt;br /&gt;
Language strings for non-standard modules and plugins are generally contained in a &#039;&#039;lang&#039;&#039; folder within the module or plugin folder. For sites which have migrated to UTF-8, it may be necessary to re-name the folder e.g. &#039;&#039;en&#039;&#039; should be re-named &#039;&#039;en_utf8&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==How do I find the version of Moodle currently installed?==&lt;br /&gt;
See this document on [https://docs.moodle.org/en/Moodle_version Moodle version] information.&lt;br /&gt;
&lt;br /&gt;
==How do I repair a corrupted Moodle database?==&lt;br /&gt;
Database corruption usually occurs as a result of a hardware (especially disk-based) failure, or when a disk becomes full. Typical symptoms are failure on login, with this message displayed:&lt;br /&gt;
&lt;br /&gt;
 Session Replace: Table &#039;./moodle/mdl_sessions2&#039; is marked as crashed and should be repaired&lt;br /&gt;
&lt;br /&gt;
The problem can be repaired using the mysqlcheck command (the command you type is in bold and we assume the database name is &#039;moodle&#039;):&lt;br /&gt;
&lt;br /&gt;
 #&#039;&#039;&#039;mysqlcheck –u moodleuser –p –-auto-repair moodle&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 moodle.adodb_logsql                      OK&lt;br /&gt;
 moodle.mdl_assignment                    OK&lt;br /&gt;
 moodle.mdl_assignment_submissions        OK&lt;br /&gt;
 ...&lt;br /&gt;
 moodle.mdl_log&lt;br /&gt;
 error    : Table &#039;./moodle/mdl_log&#039; is marked as crashed and should be repaired&lt;br /&gt;
 ...&lt;br /&gt;
 moodle.mdl_sessions2&lt;br /&gt;
 error    : Table &#039;./moodle/mdl_sessions2&#039; is marked as crashed and should be repaired&lt;br /&gt;
 &lt;br /&gt;
 Repairing tables&lt;br /&gt;
 moodle_18_latest.mdl_log                           OK&lt;br /&gt;
 moodle_18_latest.mdl_sessions2                     OK&lt;br /&gt;
&lt;br /&gt;
Your mysql database server must be running when executing the mysqlcheck command. If there are problems with the tables, the auto-repair option will fix them as shown above. Note that the repair process can take a long time to complete. Re-run the command again to double-check that all is OK. &lt;br /&gt;
&lt;br /&gt;
Individual Moodle tables may be repaired using MySQL Admin/PHPMyAdmin as follows:&lt;br /&gt;
*In the databases section, select the Moodle database.&lt;br /&gt;
*Click the SQL tab, then in the &amp;quot;Run SQL query/queries on database moodle&amp;quot; field type&lt;br /&gt;
 REPAIR TABLE mdl_tablename&lt;br /&gt;
*Click the Go button.&lt;br /&gt;
For example, to repair the Moodle log tables, type &amp;lt;code&amp;gt;REPAIR TABLE mdl_log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also: &lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=58208#279638 Forum discussion] on a moodle database optimization script&lt;br /&gt;
*[[Performance#MySQL_performance | Performance Documentation]] on database repair and optimization&lt;br /&gt;
*[http://www.databasejournal.com/features/mysql/article.php/10897_3300511_2 Database Journal article on repairing database corruption in MySQL]&lt;br /&gt;
&lt;br /&gt;
==Re. Site files, what does &amp;quot;files placed here can be accessed by anyone&amp;quot; mean?==&lt;br /&gt;
&lt;br /&gt;
Unlike course files, which require a user to have appropriate rights in order to access them, files within the site files folder are accessible by anyone provided with the URI. For example visitors to the site may view images stored in the site files folder without being logged in. Please refer to [[Site files]] for more information.&lt;br /&gt;
&lt;br /&gt;
==My site is stuck in maintenance mode==&lt;br /&gt;
&lt;br /&gt;
Sometimes Moodle gets stuck in maintenance mode and you&#039;ll see the message &amp;quot;This site is undergoing maintenance and is currently unavailable&amp;quot; despite your attempts to turn-off maintenance mode. When you put Moodle into maintenance mode it creates a file called maintenance.html in moodledata/1/maintenance.html (the site files folder). To fix this try the following:&lt;br /&gt;
&lt;br /&gt;
* Check that the web server user has write permissions to the moodledata folder.&lt;br /&gt;
* Manually delete the maintenance.html file.&lt;br /&gt;
&lt;br /&gt;
==Incomplete page displayed when I click &amp;quot;Turn Editing On&amp;quot;==&lt;br /&gt;
This is usually as a result of an incompatible non-standard module or block that you have installed. Follow these steps:&lt;br /&gt;
#Find any non-standard modules or blocks you have installed in the moodle/mod or moodle/blocks folders.&lt;br /&gt;
#Move these to another folder outside the moodle folder. &lt;br /&gt;
#Re-visit your course page and try clicking on the &amp;quot;Turn Editing On&amp;quot; button again. &lt;br /&gt;
#Repeat the process until you find the one that is causing the problems. &lt;br /&gt;
&lt;br /&gt;
Once you have found an incompatible module/block, please report the problem to the author in the [http://moodle.org/mod/data/view.php?id=6009 Modules and Plugins] page. &lt;br /&gt;
&lt;br /&gt;
==&amp;quot;a request parameter (id) was missing&amp;quot; when uploading a file==&lt;br /&gt;
&lt;br /&gt;
This message sometimes is generated when attempting to upload a file larger than the upload limit.&lt;br /&gt;
&lt;br /&gt;
==Why can&#039;t I select &amp;quot;External Database&amp;quot; from the enrolment plugins drop-down menu in the course settings?==&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;interactive&#039;&#039; enrolment methods may be chosen in the course settings. Please refer to the interactive enrolment section of [[Enrolment plugins]].&lt;br /&gt;
&lt;br /&gt;
==I cannot delete the News Forum on a course==&lt;br /&gt;
The News Forum is deleted by setting the number of items to display to zero. To do this, change the setting in Course Admin menu -&amp;gt; Settings -&amp;gt; News Items to Show.&lt;br /&gt;
&lt;br /&gt;
==How can I change the URL of the moodle service==&lt;br /&gt;
&lt;br /&gt;
You should configure your Apache server, at httpd.conf, using Listen, Port and DocumentRoot directives and Directory section. After restarting Apache, you also must open config.php in a text editor, and change the line:&lt;br /&gt;
    $CFG-&amp;gt;wwwroot   = &#039;http://mydomain/testmoodle&#039;;&lt;br /&gt;
&lt;br /&gt;
Your Moodle site will also contain absolute links to resources which point to the previous URL. To change this see the [[Moodle_migration#Migrating_a_complete_Moodle_site | migrating a complete Moodle site]] instructions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;: [http://moodle.org/mod/forum/discuss.php?d=51667 Forum discussion]&lt;br /&gt;
&lt;br /&gt;
==Why is the Moodle Registration button still displayed after I register my site?==&lt;br /&gt;
The registration button is provided so that you can place your moodle site to the http://www.moodle.org/sites list. Before registering, the button is displayed at the top of the Site Administration -&amp;gt; Notifications page. Once you have successfully registered, this is moved to the bottom of the same page. The button remains there so that you can update the details of your registration.&lt;br /&gt;
&lt;br /&gt;
If the registration process fails for some reason to complete fully, there are two methods of letting your local Moodle install know that you have registered:&lt;br /&gt;
&lt;br /&gt;
* The preferred method is to use your mysql client program to execute these commands (assuming your Moodle database is called &amp;quot;moodle&amp;quot;):&lt;br /&gt;
 mysql&amp;gt; USE moodle;&lt;br /&gt;
 mysql&amp;gt; INSERT INTO mdl_config (name,value) VALUES (&#039;registered&#039;,unix_timestamp());&lt;br /&gt;
&lt;br /&gt;
* Alternatively, edit your &amp;lt;nowiki&amp;gt;moodle/config.php&amp;lt;/nowiki&amp;gt; file and add this line:&lt;br /&gt;
 $CFG-&amp;gt;registered = &#039;9999999999&#039;;&lt;br /&gt;
:Note that this line in your config.php will stop the reminders about re-registering.&lt;br /&gt;
&lt;br /&gt;
For an explanation of the idea behind the button see [http://tracker.moodle.org/browse/MDL-7359 MDL-7359] in the moodle tracker.&lt;br /&gt;
&lt;br /&gt;
For an explanation of how sites are checked see [[Verification_of_sites_on_moodle.org | the site verification page]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Administración]]&lt;br /&gt;
[[fr:FAQ d&#039;administration]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=28074</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installing_Moodle&amp;diff=28074"/>
		<updated>2007-10-21T09:07:19Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Using the command line */  clarify command continuation prompt; fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Firstly don&#039;t panic! :-)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install Moodle for the first time. For some of these steps it goes into a lot of detail to try and cover the majority of possible web server setups, so this page may look long and complicated. Don&#039;t panic, once you know how to do it you can install Moodle in minutes!&lt;br /&gt;
&lt;br /&gt;
If you have problems please read this page carefully - most common issues are answered in here. If you still have trouble, you can seek help from the Moodle community via  [http://moodle.org/course/view.php?id=5 moodle.org Using Moodle].&lt;br /&gt;
&lt;br /&gt;
Another option is to contact a [http://moodle.com/hosting/ Moodle Partner providing Moodle hosting] who can completely maintain Moodle for you, so that you can ignore all this and get straight into educating! A Moodle partner is the preferred option but if you decide to choose a hosting company that has cpanel then [http://otaru-jc.ac.jp/hagley/settingupmoodleonhostingwithcpanel.swf this tutorial will guide you]  through the process of choosing a host and setting up moodle via cpanel. &lt;br /&gt;
&lt;br /&gt;
If you want to run Moodle on your own computer and this page looks a bit daunting, then please see our guides: [[Installing AMP |Installing Apache, MySQL and PHP(AMP)]] or [[Complete install packages| how to install one of Moodle&#039;s complete packages]]. They provide alternative instructions to install all this on most popular platforms.&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), but is also regularly tested with Windows XP/2000/2003 (WAMP), Solaris 10 (Sparc and x64), Mac OS X and Netware 6 operating systems. Support for PostgreSQL, Oracle and Microsoft SQL Server is also available.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Most web hosts support all of these requirements by default. You should contact your web host&#039;s support desk to check that this is the case &#039;&#039;&#039;before&#039;&#039;&#039; signing-up with them. It is especially important to ask about any PHP memory limits or MySQL question limits. If your prospective host does not provide a service which meets these requirements, or you are already signed up with them, ask them why and consider taking your business elsewhere if they do not change.&lt;br /&gt;
&lt;br /&gt;
The requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Hardware&#039;&#039;&#039; (unless you are using a hosted server). &lt;br /&gt;
* Disk space: 160MB free (min). You will require more free space to store your teaching materials.&lt;br /&gt;
* Memory: 256MB (min), 1GB (recommended). The general rule of thumb is that Moodle can support 50 &#039;&#039;concurrent&#039;&#039; users for every 1GB of RAM, but this will vary depending on your specific hardware and software combination. &lt;br /&gt;
&#039;&#039;&#039;Software&#039;&#039;&#039;&lt;br /&gt;
* Web server software. Most people use [[Apache]], but Moodle should work fine under any web server that supports [[PHP]], such as [[IIS]] on Windows platforms. PHP does impose requirements on versions of web servers, however these are complex and the general advice is to use the newest version possible of your chosen web server. &lt;br /&gt;
* PHP scripting language. (Please note that there have been issues installing Moodle with [http://www.php-accelerator.co.uk PHP-Accelerator]). There are currently two versions (or branches) of PHP available: PHP4 and PHP5 and the version requirements are listed below.&lt;br /&gt;
** For Moodle version 1.4 or later: PHP4 (version 4.1.0 or later) or PHP5 (version 5.1.0 or later) are supported.&lt;br /&gt;
** For Moodle version 1.6 or later: the PHP4 (version 4.3.0 or later) or PHP5 (version 5.1.0 or later) are supported. &lt;br /&gt;
** Future Moodle versions 2.0 or later will not support PHP4 and will require PHP5 (version 5.2.0 or later).&lt;br /&gt;
** PHP Settings&lt;br /&gt;
*** &#039;&#039;safe_mode&#039;&#039; needs to be OFF (check in your php.ini or Apache configuration file).&lt;br /&gt;
*** &#039;&#039;memory_limit&#039;&#039; should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operation systems require even more memory.&lt;br /&gt;
*** &#039;&#039;session.save_handler&#039;&#039; needs to be set to files. &lt;br /&gt;
** PHP Extensions and libraries&lt;br /&gt;
*** The mbstring extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** The iconv extension is recommended for Moodle 1.6 or later.&lt;br /&gt;
*** [http://www.libgd.org/ GD library] and the [http://www.freetype.org/ FreeType 2] library and extensions are needed to be able to look at the dynamic graphs that the logs pages make.&lt;br /&gt;
*** The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.&lt;br /&gt;
*** The pgsql extension is required if you are using the PostgreSQL database.&lt;br /&gt;
*** The zlib extension is required for zip/unzip functionality.&lt;br /&gt;
*** The curl extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The tokenizer extension is recommended for Moodle 1.8 or later.&lt;br /&gt;
*** The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).&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;
* A working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is &#039;&#039;the&#039;&#039; choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment. &lt;br /&gt;
** For Moodle 1.5 or later, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later). &lt;br /&gt;
** For Moodle 1.6 or later, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).&lt;br /&gt;
** For Moodle 1.7 or later, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])&lt;br /&gt;
: MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting &amp;quot;strict mode&amp;quot; must be OFF (set to &amp;quot;&amp;quot; or &amp;quot;MYSQL40&amp;quot;) in the MySQL configuration file. &lt;br /&gt;
: PostgreSQL Notes: The minimum version of PostgreSQL is 7.4 and Moodle is widely used with 8.0 and 8.1.&lt;br /&gt;
&lt;br /&gt;
== How many users? ==&lt;br /&gt;
&lt;br /&gt;
In addition to the hardware and software requirements, you will also need to think about the capacity of your Moodle installation in terms of the number of users it can handle. There are two numbers to plan for:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Browsing users&#039;&#039;&#039;: the maximum number of users able to browse your Moodle site. This is the number of computers in your organization or on your course (whichever is greater).&lt;br /&gt;
* &#039;&#039;&#039;Concurrent database users&#039;&#039;&#039;: the maximum number of concurrent database users (needed for Moodle activities such as quizzes). This is the number of users who will be using Moodle at the same time. In an educational institution, use your timetable/roster to obtain this figure.&lt;br /&gt;
&lt;br /&gt;
Once you know these figures for your users, you can start work out if your Moodle installation can support this capacity. The exact number of users depends on your hardware/software/network combination. Usually the amount of memory installed (RAM) is the deciding factor but a faster overall processor speed will also help in reducing waiting times for pages to load. &lt;br /&gt;
&lt;br /&gt;
The general rule of thumb for a single server is that the approx max concurrent users = RAM (GB) * 50 and the approx max browsing users = Approx max concurrent users * 5. As an example, a university with 500 total computers on campus and 100 concurrent users at any time will need approx 2GB of RAM on the one server to support the number of concurrent users.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note if you are using a hosted account&#039;&#039;&#039;: Ask your provider what limits are placed on the number of concurrent database connections and the processor load. This will give a good estimate of the number of users your Moodle install can manage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; As of August 31, 2007, the moodle 1.8.2+ codes are still not suitable for large installation, especially if you have large number (e.g. 20,000+) of courses. The main reason is the codes related to ROLES are still not fully optimized with database queries and still need some work. If you are planning to use 1.8.x codes for a larger institution, please make sure that you have sufficient time to do your own testing and performance profiling.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to get Moodle, either as a compressed package or via CVS. &lt;br /&gt;
* There are two types of compressed packages on the  [http://download.moodle.org/ download page: http://download.moodle.org/], the standard distribution with Moodle only files and the [[Complete install packages|complete install]], which contains programs to operate Moodle in a web environment.  &lt;br /&gt;
* To use CVS, helpful instructions are available at the [[CVS_for_Administrators | CVS for Administrators]] page. The full [http://moodle.cvs.sourceforge.net/moodle/moodle/ Moodle Sourceforge CVS repository] is also available for browsing. &lt;br /&gt;
&lt;br /&gt;
After downloading, unpack the archive using either &lt;br /&gt;
 tar -zxvf [filename]&lt;br /&gt;
or&lt;br /&gt;
 unzip [filename]&lt;br /&gt;
as appropriate. &lt;br /&gt;
&lt;br /&gt;
If using CVS, run the CVS Checkout command.&lt;br /&gt;
&lt;br /&gt;
You will now be left with a directory called &amp;quot;moodle&amp;quot;, 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;.&lt;br /&gt;
&lt;br /&gt;
If you are downloading Moodle to your local computer and then uploading it to your web site, it is usually better to upload the whole archive as one file, and then do the unpacking on the server. Even web hosting interfaces like cPanel allow you to uncompress archives in the &amp;quot;File Manager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Structure of moodle directory ===&lt;br /&gt;
&lt;br /&gt;
You can safely skip this section, but here is a quick summary of the contents of the Moodle folder, to help get you oriented:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;config.php&#039;&#039; - contains basic settings. This file does not come with Moodle - you will create it.&lt;br /&gt;
:&#039;&#039;install.php&#039;&#039; - the script you will run to create config.php&lt;br /&gt;
:&#039;&#039;version.php&#039;&#039; - defines the current version of Moodle code&lt;br /&gt;
:&#039;&#039;index.php&#039;&#039; - the front page of the site&lt;br /&gt;
:&#039;&#039;admin/&#039;&#039; - code to administrate the whole server&lt;br /&gt;
:&#039;&#039;auth/&#039;&#039; - plugin modules to authenticate users&lt;br /&gt;
:&#039;&#039;blocks/&#039;&#039; - plugin modules for the little side blocks on many pages&lt;br /&gt;
:&#039;&#039;calendar/&#039;&#039; - all the code for managing and displaying calendars&lt;br /&gt;
:&#039;&#039;course/&#039;&#039; - code to display and manage courses&lt;br /&gt;
:&#039;&#039;doc/&#039;&#039; - help documentation for Moodle (eg this page)&lt;br /&gt;
:&#039;&#039;files/&#039;&#039; - code to display and manage uploaded files&lt;br /&gt;
:&#039;&#039;lang/&#039;&#039; - texts in different languages, one directory per language&lt;br /&gt;
:&#039;&#039;lib/&#039;&#039; - libraries of core Moodle code&lt;br /&gt;
:&#039;&#039;login/&#039;&#039; - code to handle login and account creation&lt;br /&gt;
:&#039;&#039;mod/&#039;&#039; - all the main Moodle course modules are in here&lt;br /&gt;
:&#039;&#039;pix/&#039;&#039; - generic site graphics&lt;br /&gt;
:&#039;&#039;theme/&#039;&#039; - theme packs/skins to change the look of the site.&lt;br /&gt;
:&#039;&#039;user/&#039;&#039; - code to display and manage users&lt;br /&gt;
&lt;br /&gt;
== Setting-up your system==&lt;br /&gt;
To ensure that Moodle will install successfully, you need to check that the web server settings are correct, then create a blank database for Moodle to use and finally create a directory on your hard disk for Moodle to save your materials and other files you upload into your courses.&lt;br /&gt;
&lt;br /&gt;
=== Check web server settings ===&lt;br /&gt;
&lt;br /&gt;
*Firstly, make sure that your web server is set up to use index.php as a default page (perhaps in addition to index.html, default.htm and so on). In Apache, this is done using a DirectoryIndex parameter in your httpd.conf file. Mine usually looks like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
:Just make sure index.php is in the list (and preferably towards the start of the list, for efficiency).&lt;br /&gt;
&lt;br /&gt;
*Secondly, &#039;&#039;&#039;if you are using Apache 2&#039;&#039;&#039;, then you should turn on the &#039;&#039;AcceptPathInfo&#039;&#039; variable, which allows scripts to be passed arguments like &amp;lt;nowiki&amp;gt;http://server/file.php/arg1/arg2&amp;lt;/nowiki&amp;gt;. This is essential to allow relative links between your resources, and also provides a performance boost for people using your Moodle web site. You can turn this on by adding these lines to your httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
=== Check PHP settings ===&lt;br /&gt;
Moodle requires a number of PHP settings to be active for it to work. &#039;&#039;&#039;On most servers these will already be the default settings&#039;&#039;&#039;.  However, some PHP servers (and some of the more recent PHP versions) may have things set differently. These are defined in PHP&#039;s configuration file (usually called &#039;&#039;&#039;php.ini&#039;&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
 magic_quotes_gpc = 1    (preferred but not necessary)&lt;br /&gt;
 magic_quotes_runtime = 0    (necessary)&lt;br /&gt;
 file_uploads = 1&lt;br /&gt;
 session.auto_start = 0&lt;br /&gt;
 session.bug_compat_warn = 0&lt;br /&gt;
&lt;br /&gt;
:You may also want to set other, optional php.ini file settings while you are already editing it. For instance, you may want to reset the maximum upload size of file attachments, which usually defaults to 2M(egabytes). For instance, to set these to 16 Megabytes:&lt;br /&gt;
 &lt;br /&gt;
 post_max_size = 16M&lt;br /&gt;
 upload_max_filesize = 16M&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Using a .htaccess file for webserver and PHP settings ===&lt;br /&gt;
&lt;br /&gt;
Use the above if you can directly edit your server&#039;s files, but if you are setting-up Moodle on a webhost, or don&#039;t have access to &#039;&#039;&#039;httpd.conf&#039;&#039;&#039; or &#039;&#039;&#039;php.ini&#039;&#039;&#039; on your server, or you have Moodle on a server with other applications that require different settings, then don&#039;t worry, you can often still override the default settings. This only works on Apache servers and only when Overrides have been allowed in the main Apache configuration.&lt;br /&gt;
&lt;br /&gt;
* Create a file called &#039;&#039;&#039;.htaccess&#039;&#039;&#039; in Moodle&#039;s main directory that contains lines like the following. &lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
 php_flag magic_quotes_gpc 1&lt;br /&gt;
 php_flag magic_quotes_runtime 0&lt;br /&gt;
 php_flag file_uploads 1&lt;br /&gt;
 php_flag session.auto_start 0&lt;br /&gt;
 php_flag session.bug_compat_warn 0&lt;br /&gt;
&lt;br /&gt;
:If you have Apache version 2 installed, add these lines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IfDefine APACHE2&amp;gt;&lt;br /&gt;
     AcceptPathInfo on&lt;br /&gt;
 &amp;lt;/IfDefine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Otherwise add this single line:&lt;br /&gt;
&lt;br /&gt;
 AcceptPathInfo on&lt;br /&gt;
&lt;br /&gt;
* Optionally, you can also do things like define the maximum size for uploaded files, etc by adding these lines:&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 0&lt;br /&gt;
 php_value upload_max_filesize 2M&lt;br /&gt;
 php_value post_max_size 2M&lt;br /&gt;
     &lt;br /&gt;
* The easiest thing to do is just copy the sample file from lib/htaccess and edit it to suit your needs. It contains further instructions. For example, in a Unix shell:&lt;br /&gt;
&lt;br /&gt;
 cp lib/htaccess .htaccess&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Use a .htaccess file only [http://httpd.apache.org/docs/1.3/howto/htaccess.html#when as a last resort] as it can have an impact on the performance of your Moodle site and cause pages to load slowly on your browser.&lt;br /&gt;
&lt;br /&gt;
=== Creating an empty database ===&lt;br /&gt;
&lt;br /&gt;
You need to create an empty database (eg &amp;quot;&#039;&#039;moodle&#039;&#039;&amp;quot;) in your database system along with a special user (eg &amp;quot;moodleuser&amp;quot;) that has access to that database (and that database only). You could use the &amp;quot;root&amp;quot; user if you wanted to for a test server, but this is not recommended for a production system: if hackers manage to discover the password then your whole database system would be at risk, rather than just one database.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Warning&#039;&#039;&#039;: Bear in mind that, as of Moodle version 1.5.x, Moodle doesn&#039;t work with MySQL 5.x&#039;s strict mode setting (STRICT_TRANS_TABLES and/or STRICT_ALL_TABLES) -- see [http://moodle.org/mod/forum/discuss.php?d=58552 forum discussion]. So if you are using MySQL 5.x, edit MySQL&#039;s configuration file (called &amp;quot;my.ini&amp;quot; in Windows and &amp;quot;my.cnf&amp;quot; on Unix/Linux) and comment out that option or set it to &amp;lt;code&amp;gt;sql-mode=&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. You have to restart MySQL after changing this setting. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; If you do not have access to your server, use PHPMyAdmin (or another MySQL client) and enter the command &amp;lt;code&amp;gt;SET @@global.sql_mode=&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;;&amp;lt;/code&amp;gt; (be sure to use single quotes, and don&#039;t forget the semicolon).&lt;br /&gt;
&lt;br /&gt;
====Using a hosted server====&lt;br /&gt;
If you are using a webhost, they will probably have a control panel web interface for you to create your database.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;[http://www.cpanel.com/ cPanel]&#039;&#039;&#039; system is one of the most popular of these. To create a database in cPanel,&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;quot;&#039;&#039;&#039;MySQL Databases&#039;&#039;&#039;&amp;quot; icon.&lt;br /&gt;
# Type &amp;quot;moodle&amp;quot; in the database field and click &amp;quot;&#039;&#039;&#039;Add Database&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
# Type a username and password (not one you use elsewhere) in the respective fields and click &amp;quot;&#039;&#039;&#039;Add User&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
# Now use the &amp;quot;&#039;&#039;&#039;Add User to Database&#039;&#039;&#039;&amp;quot; button to give this new user account &amp;quot;&#039;&#039;&#039;ALL&#039;&#039;&#039;&amp;quot; rights to the new database.&lt;br /&gt;
# Note that the username and database names may be prefixed by your cPanel account name. When entering this information into the Moodle installer - use the full names.&lt;br /&gt;
&lt;br /&gt;
====Using the command line====&lt;br /&gt;
&lt;br /&gt;
If you have access to Unix or Windows command lines then you can do the same sort of thing by typing commands. You should do this using the MySQL Client program as follows (commands which you type-in are shown in bold):&lt;br /&gt;
&lt;br /&gt;
- Start the MySQL Client program:&lt;br /&gt;
 #&#039;&#039;&#039;mysql -u root -p&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;
 Your MySQL connection id is 2 to server version: 5.0.22-log&lt;br /&gt;
 &lt;br /&gt;
 Type &#039;help;&#039; or &#039;\h&#039; for help. Type &#039;\c&#039; to clear the buffer.&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The prompt changes to &amp;quot;mysql&amp;gt;&amp;quot; to indicate that you are now working in the MySQL Client program. When working in MySQL, all commands which you type-in must end in a semi-colon. (If you hit the Enter key without the final semi-colon, you&#039;ll get the line continuation symbol &#039;-&amp;gt;&#039;; this is your second chance to type the semi-colon and hit Enter.) &lt;br /&gt;
&lt;br /&gt;
- Begin by checking for any existing databases called &amp;quot;moodle&amp;quot; - if there are any you should change the name in all the commands which follow:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;SHOW DATABASES;&#039;&#039;&#039;&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | Database                |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 | information_schema      |&lt;br /&gt;
 | mysql                   |&lt;br /&gt;
 | test                    |&lt;br /&gt;
 +-------------------------+&lt;br /&gt;
 3 rows in set (0.03 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a database to store the Moodle tables. We&#039;ll call this &amp;quot;moodle&amp;quot;, as there are none with that name already in the above list, but change it if you need to.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;CREATE DATABASE moodle;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Change the default character set and collation of the &amp;quot;moodle&amp;quot; database to UTF8. Leave this out if you are installing Moodle 1.5 or earlier):&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 1 row affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
- Create a username and password to access the database &amp;quot;moodle&amp;quot; and grant database access permissions. We&#039;ll call the user &amp;quot;moodleuser&amp;quot; and set the password as &amp;quot;yourpassword&amp;quot;. It&#039;s a good idea to change these for your installation however most people keep the username as &amp;quot;moodleuser&amp;quot;. Remember the username and password you have set, as you&#039;ll need it in the configuration screens later. This is a long command so has been split over several lines by pressing the Return key.&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;DROP,INDEX,ALTER ON moodle.*&#039;&#039;&#039;&lt;br /&gt;
     -&amp;gt; &#039;&#039;&#039;TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;;&#039;&#039;&#039;&lt;br /&gt;
 Query OK, 0 rows affected (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Security Warnings&#039;&#039;&#039;: Never leave the password as the one shown here. Make sure you have a strong password (a mixture of letters and numbers, upper and lower case). Avoid granting &amp;quot;ALL&amp;quot; permissions on the database.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: For MySQL 4.0.1 or earlier, you don&#039;t need the CREATE TEMPORARY TABLES permission. &lt;br /&gt;
&lt;br /&gt;
- Exit the MySQL Client program:&lt;br /&gt;
 mysql&amp;gt; &#039;&#039;&#039;QUIT&#039;&#039;&#039;&lt;br /&gt;
 Bye&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
- Reload the grant tables using the mysqladmin program:&lt;br /&gt;
 #&#039;&#039;&#039;mysqladmin -u root -p reload&#039;&#039;&#039;&lt;br /&gt;
 Enter password:&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
And some example command lines for PostgreSQL:&lt;br /&gt;
&lt;br /&gt;
   # su - postgres&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create user moodleuser createdb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create database moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;with encoding &#039;unicode&#039;&amp;lt;/font&amp;gt;;&amp;quot; -U moodleuser template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser nocreatedb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser with encrypted password &#039;yourpassword&#039;;&amp;quot; template1&lt;br /&gt;
   &amp;gt; su - root&lt;br /&gt;
   # /etc/init.d/postgresql reload&lt;br /&gt;
&lt;br /&gt;
If the Postgres create database command above (&amp;gt;psql -c &amp;quot;create database moodle...&amp;quot;) gives an error message you may want to try:&lt;br /&gt;
 psql -c &amp;quot;create database moodle with template=template1 encoding = &#039;unicode&#039; owner =  moodleuser &amp;lt;br&amp;gt;     location = &#039;/var/mydata&#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the create database command asks you for a password, run the line containing &#039;encrypted password&#039; first before proceeding.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;:&lt;br /&gt;
* Step-by-step instructions on  [https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Ubuntu installation for Ubuntu(Debian)]&lt;br /&gt;
&lt;br /&gt;
=== Creating the data directory (moodledata) ===&lt;br /&gt;
&lt;br /&gt;
Moodle will also need some space on your server&#039;s hard disk to store uploaded files, such as course documents and user pictures. The Moodle installer tries hard to create this directory for you but if it fails then you will have to create a directory for this purpose manually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Security warning&#039;&#039;&#039;: For security purposes, it&#039;s best that this directory is NOT accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web directory, but if you must have it in the web directory (and you are using Apache) then protect it by creating a file in the data directory called &#039;&#039;&#039;.htaccess&#039;&#039;&#039;, containing this line:&lt;br /&gt;
&lt;br /&gt;
 deny from all&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ownership &amp;amp; Permissions&#039;&#039;&#039;: To make sure that Moodle can save uploaded files in this directory, check that the web server software has permission to read, write and execute in this directory. On Unix machines, this means setting the owner of the directory to be something like &amp;quot;nobody&amp;quot; or &amp;quot;apache&amp;quot;, and then giving that user read, write and execute permissions. As an example, to change the owner to &amp;quot;nobody&amp;quot; you could use:&lt;br /&gt;
&lt;br /&gt;
 chown -R nobody:nobody moodledata&lt;br /&gt;
&lt;br /&gt;
To change the permissions so that the owner has read,write and execute permissions, use something like this:&lt;br /&gt;
&lt;br /&gt;
 chmod -R 0770 moodledata&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are receiving permission denied messages, try &#039;&#039;chmod -R 0770 moodledata&#039;&#039; and then adjust the settings so that they are more secure. A more secure setting is &#039;&#039;chmod -R 0750 moodledata&#039;&#039;. According to the comments in config-dist.php, &amp;quot;On hosting systems you might need to make sure that your group has no permissions at all while others have full permissions.&amp;quot; To do this you could use &#039;&#039;chmod -R 707 moodledata&#039;&#039;. See also the [[Security | security page]].&lt;br /&gt;
&lt;br /&gt;
Remember that by default moodle will issue a warning about moodle data directories created inside the web directory, but otherwise this directory can be located where you wish. You can later move or change the location of this directory, but if you do, be sure to edit the setting in the &#039;&#039;&#039;config.php&#039;&#039;&#039; file that sets this; e.g. if moodledata is under a directory called data, then it would look like this:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dataroot  = &#039;/data/moodledata&#039;;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CPanel and webhosts&#039;&#039;&#039;: On cPanel systems you can use the &amp;quot;File Manager&amp;quot; to find the folder, click on it, then choose &amp;quot;Change Permissions&amp;quot;. On many shared hosting servers, you will probably need to restrict all file access to your &amp;quot;group&amp;quot; (to prevent other webhost customers from looking at or changing your files), but provide full read/write access to everyone else (which will allow the web server to access your files). Speak to your server administrator if you are having trouble setting this up securely. In particular it will not be possible to create a usable data directory on sites that use a PHP feature known as &amp;quot;&#039;&#039;&#039;Safe Mode&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Run the installer script to create config.php ==&lt;br /&gt;
&lt;br /&gt;
To run the installer script (install.php), just try to access your Moodle main URL using a web browser, or access &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourserver/install.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; directly.&lt;br /&gt;
&lt;br /&gt;
(The Installer will try to set a session cookie. If you get a popup warning in your browser make sure you accept that cookie!)&lt;br /&gt;
&lt;br /&gt;
Moodle will detect that configuration is necessary and will lead you through some screens to help you create a new configuration file called &#039;&#039;&#039;config.php&#039;&#039;&#039;. At the end of the process Moodle will try and write the file into the right location, otherwise you can press a button to download it from the installer and then upload &#039;&#039;&#039;config.php&#039;&#039;&#039; into the main Moodle directory on the server.&lt;br /&gt;
&lt;br /&gt;
Along the way the installer will test your server environment and give you suggestions about how to fix any problems. For most common issues these suggestions should be sufficient, but if you get stuck, check in the Installation Forum for more help. &lt;br /&gt;
&lt;br /&gt;
== Go to the admin page to continue configuration ==&lt;br /&gt;
&lt;br /&gt;
Once the basic config.php has been correctly created in the previous step, trying to access the front page of your site will take you the &amp;quot;admin&amp;quot; page for the rest of the configuration.&lt;br /&gt;
&lt;br /&gt;
The first time you access this admin page, you will be presented with a GPL &amp;quot;shrink wrap&amp;quot; agreement with which you must agree before you can continue with the setup.&lt;br /&gt;
&lt;br /&gt;
Now Moodle will start setting up your database and creating tables to store data. Firstly, the main database tables are created. You should see a number of SQL statements followed by status messages that look like this:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE course (&lt;br /&gt;
    id int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
    category int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    password varchar(50) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    fullname varchar(254) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    shortname varchar(15) NOT NULL default &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
    summary text NOT NULL,&lt;br /&gt;
    format tinyint(4) NOT NULL default &#039;1&#039;,&lt;br /&gt;
    teacher varchar(100) NOT NULL default &#039;Teacher&#039;,&lt;br /&gt;
    startdate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    enddate int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    timemodified int(10) unsigned NOT NULL default &#039;0&#039;,&lt;br /&gt;
    PRIMARY KEY (id)&lt;br /&gt;
 ) TYPE=MyISAM;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;SUCCESS&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and so on, followed by: &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Main databases set up successfully.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see these, then there must have been some problem with the database or the configuration settings you defined in config.php. Check that PHP isn&#039;t in a restricted &amp;quot;Safe Mode&amp;quot; (commercial web hosts sometimes have safe mode turned on). You can check PHP variables by creating a little file containing &#039;&#039;&#039;&amp;lt;?php phpinfo() ?&amp;gt;&#039;&#039;&#039; and looking at it through a browser. Check all these and try this page again.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
You should now see a form where you can define more configuration variables for your installation, such as the default language, SMTP hosts and so on. Don&#039;t worry too much about getting everything right just now - you can always come back and edit these later on using the admin interface. The defaults are designed to be useful and secure for most sites. Scroll down to the bottom and click &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If (and only if) you find yourself getting stuck on this page, unable to continue, then your server probably has what I call the &amp;quot;buggy referrer&amp;quot; problem. This is easy to fix: just turn off the &amp;quot;secureforms&amp;quot; setting, then try to continue again.&lt;br /&gt;
&lt;br /&gt;
Next you will see more pages that print lots of status messages as they set up all the tables required by the various Moodle module. As before, they should all be &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;green&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
The next page is a form where you can define parameters for your Moodle site and the front page, such as the name, format, description and so on. Fill this out (you can always come back and change these later) and then press &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finally, you will then be asked to create a top-level administration user for future access to the admin pages. Fill out the details with your own name, email etc and then click &amp;quot;Save changes&amp;quot;. Not all the fields are required, but if you miss any important fields you&#039;ll be re-prompted for them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure you remember the username and password you chose for the administration user account, as they will be necessary to access the administration page in future.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(If for any reason your install is interrupted, or there is a system error of some kind that prevents you from logging in using the admin account, you can usually log in using the default username of &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;, with password &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Once successful, you will be returned to the home page of your new site! Note the administration links that appear down the left hand side of the page (these items also appear on a separate Admin page) - these items are only visible to you because you are logged in as the admin user. All your further administration of Moodle can now be done using this menu, such as:&lt;br /&gt;
&lt;br /&gt;
* creating and deleting courses&lt;br /&gt;
* creating and editing user accounts&lt;br /&gt;
* administering teacher accounts&lt;br /&gt;
* changing site-wide settings like themes etc&lt;br /&gt;
&lt;br /&gt;
But you are not done installing yet! There is one very important thing still to do (see the next section on cron).&lt;br /&gt;
&lt;br /&gt;
== Set up cron ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
&lt;br /&gt;
== Set up backups ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Backup (administrator)| Backup instructions]].&lt;br /&gt;
&lt;br /&gt;
== Create a new course ==&lt;br /&gt;
&lt;br /&gt;
Now that Moodle is running properly, you can try creating a new course to play with.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Create a new course&amp;quot; from the Admin page (or the admin links on the home page).&lt;br /&gt;
&lt;br /&gt;
Fill out the form, paying special attention to the course format. You don&#039;t have to worry about the details too much at this stage, as everything can be changed later by the teacher. Note that the yellow help icons are everywhere to provide contextual help on any aspect.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;Save changes&amp;quot;, and you will be taken to a new form where you can assign teachers to the course. You can only add existing user accounts from this form - if you want to create a new teacher account then either ask the teacher to create one for themselves (see the login page), or create one for them using the &amp;quot;Add a new user&amp;quot; on the Admin page.&lt;br /&gt;
&lt;br /&gt;
Once done, the course is ready to customize, and is accessible via the &amp;quot;Courses&amp;quot; link on the home page.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
*[[Complete install packages]] might be an easier first time installs on some systems&lt;br /&gt;
* [[Installing Apache, MySQL and PHP]] - Open source programs that can run Moodle on the web or on a desktop&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=42688 Selecting a web host for Moodle] forum discussion&lt;br /&gt;
* [[masquerading|Masquerading]] - Running Moodle behind a masquerading/NAT firewall&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[cs:Instalace]]&lt;br /&gt;
[[de:Installieren von Moodle]]&lt;br /&gt;
[[es:Instalación de moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;br /&gt;
[[nl:Installatiegids]]&lt;br /&gt;
[[ru:Установка Moodle]]&lt;br /&gt;
[[sk:Inštalácia]]&lt;br /&gt;
[[zh:安装Moodlezh:]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Unicode&amp;diff=27886</id>
		<title>Unicode</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Unicode&amp;diff=27886"/>
		<updated>2007-10-15T13:17:03Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: clarified versions affected&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Unicode Unicode] is a character set that allows one to support practically any language and many special characters used in science, math and technology. Moodle transformed (optionally in 1.6 and 1.7, required in 1.8 on) to Unicode to better be able to support different languages.&lt;br /&gt;
&lt;br /&gt;
In MySQL, the database collation has to be set to unicode before the Moodle database is created. There are two different Unicode collations used: utf8_general_ci (default) and utf8_unicode_ci. The utf8_general_ci collation is slightly faster but less accurate than the utf8_unicode_ci collation in representing all the characters in languages. For this reason, Moodle tables are normally set-up using the utf8_unicode_ci collation. For a discussion of the difference between the collations see [http://dev.mysql.com/doc/refman/4.1/en/charset-unicode-sets.html the MySQL documentation].&lt;br /&gt;
&lt;br /&gt;
[http://www-atm.physics.ox.ac.uk/user/iwi/charmap.html Free On-line Unicode Character Map] gives you the possibility to see the different characters that are supported (or NOT!) in your browser and see which code is used if you need that. A nice feature with the  characters is that you can easily enlarge the text in your browser to see them better. ([Ctrl]+[+] in Mozilla) If you are interested in Math symbols check list &amp;quot;22 Mathematical Operators&amp;quot;. For Chemists looking for arrows, list &amp;quot;21&amp;quot; might be interesting.&lt;br /&gt;
&lt;br /&gt;
Moodle has good support for mathematical expressions in its TeX filter, but using Unicode instead can sometimes be good. In some places (i.e. [[Cloze|CLOZE]] questions) the \ characters for TeX can cause problems, whereas Unicode characters won&#039;t. A user can enlarge an expression with Unicode.&lt;br /&gt;
&lt;br /&gt;
[[Category: Administrator]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Cookieless_Sessions&amp;diff=27103</id>
		<title>Cookieless Sessions</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Cookieless_Sessions&amp;diff=27103"/>
		<updated>2007-09-19T20:28:48Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: corrected grammar by deleting &amp;quot;through&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 1.6}}&lt;br /&gt;
In Moodle 1.6 we&#039;ve added support for cookieless sessions to Moodle. The code will need testing in the different modules to check that it works in all areas of a site. You can test it by turning cookies off in your browser or disallowing cookies just for your Moodle site. Post any bugs you find here : http://tracker.moodle.org/browse/MDL-4504&lt;br /&gt;
&lt;br /&gt;
Cookieless sessions work by appending a session id to every url or to hidden form fields in forms in html pages so that php can track sessions. When cookieless sessions are turned on then code in lib/cookieless.php will automatically add session ids in the absence of cookies. &#039;&#039;The code will fail when javascript is used to jump from page to page.&#039;&#039; So when using javascript to jump to a new page then you can call a function in lib/cookieless.php to add session ids to the URL, as follows :&lt;br /&gt;
&lt;br /&gt;
    if (!empty($CFG-&amp;gt;usesid) &amp;amp;&amp;amp; !isset($_COOKIE[session_name()])) {&lt;br /&gt;
        $attempturl=sid_process_url(&amp;quot;attempt.php?id=$cm-&amp;gt;id&amp;quot;);&lt;br /&gt;
    } else {&lt;br /&gt;
        $attempturl=&amp;quot;attempt.php?id=$cm-&amp;gt;id&amp;quot;;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to include cookieless.php it will have been included already if needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enable cookieless sessions by including $CFG-&amp;gt;usesid=true; in config.php.&lt;br /&gt;
Based on code from php manual by Richard at postamble.co.uk&lt;br /&gt;
&lt;br /&gt;
Attempts to use cookies if cookies not present then uses session ids attached to all urls and forms to pass session id from page to page.&lt;br /&gt;
If site is open to google, google is given guest access as usual and there are no sessions. No session ids will be attached to urls for googlebot.&lt;br /&gt;
This doesn&#039;t require trans_sid to be turned on but this is recommended for better performance you should put &#039;&#039;&#039;session.use_trans_sid = 1&#039;&#039;&#039; in your php.ini file and make sure that you don&#039;t have a line like this in your php.ini: &#039;&#039;&#039;session.use_only_cookies = 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
author Richard at postamble.co.uk and Jamie Pratt&lt;br /&gt;
license http://www.gnu.org/copyleft/gpl.html GNU Public License&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Administrator]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:XMLDB_introduction&amp;diff=26435</id>
		<title>Development:XMLDB introduction</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:XMLDB_introduction&amp;diff=26435"/>
		<updated>2007-08-29T10:53:08Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* The process */ grammar corrections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Development:XMLDB Documentation|XMLDB Documentation]] &amp;gt; Introduction&lt;br /&gt;
----&lt;br /&gt;
__NOTOC__&lt;br /&gt;
One of the main upcoming features in Moodle 1.7 will be its ability to work with some more [[wikipedia:RDBMS|RDBMS]] ([[wikipedia:MSSQL|MSSQL]] and [[wikipedia:Oracle database|Oracle]]) while maintaining everything working properly with both [[MySQL]] and [[PostgreSQL]]. As Moodle core uses [http://adodb.sourceforge.net/ ADOdb] internally, this possibility has been present since the beginning and, with the current maturity of the project (5 years old baby!), this can be a good moment to sort all this out.&lt;br /&gt;
&lt;br /&gt;
Initially, all our tests and preliminary work was to inspect how [http://adodb.sourceforge.net/ ADOdb] was doing its work, and how we could mix together all those 4 RDBMS, whose SQL dialects, although pretty similar, have some differences and idiosyncrasies that force us to do some important changes to our current database code (formerly &#039;&#039;&#039;datalib.php&#039;&#039;&#039;) and how it&#039;s used by the rest of Moodle.&lt;br /&gt;
&lt;br /&gt;
All the changes to be performed, which primary objective is to enable Moodle to work with more RDBMS must be be filled following the next non-functional requirements: &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provide one layer (new) for DB creation/upgrade&#039;&#039;&#039; ([[wikipedia:Data_Definition_Language|DDL]]): With this, developers will create their structures in one neutral form, independent of the exact implementation to be used by each RDBMS.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provide one layer (existing) for DB handling&#039;&#039;&#039; ([[wikipedia:Data_Manipulation_Language|DML]]): With this, developers will request/store information also in one neutral form, independent of the RDBMS being used.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy migration path from previous versions&#039;&#039;&#039;: The current installation/upgrade system will work until, at least, Moodle 2.0, allowing 3rd part developers to migrate along the time to the new system.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Simple, usable and effective&#039;&#039;&#039;: Until now, the way to upgrade Moodle has been really cool and it has worked pretty fine since the beginning, but it has forced developers to maintain at least two installation and two upgrade scripts for each module/plugin. The new alternative will have only one file to install and one file to upgrade (per module/plugin too), reducing the possibility of mistakes in an high degree.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Conditional code usage must be minimised&#039;&#039;&#039;: Database libraries must accept 99% of potential SQL sentences, building/transforming them as necessary to work properly under any RDBMS. The number of places using custom (per DB) code should be minimum.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Well documented&#039;&#039;&#039;: All the functions defined, both at DML and DDL level must be well documented, helping the developer to find and use the correct one in each situation.&lt;br /&gt;
&lt;br /&gt;
== The Stack ==&lt;br /&gt;
&lt;br /&gt;
The next stack shows how Moodle 1.7 code will interact with underlying RDBMS. It will help us to understand a bit more what we are trying to do and will explain some of the points related in the Roadmap (below in this page).&lt;br /&gt;
&lt;br /&gt;
[[Image:MoodleDBStack.png|center]]&lt;br /&gt;
&lt;br /&gt;
Moodle code will use two &#039;&#039;languages&#039;&#039; to perform its DB actions:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;XMLDB neutral description files&#039;&#039;&#039;: To create, modify and delete database objects (DDL: create/alter/drop tables, fields, indexes, constraints...). It consists in a collection of validated, standard, XML files. They will be used to define all the DB objects. New for 1.7.&lt;br /&gt;
* &#039;&#039;&#039;Moodle SQL neutral statements&#039;&#039;&#039;: To add, modify, delete and select database information (DML: insert/update/delete/select records). To modify for 1.7.&lt;br /&gt;
&lt;br /&gt;
Please note the &#039;&#039;&#039;neutral&#039;&#039;&#039; keyword used in the expressions above. It means that both &#039;&#039;&#039;languages&#039;&#039;&#039; will be 100% the same, independently  of the underlying RDBMS being used. And this must be particularly true for the XMLDB part. Point.&lt;br /&gt;
&lt;br /&gt;
Obviously it&#039;s possible that in the SQL part we found some specialised queries (using complex joins, regular expressions...) that will force us to do some &#039;&#039;&#039;Exceptions&#039;&#039;&#039;. Well, they can exist (in fact, they exist), but we always must try to provide an alternate path to minimise them using neutral statements and standard libraries.&lt;br /&gt;
&lt;br /&gt;
Each one of the &#039;&#039;&#039;languages&#039;&#039;&#039; above will use its own library to do the work:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Moodle DDL Library&#039;&#039;&#039; ([[DDL functions|ddllib.php]]): Where all the functions needed to handle DB objects will exist. This library is new for 1.7 and will provide developers with an high level of abstraction. As input it will accept some well defined objects and actions and it will execute the proper commands for the RDBMS being used.&lt;br /&gt;
* &#039;&#039;&#039;Moodle DML Library&#039;&#039;&#039; ([[DML functions|dmllib.php]]): Where all the functions needed to handle DB contents will exist. This library is new for 1.7, although its contents are, basically, functions currently present in &#039;&#039;&#039;datalib.php&#039;&#039;&#039; (moved from there). All those DML functions will offer cross-db support for insert/update/delete/select statements using a common behaviour.&lt;br /&gt;
&lt;br /&gt;
Also note that &#039;&#039;&#039;datalib.php&#039;&#039;&#039; continues present in the schema above. It will contain all the functions that haven&#039;t been moved to the new &#039;&#039;&#039;ddllib.php&#039;&#039;&#039; and &#039;&#039;&#039;dmllib.php&#039;&#039;&#039; libraries. Only some common functions will remain there, and this situation will disappear (it&#039;s considered a legacy library) in upcoming &#039;&#039;&#039;Moodle&#039;&#039;&#039; releases (after 1.7) by moving all those functions to their proper library (course/lib.php, user/lib.php....). &lt;br /&gt;
&lt;br /&gt;
Both these libraries (plus the small &#039;&#039;&#039;Exceptions&#039;&#039;&#039; bar) will perform all their actions using the &#039;&#039;&#039;ADOdb Database Abstraction Library for PHP&#039;&#039;&#039; that will receive all the requests from them, communicate with the DB (&#039;&#039;&#039;MySQL&#039;&#039;&#039;, &#039;&#039;&#039;PostgreSQL&#039;&#039;&#039;, &#039;&#039;&#039;Oracle&#039;&#039;&#039; or &#039;&#039;&#039;SQL*Server&#039;&#039;&#039;), retrieve results and forward them back to originator library.&lt;br /&gt;
&lt;br /&gt;
== The process ==&lt;br /&gt;
&lt;br /&gt;
This section points to the main areas of information about the &#039;&#039;&#039;process of design and implementation&#039;&#039;&#039; of the new XMLDB layer:&lt;br /&gt;
&lt;br /&gt;
* [[XMLDB Roadmap|Roadmap]]: Where the whole process is defined. It has been split into small chuncks to be performed and tested easily. Also, such documents should be used to track what&#039;s done and what&#039;s pending following some easy nomenclature.&lt;br /&gt;
&lt;br /&gt;
* [[XMLDB Problems|Problems]]: A comprensive list of issues that need to be determined/solved prior to incorporating them into the [[XMLDB Roadmap|roadmap]].&lt;br /&gt;
&lt;br /&gt;
== The documentation ==&lt;br /&gt;
&lt;br /&gt;
This section points to the &#039;&#039;&#039;main documentation index&#039;&#039;&#039; about the implemented XMLDB:&lt;br /&gt;
&lt;br /&gt;
* [[Development:XMLDB Documentation|Documentation]]: Where you&#039;ll find quick links to different parts of the XMLDB documentation.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
=== XMLDB related ===&lt;br /&gt;
&lt;br /&gt;
* [[Development:XMLDB preliminary links|XMLDB preliminary links]] - A collection of links about general info, searched and analysed at the initial stages of the project&lt;br /&gt;
* [[Development:XMLDB preliminary notes|XMLDB preliminary notes]] - A collection of notes collected in the early stages of this project, pointing both to some changes required and some problems to solve.&lt;br /&gt;
&lt;br /&gt;
=== Database related ===&lt;br /&gt;
&lt;br /&gt;
* [[Development:DDL functions|DDL functions]] - Documentation for all the Data Definition Language (DDL) functions available inside Moodle.&lt;br /&gt;
* [[Development:DML functions|DML functions]] - Documentation for all the Data Manipulation Language (DML) functions available inside Moodle.&lt;br /&gt;
&lt;br /&gt;
[[Category:XMLDB]]&lt;br /&gt;
&lt;br /&gt;
[[zh:开发:XML数据库计划]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:XMLDB_introduction&amp;diff=26389</id>
		<title>Development:XMLDB introduction</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:XMLDB_introduction&amp;diff=26389"/>
		<updated>2007-08-28T11:22:46Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* The Stack */ correct grammar: this libraries -&amp;gt; these libraries, request -&amp;gt; requests&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Development:XMLDB Documentation|XMLDB Documentation]] &amp;gt; Introduction&lt;br /&gt;
----&lt;br /&gt;
__NOTOC__&lt;br /&gt;
One of the main upcoming features in Moodle 1.7 will be its ability to work with some more [[wikipedia:RDBMS|RDBMS]] ([[wikipedia:MSSQL|MSSQL]] and [[wikipedia:Oracle database|Oracle]]) while maintaining everything working properly with both [[MySQL]] and [[PostgreSQL]]. As Moodle core uses [http://adodb.sourceforge.net/ ADOdb] internally, this possibility has been present since the beginning and, with the current maturity of the project (5 years old baby!), this can be a good moment to sort all this out.&lt;br /&gt;
&lt;br /&gt;
Initially, all our tests and preliminary work was to inspect how [http://adodb.sourceforge.net/ ADOdb] was doing its work, and how we could mix together all those 4 RDBMS, whose SQL dialects, although pretty similar, have some differences and idiosyncrasies that force us to do some important changes to our current database code (formerly &#039;&#039;&#039;datalib.php&#039;&#039;&#039;) and how it&#039;s used by the rest of Moodle.&lt;br /&gt;
&lt;br /&gt;
All the changes to be performed, which primary objective is to enable Moodle to work with more RDBMS must be be filled following the next non-functional requirements: &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provide one layer (new) for DB creation/upgrade&#039;&#039;&#039; ([[wikipedia:Data_Definition_Language|DDL]]): With this, developers will create their structures in one neutral form, independent of the exact implementation to be used by each RDBMS.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Provide one layer (existing) for DB handling&#039;&#039;&#039; ([[wikipedia:Data_Manipulation_Language|DML]]): With this, developers will request/store information also in one neutral form, independent of the RDBMS being used.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy migration path from previous versions&#039;&#039;&#039;: The current installation/upgrade system will work until, at least, Moodle 2.0, allowing 3rd part developers to migrate along the time to the new system.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Simple, usable and effective&#039;&#039;&#039;: Until now, the way to upgrade Moodle has been really cool and it has worked pretty fine since the beginning, but it has forced developers to maintain at least two installation and two upgrade scripts for each module/plugin. The new alternative will have only one file to install and one file to upgrade (per module/plugin too), reducing the possibility of mistakes in an high degree.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Conditional code usage must be minimised&#039;&#039;&#039;: Database libraries must accept 99% of potential SQL sentences, building/transforming them as necessary to work properly under any RDBMS. The number of places using custom (per DB) code should be minimum.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Well documented&#039;&#039;&#039;: All the functions defined, both at DML and DDL level must be well documented, helping the developer to find and use the correct one in each situation.&lt;br /&gt;
&lt;br /&gt;
== The Stack ==&lt;br /&gt;
&lt;br /&gt;
The next stack shows how Moodle 1.7 code will interact with underlying RDBMS. It will help us to understand a bit more what we are trying to do and will explain some of the points related in the Roadmap (below in this page).&lt;br /&gt;
&lt;br /&gt;
[[Image:MoodleDBStack.png|center]]&lt;br /&gt;
&lt;br /&gt;
Moodle code will use two &#039;&#039;languages&#039;&#039; to perform its DB actions:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;XMLDB neutral description files&#039;&#039;&#039;: To create, modify and delete database objects (DDL: create/alter/drop tables, fields, indexes, constraints...). It consists in a collection of validated, standard, XML files. They will be used to define all the DB objects. New for 1.7.&lt;br /&gt;
* &#039;&#039;&#039;Moodle SQL neutral statements&#039;&#039;&#039;: To add, modify, delete and select database information (DML: insert/update/delete/select records). To modify for 1.7.&lt;br /&gt;
&lt;br /&gt;
Please note the &#039;&#039;&#039;neutral&#039;&#039;&#039; keyword used in the expressions above. It means that both &#039;&#039;&#039;languages&#039;&#039;&#039; will be 100% the same, independently  of the underlying RDBMS being used. And this must be particularly true for the XMLDB part. Point.&lt;br /&gt;
&lt;br /&gt;
Obviously it&#039;s possible that in the SQL part we found some specialised queries (using complex joins, regular expressions...) that will force us to do some &#039;&#039;&#039;Exceptions&#039;&#039;&#039;. Well, they can exist (in fact, they exist), but we always must try to provide an alternate path to minimise them using neutral statements and standard libraries.&lt;br /&gt;
&lt;br /&gt;
Each one of the &#039;&#039;&#039;languages&#039;&#039;&#039; above will use its own library to do the work:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Moodle DDL Library&#039;&#039;&#039; ([[DDL functions|ddllib.php]]): Where all the functions needed to handle DB objects will exist. This library is new for 1.7 and will provide developers with an high level of abstraction. As input it will accept some well defined objects and actions and it will execute the proper commands for the RDBMS being used.&lt;br /&gt;
* &#039;&#039;&#039;Moodle DML Library&#039;&#039;&#039; ([[DML functions|dmllib.php]]): Where all the functions needed to handle DB contents will exist. This library is new for 1.7, although its contents are, basically, functions currently present in &#039;&#039;&#039;datalib.php&#039;&#039;&#039; (moved from there). All those DML functions will offer cross-db support for insert/update/delete/select statements using a common behaviour.&lt;br /&gt;
&lt;br /&gt;
Also note that &#039;&#039;&#039;datalib.php&#039;&#039;&#039; continues present in the schema above. It will contain all the functions that haven&#039;t been moved to the new &#039;&#039;&#039;ddllib.php&#039;&#039;&#039; and &#039;&#039;&#039;dmllib.php&#039;&#039;&#039; libraries. Only some common functions will remain there, and this situation will disappear (it&#039;s considered a legacy library) in upcoming &#039;&#039;&#039;Moodle&#039;&#039;&#039; releases (after 1.7) by moving all those functions to their proper library (course/lib.php, user/lib.php....). &lt;br /&gt;
&lt;br /&gt;
Both these libraries (plus the small &#039;&#039;&#039;Exceptions&#039;&#039;&#039; bar) will perform all their actions using the &#039;&#039;&#039;ADOdb Database Abstraction Library for PHP&#039;&#039;&#039; that will receive all the requests from them, communicate with the DB (&#039;&#039;&#039;MySQL&#039;&#039;&#039;, &#039;&#039;&#039;PostgreSQL&#039;&#039;&#039;, &#039;&#039;&#039;Oracle&#039;&#039;&#039; or &#039;&#039;&#039;SQL*Server&#039;&#039;&#039;), retrieve results and forward them back to originator library.&lt;br /&gt;
&lt;br /&gt;
== The process ==&lt;br /&gt;
&lt;br /&gt;
This section points to the main areas of information about the &#039;&#039;&#039;process of design and implementation&#039;&#039;&#039; of the new XMLDB layer:&lt;br /&gt;
&lt;br /&gt;
* [[XMLDB Roadmap|Roadmap]]: Where the whole process is defined. It has been splitted in small chuncks to be performed and tested easily. Also, such documents should be used to track what&#039;s done and what&#039;s pending following some easy nomenclature.&lt;br /&gt;
&lt;br /&gt;
* [[XMLDB Problems|Problems]]: A comprensive list of issues that need to be determined/solved prior to incorporate them to the [[XMLDB Roadmap|roadmap]].&lt;br /&gt;
&lt;br /&gt;
== The documentation ==&lt;br /&gt;
&lt;br /&gt;
This section points to the &#039;&#039;&#039;main documentation index&#039;&#039;&#039; about the implemented XMLDB:&lt;br /&gt;
&lt;br /&gt;
* [[Development:XMLDB Documentation|Documentation]]: Where you&#039;ll find quick links to different parts of the XMLDB documentation.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
=== XMLDB related ===&lt;br /&gt;
&lt;br /&gt;
* [[Development:XMLDB preliminary links|XMLDB preliminary links]] - A collection of links about general info, searched and analysed at the initial stages of the project&lt;br /&gt;
* [[Development:XMLDB preliminary notes|XMLDB preliminary notes]] - A collection of notes collected in the early stages of this project, pointing both to some changes required and some problems to solve.&lt;br /&gt;
&lt;br /&gt;
=== Database related ===&lt;br /&gt;
&lt;br /&gt;
* [[Development:DDL functions|DDL functions]] - Documentation for all the Data Definition Language (DDL) functions available inside Moodle.&lt;br /&gt;
* [[Development:DML functions|DML functions]] - Documentation for all the Data Manipulation Language (DML) functions available inside Moodle.&lt;br /&gt;
&lt;br /&gt;
[[Category:XMLDB]]&lt;br /&gt;
&lt;br /&gt;
[[zh:开发:XML数据库计划]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Output_functions&amp;diff=25186</id>
		<title>Development:Output functions</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Output_functions&amp;diff=25186"/>
		<updated>2007-07-18T10:27:35Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* print_textarea() */  correct grammar (tense agreement)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tries to explain a bit how dynamic data should be sent from Moodle to the browser in an organised and standard way. Obviously it&#039;s possible to have your own output methods but, thinking that you are going to share your code (yep, this is an OpenSource project!) and in the collaborative way we try to build and maintain the system every day, it would be really better to follow the basic guidelines explained below.&lt;br /&gt;
&lt;br /&gt;
By using them you will be helping to have better, more secure and readable code. Spend some minutes trying to understand them, please!&lt;br /&gt;
&lt;br /&gt;
Of course, these functions can be discussed, modified and new functions can arrive if there are some good reasons for it. Just discuss it in the [http://moodle.org/mod/forum/view.php?id=55 General developer forum] at [http://moodle.org moodle.org].&lt;br /&gt;
&lt;br /&gt;
For each of the functions below we&#039;ll try to explain when they should be used, explaining the most important parameters supported and their meaning. Let&#039;s review them!&lt;br /&gt;
&lt;br /&gt;
=== p() and s() ===&lt;br /&gt;
&lt;br /&gt;
 function s($var, $strip=false)&lt;br /&gt;
 function p($var, $strip=false)&lt;br /&gt;
&lt;br /&gt;
These functions share the same code so they will be explained together. The only difference is that s() returns the string while p() prints it directly.&lt;br /&gt;
&lt;br /&gt;
These functions should be used to:&lt;br /&gt;
&lt;br /&gt;
* print all the &#039;&#039;&#039;values of form fields&#039;&#039;&#039; like &amp;lt;nowiki&amp;gt;&amp;lt;input&amp;gt;&amp;lt;/nowiki&amp;gt; or &amp;lt;nowiki&amp;gt;&amp;lt;textarea&amp;gt;&amp;lt;/nowiki&amp;gt; tags.&lt;br /&gt;
* to &#039;&#039;&#039;show plain (non html) text&#039;&#039;&#039; that has been introduced by the user (search string, quiz responses...).&lt;br /&gt;
* in general, all the &#039;&#039;&#039;dynamic data, not being html&#039;&#039;&#039;, that doesn&#039;t need to be cleaned nor processed by filters&lt;br /&gt;
&lt;br /&gt;
It is important not to use these functions for strings that contain html markup.&lt;br /&gt;
&lt;br /&gt;
The functions replace certain characters that would have special meaning in html ( &amp;lt;, &amp;gt;, &amp;quot;, &#039;, and &amp;amp;) by html entities so that they are displayed as intended. Note that even though the value of form fields printed with p() will have these characters converted to html entities, the submitted values will contain the original characters again.&lt;br /&gt;
&lt;br /&gt;
The key parameter for this function is:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;strip&#039;&#039;&#039;: it decides if we want to strip slashes from the string or no. By default it&#039;s &#039;false&#039; so no strip will be performed. We should set such parameter to &#039;true&#039; only when data to be processed isn&#039;t coming from database but from http requests (forms, links...).&lt;br /&gt;
&lt;br /&gt;
=== format_text() ===&lt;br /&gt;
&lt;br /&gt;
 function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL ) &lt;br /&gt;
&lt;br /&gt;
This function should be used to:&lt;br /&gt;
&lt;br /&gt;
* print &#039;&#039;&#039;any html/plain/markdown/moodle text&#039;&#039;&#039;, needing any of the features below. Mainly used for long strings like posts, answers, glossary items...&lt;br /&gt;
&lt;br /&gt;
Note that this function is really &#039;&#039;&#039;heavy&#039;&#039;&#039; because it supports &#039;&#039;&#039;cleaning&#039;&#039;&#039; of dangerous contents, delegates processing to enabled &#039;&#039;&#039;filter&#039;&#039;&#039;s, supports different &#039;&#039;&#039;formats&#039;&#039;&#039; of text (HTML, PLAIN, MARKDOWN, MOODLE) and performs a lot of &#039;&#039;&#039;automatic conversions&#039;&#039;&#039; like adding smilies, build links. Also, it includes a strong &#039;&#039;&#039;cache mechanism&#039;&#039;&#039; (DB based) that will alleviate the server from a lot of work processing the same texts time and again.&lt;br /&gt;
&lt;br /&gt;
Some interesting parameters for this function are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;format&#039;&#039;&#039;: To tell the function about how the data has been entered. It defaults to FORMAT_MOODLE that is a cool format to process plain text because it features automatic link conversion, smilies and good conversion to html output. Other formats are FORMAT_HTML, FORMAT_PLAIN, FORMAT_MARKDOWN. See [[Formatting options]].&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;options&#039;&#039;&#039;: Here we can specify how we want the process to be performed. You only need to define them if they are different from the default value assumed. Main options are:&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;noclean&#039;&#039;&#039;: To decide if we want to skip the clean of text, &#039;&#039;&#039;un-protecting us&#039;&#039;&#039; from attacks and other security flaws (defaults to false, so protection is enabled. You &#039;&#039;&#039;shouldn&#039;t set it to true ever&#039;&#039;&#039; unless you are 200% sure that only controlled users can edit it (mainly admins). &#039;&#039;&#039;Never use it for general text places&#039;&#039;&#039; (posts...) or you will be, sooner or later, attacked! Note that this option is ignored for FORMAT_PLAIN, the text is never cleaned.&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;filter&#039;&#039;&#039;: To decide if you want to allow filters to process the text (defaults to true). This is ignored by FORMAT_PLAIN for which filters are never applied.&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;smiley&#039;&#039;&#039;: To decide if we want automatic conversion of smilies to images (defaults to true). This is ignored by FORMAT_PLAIN for which smileys are never converted.&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;para&#039;&#039;&#039;: To decide if you want every paragraph automatically enclosed between html paragraph tags (&amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;...&amp;lt;/p&amp;gt;&amp;lt;/nowiki&amp;gt;) (defaults to true). This option only applies to FORMAT_MOODLE.&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;newlines&#039;&#039;&#039;: To decide if linefeeds in text should be converted to html newlines (&amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;) (defaults to true). This option only applies to FORMAT_MOODLE.&lt;br /&gt;
* &#039;&#039;&#039;courseid&#039;&#039;&#039;: This parameter should be passed always to help filters to know how they should work. This parameter will become less and less important Moodle was 100% of the current course using some session or global variable (it&#039;s one work in progress just now) but, for now, it&#039;s recommended to set it always in the function call.&lt;br /&gt;
&lt;br /&gt;
=== format_string() ===&lt;br /&gt;
&lt;br /&gt;
 function format_string ($string, $striplinks = false, $courseid=NULL )&lt;br /&gt;
&lt;br /&gt;
This function should be used to:&lt;br /&gt;
&lt;br /&gt;
* print &#039;&#039;&#039;short strings (non html) that need filter processing&#039;&#039;&#039; (activity titles, post subjects, glossary concepts...).&lt;br /&gt;
&lt;br /&gt;
Please note that this function is basically one stripped version of the full format_text() function detailed above and &#039;&#039;&#039;it doesn&#039;t offer any of its options or protections&#039;&#039;&#039;. It simply filters the strings and returns the result, so we must ensure that text being processed has been properly cleaned at input time, using the proper xxx_param() functions.&lt;br /&gt;
&lt;br /&gt;
Some interesting parameters for this function are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;striplinks&#039;&#039;&#039;: To decide if, after the text has been processed by filters, we must delete any link from the result text. Used when we want to show the text inside menus, page titles... (defaults to false).&lt;br /&gt;
* &#039;&#039;&#039;courseid&#039;&#039;&#039;: This parameter should be passed always to help filters to know how they should work. This parameter will become less and less important Moodle was 100% of the current course using some session or global variable (it&#039;s one work in progress just now) but, for now, it&#039;s recommended to set it always in the function call.&lt;br /&gt;
&lt;br /&gt;
=== print_textarea() ===&lt;br /&gt;
&lt;br /&gt;
 function print_textarea($usehtmleditor, $rows, $cols, $width, &lt;br /&gt;
                        $height, $name, $value=&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;, $courseid=0, $return=false)&lt;br /&gt;
&lt;br /&gt;
This function should be used to:&lt;br /&gt;
&lt;br /&gt;
* display &amp;lt;nowiki&amp;gt;&amp;lt;textarea&amp;gt;&amp;lt;/nowiki&amp;gt; fields when we want to allow users (based in their preferences and browser capabilities) &#039;&#039;&#039;to use the visual HTML editor&#039;&#039;&#039; instead of one standard &#039;plain&#039; area.&lt;br /&gt;
&lt;br /&gt;
Some interesting parameters for this function are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;usehtmleditor&#039;&#039;&#039;: to decide if the HTML editor must be showed. The value of this parameter must be calculated by the can_use_html_editor() function.&lt;br /&gt;
* &#039;&#039;&#039;rows, cols&#039;&#039;&#039;: to be applied it the standard textarea is showed.&lt;br /&gt;
* &#039;&#039;&#039;width, height&#039;&#039;&#039;: to be applied if the HTML editor is used.&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: the name of the field that will contain the text once the form is submitted.&lt;br /&gt;
* &#039;&#039;&#039;value&#039;&#039;&#039;: the initial value of the textarea.&lt;br /&gt;
* &#039;&#039;&#039;courseid&#039;&#039;&#039;: This parameter should be passed always to help the editor to know where it is work. This parameter will become less and less important Moodle was 100% of the current course using some session or global variable (it&#039;s one work in progress just now) but, for now, it&#039;s recommended to set it always in the function call.&lt;br /&gt;
* &#039;&#039;&#039;return&#039;&#039;&#039;: to decide if the generated html code must be returned to the caller (true) or printed directly (false). Defaults to false.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Output functions]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Output_functions&amp;diff=25155</id>
		<title>Development:Output functions</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Output_functions&amp;diff=25155"/>
		<updated>2007-07-17T18:12:56Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* format_string() */ corrected grammatical errors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tries to explain a bit how dynamic data should be sent from Moodle to the browser in an organised and standard way. Obviously it&#039;s possible to have your own output methods but, thinking that you are going to share your code (yep, this is an OpenSource project!) and in the collaborative way we try to build and maintain the system every day, it would be really better to follow the basic guidelines explained below.&lt;br /&gt;
&lt;br /&gt;
By using them you will be helping to have better, more secure and readable code. Spend some minutes trying to understand them, please!&lt;br /&gt;
&lt;br /&gt;
Of course, these functions can be discussed, modified and new functions can arrive if there are some good reasons for it. Just discuss it in the [http://moodle.org/mod/forum/view.php?id=55 General developer forum] at [http://moodle.org moodle.org].&lt;br /&gt;
&lt;br /&gt;
For each of the functions below we&#039;ll try to explain when they should be used, explaining the most important parameters supported and their meaning. Let&#039;s review them!&lt;br /&gt;
&lt;br /&gt;
=== p() and s() ===&lt;br /&gt;
&lt;br /&gt;
 function s($var, $strip=false)&lt;br /&gt;
 function p($var, $strip=false)&lt;br /&gt;
&lt;br /&gt;
These functions share the same code so they will be explained together. The only difference is that s() returns the string while p() prints it directly.&lt;br /&gt;
&lt;br /&gt;
These functions should be used to:&lt;br /&gt;
&lt;br /&gt;
* print all the &#039;&#039;&#039;values of form fields&#039;&#039;&#039; like &amp;lt;nowiki&amp;gt;&amp;lt;input&amp;gt;&amp;lt;/nowiki&amp;gt; or &amp;lt;nowiki&amp;gt;&amp;lt;textarea&amp;gt;&amp;lt;/nowiki&amp;gt; tags.&lt;br /&gt;
* to &#039;&#039;&#039;show plain (non html) text&#039;&#039;&#039; that has been introduced by the user (search string, quiz responses...).&lt;br /&gt;
* in general, all the &#039;&#039;&#039;dynamic data, not being html&#039;&#039;&#039;, that doesn&#039;t need to be cleaned nor processed by filters&lt;br /&gt;
&lt;br /&gt;
It is important not to use these functions for strings that contain html markup.&lt;br /&gt;
&lt;br /&gt;
The functions replace certain characters that would have special meaning in html ( &amp;lt;, &amp;gt;, &amp;quot;, &#039;, and &amp;amp;) by html entities so that they are displayed as intended. Note that even though the value of form fields printed with p() will have these characters converted to html entities, the submitted values will contain the original characters again.&lt;br /&gt;
&lt;br /&gt;
The key parameter for this function is:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;strip&#039;&#039;&#039;: it decides if we want to strip slashes from the string or no. By default it&#039;s &#039;false&#039; so no strip will be performed. We should set such parameter to &#039;true&#039; only when data to be processed isn&#039;t coming from database but from http requests (forms, links...).&lt;br /&gt;
&lt;br /&gt;
=== format_text() ===&lt;br /&gt;
&lt;br /&gt;
 function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL ) &lt;br /&gt;
&lt;br /&gt;
This function should be used to:&lt;br /&gt;
&lt;br /&gt;
* print &#039;&#039;&#039;any html/plain/markdown/moodle text&#039;&#039;&#039;, needing any of the features below. Mainly used for long strings like posts, answers, glossary items...&lt;br /&gt;
&lt;br /&gt;
Note that this function is really &#039;&#039;&#039;heavy&#039;&#039;&#039; because it supports &#039;&#039;&#039;cleaning&#039;&#039;&#039; of dangerous contents, delegates processing to enabled &#039;&#039;&#039;filter&#039;&#039;&#039;s, supports different &#039;&#039;&#039;formats&#039;&#039;&#039; of text (HTML, PLAIN, MARKDOWN, MOODLE) and performs a lot of &#039;&#039;&#039;automatic conversions&#039;&#039;&#039; like adding smilies, build links. Also, it includes a strong &#039;&#039;&#039;cache mechanism&#039;&#039;&#039; (DB based) that will alleviate the server from a lot of work processing the same texts time and again.&lt;br /&gt;
&lt;br /&gt;
Some interesting parameters for this function are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;format&#039;&#039;&#039;: To tell the function about how the data has been entered. It defaults to FORMAT_MOODLE that is a cool format to process plain text because it features automatic link conversion, smilies and good conversion to html output. Other formats are FORMAT_HTML, FORMAT_PLAIN, FORMAT_MARKDOWN. See [[Formatting options]].&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;options&#039;&#039;&#039;: Here we can specify how we want the process to be performed. You only need to define them if they are different from the default value assumed. Main options are:&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;noclean&#039;&#039;&#039;: To decide if we want to skip the clean of text, &#039;&#039;&#039;un-protecting us&#039;&#039;&#039; from attacks and other security flaws (defaults to false, so protection is enabled. You &#039;&#039;&#039;shouldn&#039;t set it to true ever&#039;&#039;&#039; unless you are 200% sure that only controlled users can edit it (mainly admins). &#039;&#039;&#039;Never use it for general text places&#039;&#039;&#039; (posts...) or you will be, sooner or later, attacked! Note that this option is ignored for FORMAT_PLAIN, the text is never cleaned.&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;filter&#039;&#039;&#039;: To decide if you want to allow filters to process the text (defaults to true). This is ignored by FORMAT_PLAIN for which filters are never applied.&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;smiley&#039;&#039;&#039;: To decide if we want automatic conversion of smilies to images (defaults to true). This is ignored by FORMAT_PLAIN for which smileys are never converted.&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;para&#039;&#039;&#039;: To decide if you want every paragraph automatically enclosed between html paragraph tags (&amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;...&amp;lt;/p&amp;gt;&amp;lt;/nowiki&amp;gt;) (defaults to true). This option only applies to FORMAT_MOODLE.&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;newlines&#039;&#039;&#039;: To decide if linefeeds in text should be converted to html newlines (&amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;) (defaults to true). This option only applies to FORMAT_MOODLE.&lt;br /&gt;
* &#039;&#039;&#039;courseid&#039;&#039;&#039;: This parameter should be passed always to help filters to know how they should work. This parameter will become less and less important Moodle was 100% of the current course using some session or global variable (it&#039;s one work in progress just now) but, for now, it&#039;s recommended to set it always in the function call.&lt;br /&gt;
&lt;br /&gt;
=== format_string() ===&lt;br /&gt;
&lt;br /&gt;
 function format_string ($string, $striplinks = false, $courseid=NULL )&lt;br /&gt;
&lt;br /&gt;
This function should be used to:&lt;br /&gt;
&lt;br /&gt;
* print &#039;&#039;&#039;short strings (non html) that need filter processing&#039;&#039;&#039; (activity titles, post subjects, glossary concepts...).&lt;br /&gt;
&lt;br /&gt;
Please note that this function is basically one stripped version of the full format_text() function detailed above and &#039;&#039;&#039;it doesn&#039;t offer any of its options or protections&#039;&#039;&#039;. It simply filters the strings and returns the result, so we must ensure that text being processed has been properly cleaned at input time, using the proper xxx_param() functions.&lt;br /&gt;
&lt;br /&gt;
Some interesting parameters for this function are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;striplinks&#039;&#039;&#039;: To decide if, after the text has been processed by filters, we must delete any link from the result text. Used when we want to show the text inside menus, page titles... (defaults to false).&lt;br /&gt;
* &#039;&#039;&#039;courseid&#039;&#039;&#039;: This parameter should be passed always to help filters to know how they should work. This parameter will become less and less important Moodle was 100% of the current course using some session or global variable (it&#039;s one work in progress just now) but, for now, it&#039;s recommended to set it always in the function call.&lt;br /&gt;
&lt;br /&gt;
=== print_textarea() ===&lt;br /&gt;
&lt;br /&gt;
 function print_textarea($usehtmleditor, $rows, $cols, $width, &lt;br /&gt;
                        $height, $name, $value=&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;, $courseid=0, $return=false)&lt;br /&gt;
&lt;br /&gt;
This function should be used to:&lt;br /&gt;
&lt;br /&gt;
* display &amp;lt;nowiki&amp;gt;&amp;lt;textarea&amp;gt;&amp;lt;/nowiki&amp;gt; fields when we want to allow users (based in their preferences and browser capabilities) &#039;&#039;&#039;to use the visual HTML editor&#039;&#039;&#039; instead of one standard &#039;plain&#039; area.&lt;br /&gt;
&lt;br /&gt;
Some interesting parameters for this function are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;usehtmleditor&#039;&#039;&#039;: to decide if the HTML editor must be showed. The value of this parameter must be calculated by the can_use_html_editor() function.&lt;br /&gt;
* &#039;&#039;&#039;rows, cols&#039;&#039;&#039;: to be applied it the standard textarea is showed.&lt;br /&gt;
* &#039;&#039;&#039;width, height&#039;&#039;&#039;: to be applied if the HTML editor is used.&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: the name of the field that will contain the text once the form was submitted.&lt;br /&gt;
* &#039;&#039;&#039;value&#039;&#039;&#039;: the initial value of the textarea.&lt;br /&gt;
* &#039;&#039;&#039;courseid&#039;&#039;&#039;: This parameter should be passed always to help the editor to know where it is work. This parameter will become less and less important Moodle was 100% of the current course using some session or global variable (it&#039;s one work in progress just now) but, for now, it&#039;s recommended to set it always in the function call.&lt;br /&gt;
* &#039;&#039;&#039;return&#039;&#039;&#039;: to decide if the generated html code must be returned to the caller (true) or printed directly (false). Defaults to false.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Output functions]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Output_functions&amp;diff=25154</id>
		<title>Development:Output functions</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Output_functions&amp;diff=25154"/>
		<updated>2007-07-17T18:06:38Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* format_text() */  removed double negative (never -&amp;gt; ever)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tries to explain a bit how dynamic data should be sent from Moodle to the browser in an organised and standard way. Obviously it&#039;s possible to have your own output methods but, thinking that you are going to share your code (yep, this is an OpenSource project!) and in the collaborative way we try to build and maintain the system every day, it would be really better to follow the basic guidelines explained below.&lt;br /&gt;
&lt;br /&gt;
By using them you will be helping to have better, more secure and readable code. Spend some minutes trying to understand them, please!&lt;br /&gt;
&lt;br /&gt;
Of course, these functions can be discussed, modified and new functions can arrive if there are some good reasons for it. Just discuss it in the [http://moodle.org/mod/forum/view.php?id=55 General developer forum] at [http://moodle.org moodle.org].&lt;br /&gt;
&lt;br /&gt;
For each of the functions below we&#039;ll try to explain when they should be used, explaining the most important parameters supported and their meaning. Let&#039;s review them!&lt;br /&gt;
&lt;br /&gt;
=== p() and s() ===&lt;br /&gt;
&lt;br /&gt;
 function s($var, $strip=false)&lt;br /&gt;
 function p($var, $strip=false)&lt;br /&gt;
&lt;br /&gt;
These functions share the same code so they will be explained together. The only difference is that s() returns the string while p() prints it directly.&lt;br /&gt;
&lt;br /&gt;
These functions should be used to:&lt;br /&gt;
&lt;br /&gt;
* print all the &#039;&#039;&#039;values of form fields&#039;&#039;&#039; like &amp;lt;nowiki&amp;gt;&amp;lt;input&amp;gt;&amp;lt;/nowiki&amp;gt; or &amp;lt;nowiki&amp;gt;&amp;lt;textarea&amp;gt;&amp;lt;/nowiki&amp;gt; tags.&lt;br /&gt;
* to &#039;&#039;&#039;show plain (non html) text&#039;&#039;&#039; that has been introduced by the user (search string, quiz responses...).&lt;br /&gt;
* in general, all the &#039;&#039;&#039;dynamic data, not being html&#039;&#039;&#039;, that doesn&#039;t need to be cleaned nor processed by filters&lt;br /&gt;
&lt;br /&gt;
It is important not to use these functions for strings that contain html markup.&lt;br /&gt;
&lt;br /&gt;
The functions replace certain characters that would have special meaning in html ( &amp;lt;, &amp;gt;, &amp;quot;, &#039;, and &amp;amp;) by html entities so that they are displayed as intended. Note that even though the value of form fields printed with p() will have these characters converted to html entities, the submitted values will contain the original characters again.&lt;br /&gt;
&lt;br /&gt;
The key parameter for this function is:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;strip&#039;&#039;&#039;: it decides if we want to strip slashes from the string or no. By default it&#039;s &#039;false&#039; so no strip will be performed. We should set such parameter to &#039;true&#039; only when data to be processed isn&#039;t coming from database but from http requests (forms, links...).&lt;br /&gt;
&lt;br /&gt;
=== format_text() ===&lt;br /&gt;
&lt;br /&gt;
 function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL ) &lt;br /&gt;
&lt;br /&gt;
This function should be used to:&lt;br /&gt;
&lt;br /&gt;
* print &#039;&#039;&#039;any html/plain/markdown/moodle text&#039;&#039;&#039;, needing any of the features below. Mainly used for long strings like posts, answers, glossary items...&lt;br /&gt;
&lt;br /&gt;
Note that this function is really &#039;&#039;&#039;heavy&#039;&#039;&#039; because it supports &#039;&#039;&#039;cleaning&#039;&#039;&#039; of dangerous contents, delegates processing to enabled &#039;&#039;&#039;filter&#039;&#039;&#039;s, supports different &#039;&#039;&#039;formats&#039;&#039;&#039; of text (HTML, PLAIN, MARKDOWN, MOODLE) and performs a lot of &#039;&#039;&#039;automatic conversions&#039;&#039;&#039; like adding smilies, build links. Also, it includes a strong &#039;&#039;&#039;cache mechanism&#039;&#039;&#039; (DB based) that will alleviate the server from a lot of work processing the same texts time and again.&lt;br /&gt;
&lt;br /&gt;
Some interesting parameters for this function are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;format&#039;&#039;&#039;: To tell the function about how the data has been entered. It defaults to FORMAT_MOODLE that is a cool format to process plain text because it features automatic link conversion, smilies and good conversion to html output. Other formats are FORMAT_HTML, FORMAT_PLAIN, FORMAT_MARKDOWN. See [[Formatting options]].&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;options&#039;&#039;&#039;: Here we can specify how we want the process to be performed. You only need to define them if they are different from the default value assumed. Main options are:&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;noclean&#039;&#039;&#039;: To decide if we want to skip the clean of text, &#039;&#039;&#039;un-protecting us&#039;&#039;&#039; from attacks and other security flaws (defaults to false, so protection is enabled. You &#039;&#039;&#039;shouldn&#039;t set it to true ever&#039;&#039;&#039; unless you are 200% sure that only controlled users can edit it (mainly admins). &#039;&#039;&#039;Never use it for general text places&#039;&#039;&#039; (posts...) or you will be, sooner or later, attacked! Note that this option is ignored for FORMAT_PLAIN, the text is never cleaned.&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;filter&#039;&#039;&#039;: To decide if you want to allow filters to process the text (defaults to true). This is ignored by FORMAT_PLAIN for which filters are never applied.&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;smiley&#039;&#039;&#039;: To decide if we want automatic conversion of smilies to images (defaults to true). This is ignored by FORMAT_PLAIN for which smileys are never converted.&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;para&#039;&#039;&#039;: To decide if you want every paragraph automatically enclosed between html paragraph tags (&amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;...&amp;lt;/p&amp;gt;&amp;lt;/nowiki&amp;gt;) (defaults to true). This option only applies to FORMAT_MOODLE.&lt;br /&gt;
**&#039;&#039;&#039;options-&amp;gt;newlines&#039;&#039;&#039;: To decide if linefeeds in text should be converted to html newlines (&amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;) (defaults to true). This option only applies to FORMAT_MOODLE.&lt;br /&gt;
* &#039;&#039;&#039;courseid&#039;&#039;&#039;: This parameter should be passed always to help filters to know how they should work. This parameter will become less and less important Moodle was 100% of the current course using some session or global variable (it&#039;s one work in progress just now) but, for now, it&#039;s recommended to set it always in the function call.&lt;br /&gt;
&lt;br /&gt;
=== format_string() ===&lt;br /&gt;
&lt;br /&gt;
 function format_string ($string, $striplinks = false, $courseid=NULL )&lt;br /&gt;
&lt;br /&gt;
This function should be used to:&lt;br /&gt;
&lt;br /&gt;
* print &#039;&#039;&#039;short strings (non html) that need filter processing&#039;&#039;&#039; (activity titles, post subjects, glossary concepts...).&lt;br /&gt;
&lt;br /&gt;
Please note that this function is basically one stripped version of the full format_text() function detailed above and &#039;&#039;&#039;it doesn&#039;t offer any of it options nor protections&#039;&#039;&#039;. It simply filters the strings and return the result, so we must ensure that text being processed has been properly cleaned at input time, using the proper xxx_param() functions.&lt;br /&gt;
&lt;br /&gt;
Some interesting parameters for this function are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;striplinks&#039;&#039;&#039;: To decide if, after the text has been processed by filters, we must delete any link from the result test. Used when we want to show the text inside menus, page titles... (defaults to false).&lt;br /&gt;
* &#039;&#039;&#039;courseid&#039;&#039;&#039;: This parameter should be passed always to help filters to know how they should work. This parameter will become less and less important Moodle was 100% of the current course using some session or global variable (it&#039;s one work in progress just now) but, for now, it&#039;s recommended to set it always in the function call.&lt;br /&gt;
&lt;br /&gt;
=== print_textarea() ===&lt;br /&gt;
&lt;br /&gt;
 function print_textarea($usehtmleditor, $rows, $cols, $width, &lt;br /&gt;
                        $height, $name, $value=&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;, $courseid=0, $return=false)&lt;br /&gt;
&lt;br /&gt;
This function should be used to:&lt;br /&gt;
&lt;br /&gt;
* display &amp;lt;nowiki&amp;gt;&amp;lt;textarea&amp;gt;&amp;lt;/nowiki&amp;gt; fields when we want to allow users (based in their preferences and browser capabilities) &#039;&#039;&#039;to use the visual HTML editor&#039;&#039;&#039; instead of one standard &#039;plain&#039; area.&lt;br /&gt;
&lt;br /&gt;
Some interesting parameters for this function are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;usehtmleditor&#039;&#039;&#039;: to decide if the HTML editor must be showed. The value of this parameter must be calculated by the can_use_html_editor() function.&lt;br /&gt;
* &#039;&#039;&#039;rows, cols&#039;&#039;&#039;: to be applied it the standard textarea is showed.&lt;br /&gt;
* &#039;&#039;&#039;width, height&#039;&#039;&#039;: to be applied if the HTML editor is used.&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: the name of the field that will contain the text once the form was submitted.&lt;br /&gt;
* &#039;&#039;&#039;value&#039;&#039;&#039;: the initial value of the textarea.&lt;br /&gt;
* &#039;&#039;&#039;courseid&#039;&#039;&#039;: This parameter should be passed always to help the editor to know where it is work. This parameter will become less and less important Moodle was 100% of the current course using some session or global variable (it&#039;s one work in progress just now) but, for now, it&#039;s recommended to set it always in the function call.&lt;br /&gt;
* &#039;&#039;&#039;return&#039;&#039;&#039;: to decide if the generated html code must be returned to the caller (true) or printed directly (false). Defaults to false.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Output functions]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Installation_for_Windows_2003_with_IIS&amp;diff=24808</id>
		<title>Installation for Windows 2003 with IIS</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Installation_for_Windows_2003_with_IIS&amp;diff=24808"/>
		<updated>2007-07-03T18:04:59Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: Replaced statement of ignorance about MSSQL Server with fact &amp;amp; link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*Return to [[Windows installation]]&lt;br /&gt;
&lt;br /&gt;
We&#039;ll use IIS as the web server and MySQL as the database server. Note: It is also possible to use [https://docs.moodle.org/en/Installing_MSSQL_for_PHP MSSQL server]. &lt;br /&gt;
&lt;br /&gt;
We&#039;re assuming that IIS has been installed and also that the reader of this text is familiar with IIS configuration.&lt;br /&gt;
&lt;br /&gt;
PHP: see [http://www.peterguy.com/php/install_IIS6.html How to install PHP 5.x on Windows Server 2003 with IIS 6] for instructions.&lt;br /&gt;
&lt;br /&gt;
MySQL: download from [http://dev.mysql.com/downloads/] and install&lt;br /&gt;
&lt;br /&gt;
Then get the standard installation for Moodle from [http://download.moodle.org/ http://download.moodle.org/] and read the rest at [[Windows installation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Sandbox&amp;diff=24742</id>
		<title>Sandbox</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Sandbox&amp;diff=24742"/>
		<updated>2007-06-29T12:30:47Z</updated>

		<summary type="html">&lt;p&gt;Hccrle: /* Aesthetic entymology to follow! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;$$ sqrt( x + y ) $$&lt;br /&gt;
&lt;br /&gt;
abcdef deneme 1 2&lt;br /&gt;
&lt;br /&gt;
Very nice :-)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;Moodle is Great!&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;== אחת שתיים שלו ארבע&lt;br /&gt;
 ==== Headline text ==== Headline text ==&#039;&#039;&#039;Bold text&#039;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====bbbbbb====&lt;br /&gt;
[[Table]]&lt;br /&gt;
$$ x^2 $$&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Take it to the limit!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Headline text ==&lt;br /&gt;
[http://www.google.com Google]&lt;br /&gt;
&lt;br /&gt;
== Aesthetic entymology to follow! ==&lt;br /&gt;
&amp;lt;hr size=5&amp;gt;  &lt;br /&gt;
&amp;lt;hr size=10&amp;gt;&lt;br /&gt;
&amp;lt;hr size=20&amp;gt;  &lt;br /&gt;
... well, that&#039;s too bad: &amp;lt;tt&amp;gt; I was expecting to be able to make larger headers! &amp;lt;i&amp;gt;[pout!]&amp;lt;/i&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Interesting.  Don&#039;t know much about HTML but &lt;br /&gt;
#remember this is a Mediawiki.   &lt;br /&gt;
#When I want to try something off the beaten track in MoodleDocs, I [http://meta.wikimedia.org/wiki/Help:Editing#Templates start here with a search on editing tips].&lt;br /&gt;
#Since I am a clutz, I created a web page using a word processor.  Then opened my browser and revealed the page code.  Then placed it below.   So you can make larger headers several ways. chris collman&lt;br /&gt;
::see examples below&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;span style=&#039;font-size:26.0pt&#039;&amp;gt;This is 26.opt test&amp;lt;/span&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Notice it still is a header just not the default font&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Let&#039;s&#039;&#039;&#039; have a go of this &lt;br /&gt;
== moodle ==&lt;br /&gt;
 business and see what the lark is all about!&lt;br /&gt;
&lt;br /&gt;
--[[User:Jonathan Foley|Jonathan Foley]] 08:42, 11 June 2007 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Headline text ==&lt;br /&gt;
&lt;br /&gt;
Martha is a radical&lt;br /&gt;
&lt;br /&gt;
=Is a 1st level header - the larger header topic=&lt;br /&gt;
&lt;br /&gt;
just to see what would happen&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;span style=&#039;font-size:40.0pt&#039;&amp;gt;This  is a 400.opt font test&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hmm...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Just testing it out!&lt;br /&gt;
&lt;br /&gt;
Seems OK!&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Here&#039;s some text.&lt;br /&gt;
:Here&#039;s some indented text.&lt;br /&gt;
::And a bit more indented.&lt;br /&gt;
::::::::::Now you&#039;re just being silly.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[fr:Bac à sable]]&lt;br /&gt;
[[ja:サンドボックス]]&lt;/div&gt;</summary>
		<author><name>Hccrle</name></author>
	</entry>
</feed>