<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Justineuro</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Justineuro"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/Special:Contributions/Justineuro"/>
	<updated>2026-04-16T19:24:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installation_quick_guide&amp;diff=139192</id>
		<title>Installation quick guide</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installation_quick_guide&amp;diff=139192"/>
		<updated>2020-12-22T03:33:25Z</updated>

		<summary type="html">&lt;p&gt;Justineuro: corrected version name from change MOODLE_39_STABLE to MOODLE_310_STABLE&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page is intended for administrators who are experienced with installing web server applications and are in a hurry to get up and running. Otherwise please see [[Installing Moodle]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Basic Requirements==&lt;br /&gt;
&lt;br /&gt;
* You will need a working web server (e.g. [[Apache]]), a database (e.g. [[MySQL]], [[MariaDB]] or [[PostgreSQL]]) and have [[PHP]] configured. See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
* Moodle requires a number of [[PHP]] extensions. However, Moodle checks early in the installation process and you can fix the problem and re-start the install script if any are missing.&lt;br /&gt;
* If you want Moodle to send email (you probably do) you need a working Sendmail (Unix/Linux) on your server or access to an SMTP mail server.&lt;br /&gt;
&lt;br /&gt;
==Getting Moodle==&lt;br /&gt;
&lt;br /&gt;
You have two basic options:&lt;br /&gt;
* Download your required version from https://download.moodle.org/ ... OR&lt;br /&gt;
* Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone -b MOODLE_310_STABLE git://git.moodle.org/moodle.git &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
...this fetches a complete copy of the Moodle repository and then switches to the {{Version}} Stable branch. &lt;br /&gt;
&lt;br /&gt;
See [[Git_for_Administrators|Git for Administrators ]] for details on using Git to install Moodle code.&lt;br /&gt;
&lt;br /&gt;
Note: Only download Moodle from one of the moodle.org sources. Other versions (e.g. control panel based installers, Linux distribution repositories, other &amp;quot;one click&amp;quot; installers) cannot be guaranteed to work properly, be upgradable or be supportable.&lt;br /&gt;
&lt;br /&gt;
==Create a database==&lt;br /&gt;
&lt;br /&gt;
* Using your chosen database server, create a new empty database. The default encoding must be UTF8. For example, using MySQL:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create a user/password combination with appropriate permissions for the database. For example (MySQL again):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO &#039;moodleuser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;yourpassword&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: It is important to GRANT ON moodle.* as the database name including the &#039;.*&#039; and not just the bare database name. Save this password you use for the Moodle user, since you will need it later in the install.&lt;br /&gt;
&lt;br /&gt;
==Create data directory==&lt;br /&gt;
&lt;br /&gt;
* Create an empty directory to hold Moodle files. It &#039;&#039;&#039;must not&#039;&#039;&#039; be in the area served by the web server and must have permissions so that the web server user can write to it. Other than that it can be located anywhere. Typically, either make it owned by the web server user or give it write permissions for &#039;everyone&#039;. If it is on a shared/NFS drive then read [[Caching]] - Moodle caches to this disk area by default and a slow share will mean terrible performance.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle code==&lt;br /&gt;
&lt;br /&gt;
* If you downloaded the zip or tgz file earlier, then unzip / untar / move / copy the Moodle code (obtained above) so that it will be served by your web server (e.g. on Debian based Linux, move to /var/www/html/moodle)&lt;br /&gt;
* Check the permissions and make sure that the web server does &#039;&#039;&#039;not&#039;&#039;&#039; have permissions to write to any of the files in the Moodle code directories (a very common root cause of sites being hacked).&lt;br /&gt;
* If you need to, configure your web server to serve the Moodle site with your chosen URL.&lt;br /&gt;
&lt;br /&gt;
==Configure Moodle==&lt;br /&gt;
&lt;br /&gt;
* In the Moodle code directory, find the file &#039;&#039;config-dist.php&#039;&#039; and copy it to a new file called &#039;&#039;config.php&#039;&#039; (but read next step, &#039;Install Moodle&#039;, first).&lt;br /&gt;
* Edit config.php with your favourite editor and change the appropriate settings to point to your site, directories and database. &#039;&#039;Note: the Moodle install script will create config.php for you if it does not exist but make sure you (re-)set permissions appropriately afterwards&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Install Moodle==&lt;br /&gt;
&lt;br /&gt;
* Go to the URL for your moodle site in a browser (installation will complete automatically) or run the command line version at (requires cli version of PHP):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/bin/php /path/to/moodle/admin/cli/install.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The CLI creates the config.php for you and will not run if you created one in the previous step.&lt;br /&gt;
* After completing the install make sure your file permissions are ok for the Moodle program files (not writeable by web server) and the Moodle data files (writeable by web server).&lt;br /&gt;
&lt;br /&gt;
==Set up cron==&lt;br /&gt;
&lt;br /&gt;
You will need a cron job to run periodically. It is recommended that &#039;&#039;the cron is run every minute&#039;&#039;, as required for asynchronous activity deletion when using the [[Recycle bin|recycle bin]]. A typical Unix cron entry will be as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* * * * *    /usr/bin/php /path/to/moodle/admin/cli/cron.php &amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Your site &#039;&#039;&#039;will not work properly&#039;&#039;&#039; unless cron is running regularly. It is very important you do not skip this step.&lt;br /&gt;
&lt;br /&gt;
See [[Cron]] for details.&lt;br /&gt;
&lt;br /&gt;
==Congratulations!==&lt;br /&gt;
&lt;br /&gt;
You are now ready to use your Moodle site.&lt;br /&gt;
&lt;br /&gt;
If you run into problems, check the [[Installation FAQ]] and visit the [http://moodle.org/mod/forum/view.php?id=28 Installation help forum].&lt;br /&gt;
&lt;br /&gt;
[[Category:Quick guide]]&lt;br /&gt;
&lt;br /&gt;
[[de:Installation in Kürze]]&lt;br /&gt;
[[fr:Installation_rapide]]&lt;br /&gt;
[[es:Inicio_Rápido_de_Instalación]]&lt;br /&gt;
[[ja:インストレーションクイックガイド]]&lt;/div&gt;</summary>
		<author><name>Justineuro</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MySQL_full_unicode_support&amp;diff=137822</id>
		<title>MySQL full unicode support</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MySQL_full_unicode_support&amp;diff=137822"/>
		<updated>2020-08-06T04:44:34Z</updated>

		<summary type="html">&lt;p&gt;Justineuro: added &amp;quot; = true&amp;quot; to &amp;quot;innodb_large_prefix&amp;quot;; mysql fails without setting it to true&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Environment}}&lt;br /&gt;
==UTF-8==&lt;br /&gt;
&lt;br /&gt;
UTF-8 is a character encoding that most websites use. It encodes each of the 1,112,064 valid code points. To store all of this information, four bytes is required. The most popular values are in the three byte region. MySQL by default only uses a three byte encoding and so values in the four byte range (eg. Asian characters and Emojis) can not be stored. Any attempt to enter a text that contains four byte characters will result in a Moodle database error.&lt;br /&gt;
&lt;br /&gt;
MySQL does provide full four byte UTF-8 support, but it requires certain database settings to be configured. From version 3.3 on Moodle uses full UTF-8 for both MySQL and MariaDB by default. Existing databases will still run with partial support, but it is recommended to move over to full support.&lt;br /&gt;
&lt;br /&gt;
Moodle comes with a Command Line Interface (CLI) script for converting to full UTF-8 for MySQL (and MariaDB). Before Moodle versions 3.1.5 and 3.2.2 this conversion tool would only change the Collation to some variant of &#039;utf8_bin&#039;. &#039;utf8_unicode_ci&#039; was the recommended Collation. We now recommend using &#039;utf8mb4_unicode_ci&#039; which supports four byte characters (utf8_unicode_ci only supports three).&lt;br /&gt;
&lt;br /&gt;
This script will attempt to change the database Collation, Character set, default table settings and column definitions.&lt;br /&gt;
&lt;br /&gt;
To summarise:&lt;br /&gt;
&lt;br /&gt;
* Fresh installs of Moodle 3.1.5 and 3.2.2 onwards will use utf8mb4 by default, if the database server is configured appropriately (see below).&lt;br /&gt;
* Sites upgrading to Moodle 3.1.5 or 3.2.2 can use the script to update to utf8mb4. In Moodle 3.3, 3.4 and 3.5 a warning will show that the database isn&#039;t using full UTF-8 support and suggest moving to &#039;utf8mb4_unicode_ci&#039;, but you may choose to keep using &#039;utf8_*&#039;.&lt;br /&gt;
&lt;br /&gt;
===File format===&lt;br /&gt;
&lt;br /&gt;
To allow for large indexes on columns that are a varchar, a combination of settings needs to be set. The file format for the system needs to be using &amp;quot;Barracuda&amp;quot;. This allows for the row format to be set to &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot;. To enable this setting see the upgrade steps listed below. Moodle will not install if you have large format enabled without the Barracuda file format.&lt;br /&gt;
&lt;br /&gt;
===File per table===&lt;br /&gt;
&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
===Large prefix===&lt;br /&gt;
&lt;br /&gt;
This in conjunction with the row format being either &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot; allows for large varchar indexes above 191 characters.&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
==Steps to upgrade==&lt;br /&gt;
&lt;br /&gt;
Most important: Please backup your database before making any changes or running the CLI script.&lt;br /&gt;
&lt;br /&gt;
* Change configuration settings for MySQL (exactly the same for MariaDB). This step is optional. You can run the script and it will try and make these changes itself. If errors occur then try manually changing these settings as listed below.&lt;br /&gt;
** On Linux based systems you will want to alter my.cnf. This may be located in &#039;/etc/mysql/&#039;.&lt;br /&gt;
** Make the following alterations to my.cnf:&lt;br /&gt;
&lt;br /&gt;
Important Change; InnoDB: The following InnoDB file format configuration options were deprecated in MySQL 5.7.7 and are now removed:&lt;br /&gt;
&lt;br /&gt;
    innodb_file_format&lt;br /&gt;
&lt;br /&gt;
    innodb_file_format_check&lt;br /&gt;
&lt;br /&gt;
    innodb_file_format_max&lt;br /&gt;
&lt;br /&gt;
    innodb_large_prefix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
[client]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&lt;br /&gt;
[mysqld]&lt;br /&gt;
innodb_file_format = Barracuda&lt;br /&gt;
innodb_file_per_table = 1&lt;br /&gt;
innodb_large_prefix = true&lt;br /&gt;
&lt;br /&gt;
character-set-server = utf8mb4&lt;br /&gt;
collation-server = utf8mb4_unicode_ci&lt;br /&gt;
skip-character-set-client-handshake&lt;br /&gt;
&lt;br /&gt;
[mysql]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* Restart your MySQL server.&lt;br /&gt;
* Run the CLI script to convert to the new Character set and Collation (requires Moodle 3.1.5, 3.2.2 or newer): &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Make sure to repair and optimize all databases and tables.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysqlcheck -u root -p --auto-repair --optimize --all-databases&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE: On very large sites this may take a long time to run. You should probably establish how long on a test install before taking your live site offline. In some cases you might consider dumping and re-importing your data.&lt;br /&gt;
&lt;br /&gt;
* Adjust the $CFG-&amp;gt;dboptions Array in your &#039;&#039;&#039;config.php&#039;&#039;&#039; to make sure that Moodle uses the right Collation when connecting to the MySQL Server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dboptions = array(&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
  &#039;dbcollation&#039; =&amp;gt; &#039;utf8mb4_unicode_ci&#039;,&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you only have access to the database command line (or something like phpmyadmin) you can try the following sql commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SET GLOBAL innodb_file_format = barracuda&lt;br /&gt;
&lt;br /&gt;
SET GLOBAL innodb_file_per_table = 1&lt;br /&gt;
&lt;br /&gt;
SET GLOBAL innodb_large_prefix = &#039;on&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Try adding some Emojis (e.g. 😂💩) to your Moodle site to verify that the upgrade was successful.&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|UTF-8]]&lt;br /&gt;
[[Category:UTF-8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:MySQL soporte unicode completo]]&lt;br /&gt;
[[fr:Support unicode complet pour MySQL]]&lt;br /&gt;
[[de:MySQL Unicode Unterstützung]]&lt;/div&gt;</summary>
		<author><name>Justineuro</name></author>
	</entry>
</feed>