<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/311/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stronk7</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/311/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stronk7"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/Special:Contributions/Stronk7"/>
	<updated>2026-05-09T17:53:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=admin/environment/custom_check/db_prefix_too_long&amp;diff=143752</id>
		<title>admin/environment/custom check/db prefix too long</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=admin/environment/custom_check/db_prefix_too_long&amp;diff=143752"/>
		<updated>2023-09-10T15:31:19Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Created page with &amp;quot;Since Moodle 4.3, the max allowed length for the database tables prefix (&amp;lt;tt&amp;gt;$CFG-&amp;gt;prefix&amp;lt;/tt&amp;gt;) are 10 characters.  If your database is using longer prefixes, you will need to...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Since Moodle 4.3, the max allowed length for the database tables prefix (&amp;lt;tt&amp;gt;$CFG-&amp;gt;prefix&amp;lt;/tt&amp;gt;) are 10 characters.&lt;br /&gt;
&lt;br /&gt;
If your database is using longer prefixes, you will need to rename all the tables to use a new, shorter, prefix.&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
* [https://moodledev.io/general/releases/4.3#database-requirements Moodle 4.3 release page database requirements].&lt;br /&gt;
* MDL-76459&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Analytics_settings&amp;diff=142522</id>
		<title>Analytics settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Analytics_settings&amp;diff=142522"/>
		<updated>2021-11-11T18:16:26Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: tidy up some code and information making reference to mlbackend versions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Analytics}}&lt;br /&gt;
The Moodle learning analytics system requires some initial configuration before it can be used. You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Site information ==&lt;br /&gt;
&lt;br /&gt;
Site information will be used to help learning analytics models take characteristics of the institution into account. This information is also reported as part of site data collection when you register your site. This will allow HQ to understand which areas in learning analytics are seeing the most use and prioritize development resources appropriately.&lt;br /&gt;
&lt;br /&gt;
== Configure learning analytics settings ==&lt;br /&gt;
&lt;br /&gt;
Analytics may be disabled from Site administration / Advanced features&lt;br /&gt;
&lt;br /&gt;
They may then be configured from Site administration / Analytics. &lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
==== PHP predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
&lt;br /&gt;
==== Python predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The Python processor is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package. The package can be installed in the web server (in all the nodes if in a clustered environment) or in a separate server.&lt;br /&gt;
&lt;br /&gt;
===== Versions =====&lt;br /&gt;
&lt;br /&gt;
* Moodle 3.8 and up uses package 2.3.* (minimum 2.3.1)&lt;br /&gt;
* Moodle 3.9.11 and up uses package 2.6.* (minimum 2.6.4)&lt;br /&gt;
* Moodle 3.10.8 and up uses package 2.6.* (minimum 2.6.4)&lt;br /&gt;
* Moodle 3.11.4 and up uses package 2.6.* (minimum 2.6.4)&lt;br /&gt;
* Moodle 4.0 and up uses package 3.0.* (minimum 3.0.2)&lt;br /&gt;
&lt;br /&gt;
===== Installed in the web server ===== &lt;br /&gt;
&lt;br /&gt;
The latest version of the [https://pypi.org/project/moodlemlbackend/ packages for &#039;&#039;&#039;Moodle 3.8&#039;&#039;&#039; and up] are compatible with &#039;&#039;&#039;Python 3.4, 3.5, 3.6 and 3.7&#039;&#039;&#039;. Note that the package should be available for both the Command Line Interface (CLI) user and the user who runs the web server (e.g. www-data).&lt;br /&gt;
&lt;br /&gt;
# If necessary, install Python 3 (and pip for Python 3)&lt;br /&gt;
# Ensure that you use Python 3 to install the moodlemlbackend package (for VERSION, see the previous section):&lt;br /&gt;
&lt;br /&gt;
    sudo -H python3 -m pip install &amp;quot;moodlemlbackend==VERSION&amp;quot;&lt;br /&gt;
# You must also enter the path to the Python 3 executable in Site administration -&amp;gt; Server -&amp;gt; System paths:&lt;br /&gt;
[[File:path_to_python_3.png|frame|center|Enter system path for Python 3]]&lt;br /&gt;
&lt;br /&gt;
===== Installed in a separate server =====&lt;br /&gt;
&lt;br /&gt;
To install the python package in a separate server instead of installing it on the web server/s have some advantages:&lt;br /&gt;
* Keeps the python ML backend as an external service&lt;br /&gt;
* To keep a separated control of the resources the web server/s dedicate to serving Moodle and the resources dedicated to the python ML backend&lt;br /&gt;
* You can reuse the same ML server for multiple Moodle sites. Easier to setup and maintain than to install/upgrade the python package in all nodes in the cluster&lt;br /&gt;
* You can install the package as a new docker container in your dockerized environment&lt;br /&gt;
* You can serve the ML backend from AWS through the API gateway and AWS lambda, storing the trained model files in S3&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is expected that there can be some added latency in connecting to the python ML backend server.&lt;br /&gt;
&lt;br /&gt;
The python backend is exposed as a Flask application. The Flask application is part of the official &#039;moodlemlbackend&#039; Python package and its FLASK_APP script is &#039;webapp&#039;, in the root of the package. You are free to use the setup that better suits your existing infrastructure.&lt;br /&gt;
&lt;br /&gt;
====== New server in your infrastructure ======&lt;br /&gt;
&lt;br /&gt;
The python ML backend is exposed as a Flask application, which uses a WSGI server (https://wsgi.readthedocs.io/en/latest/what.html) to be exposed to the www. The official documentation on how to deploy a Flask app can be found in https://flask.palletsprojects.com/en/1.0.x/tutorial/deploy/.&lt;br /&gt;
&lt;br /&gt;
* Use MOODLE_MLBACKEND_PYTHON_USERS environment var to set a list of users and password (comma-separated). The value is &#039;default:sshhhh&#039; (user: default, password: sshhhh).&lt;br /&gt;
* Set MOODLE_MLBACKEND_PYTHON_DIR to the path you want to use to store the data generated by the package&lt;br /&gt;
&lt;br /&gt;
====== Docker ======&lt;br /&gt;
&lt;br /&gt;
https://hub.docker.com/r/moodlehq/moodle-mlbackend-python is the official moodle-mlbackend-python docker image. We use it internally at Moodle HQ for internal testing and you can use it as well. You may want more control over the image, if that is the case https://github.com/moodlehq/moodle-docker-mlbackend-python/blob/master/Dockerfile can serve as an example of what is needed to get the python moodlemlbackend package working.&lt;br /&gt;
&lt;br /&gt;
* Use MOODLE_MLBACKEND_PYTHON_USERS environment var to set a list of users and passwords (comma-separated). The value is &#039;default:sshhhh&#039; (user: default, password: sshhhh).&lt;br /&gt;
&lt;br /&gt;
To run the docker container locally you can execute (For &amp;lt;tt&amp;gt;VERSION&amp;lt;/tt&amp;gt;, see the Versions section above):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
docker pull moodlehq/moodle-mlbackend-python:VERSION-python3.7.5&lt;br /&gt;
docker run -d -p 5000:5000 --name=mlbackendpython --rm --add-host=mlbackendpython:0.0.0.0 moodlehq/moodle-mlbackend-python:VERSION-python3.7.5&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039; that you need to add &amp;lt;tt&amp;gt;--network=moodledocker_default&amp;lt;/tt&amp;gt; if your are using moodle-docker and you want this container to be visible from the web server.&lt;br /&gt;
&lt;br /&gt;
Then add this to your config.php file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;pathtopython = &#039;python&#039;;&lt;br /&gt;
define(&#039;TEST_MLBACKEND_PYTHON_HOST&#039;, &#039;localhost&#039;); // Change to &amp;quot;mlbackendpython&amp;quot; if your are using moodle-docker.&lt;br /&gt;
define(&#039;TEST_MLBACKEND_PYTHON_PORT&#039;, 5000);&lt;br /&gt;
define(&#039;TEST_MLBACKEND_PYTHON_USERNAME&#039;, &#039;default&#039;);&lt;br /&gt;
define(&#039;TEST_MLBACKEND_PYTHON_PASSWORD&#039;, &#039;sshhhh&#039;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check if it works, this command should not Skip any test:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vendor/bin/phpunit analytics/tests/prediction_test.php --verbose&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== AWS serverless service ======&lt;br /&gt;
&lt;br /&gt;
You can serve the Flask application as a serverless application using the AWS API gateway and AWS lambda. The easiest way to do it is using Zappa https://github.com/Miserlou/Zappa to deploy the Flask application contained in the python ML package.&lt;br /&gt;
&lt;br /&gt;
* Use MOODLE_MLBACKEND_PYTHON_USERS environment var to set a list of users and password (comma-separated). The value is &#039;default:sshhhh&#039; (user: default, password: sshhhh).&lt;br /&gt;
* Set MOODLE_MLBACKEND_PYTHON_DIR to the path you want to use to store the data generated by the package&lt;br /&gt;
* Set these environment variables below to setup the S3 access:&lt;br /&gt;
** MOODLE_MLBACKEND_PYTHON_S3_BUCKET_NAME to the bucket name&lt;br /&gt;
**AWS_ACCESS_KEY_ID as usual&lt;br /&gt;
** AWS_SECRET_ACCESS_KEY as usual&lt;br /&gt;
&lt;br /&gt;
Once this has been done, you can select the Python prediction processor as the default or for an individual model:&lt;br /&gt;
[[File:python_backend.png|frame|center|Predictions processor default]]&lt;br /&gt;
&lt;br /&gt;
[[File:python_backend_at_model.png|frame|center|Predictions processor selection for an individual model]]&lt;br /&gt;
&lt;br /&gt;
=== Log store ===&lt;br /&gt;
From Moodle version 2.7 and up, the “Standard logstore” is the default. If for some reason you also have data in the older “legacy logs,” you can enable the Moodle Learning Analytics system to access them instead.&lt;br /&gt;
&lt;br /&gt;
=== Analysis intervals ===&lt;br /&gt;
&lt;br /&gt;
Analysis intervals determine how often insights will be generated, and how much information to use for each calculation. Using proportional analysis intervals allows courses of different lengths to be used to train a single model.&lt;br /&gt;
&lt;br /&gt;
Several analysis intervals are available for models in the system. In this setting, the analysis intervals that will be used to evaluate models are defined, e.g. so the best analysis interval identified by the evaluation process can be selected for the model. This setting does not restrict the analysis intervals that can be used for specific models.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Analysis intervals]]&lt;br /&gt;
&lt;br /&gt;
Each analysis interval divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the analysis intervals you are interested in using; the evaluation process will iterate through all enabled analysis intervals, so the more analysis intervals enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
=== Models output directory ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
==Capabilities==&lt;br /&gt;
&lt;br /&gt;
There are two analytics capabilities:&lt;br /&gt;
&lt;br /&gt;
* [[Capabilities/moodle/analytics:managemodels|Manage models]] - allowed for the default role of manager only&lt;br /&gt;
* [[Capabilities/moodle/analytics:listinsights|List insights]] - allowed for the default roles of manager, teacher and non-editing teacher&lt;br /&gt;
&lt;br /&gt;
To receive notifications and view insights, a user must have the list insights capability within the context used as the &amp;quot;Analysable&amp;quot; for the model. For example, the [[Students at risk of dropping out]] model operates within the context of a course. Insights will be generated for each enrolment within any course matching the criteria of the model (courses with a start date in the past and an end date in the future, with at least one teacher and student), and these insights will be sent to anyone with the list insights capability in that course. &lt;br /&gt;
&lt;br /&gt;
Some models (e.g. the &#039;&#039;No teaching&#039;&#039; model) generate insights at the Site level. To receive insights from these models, the user must have a role assignment at the System level which includes the list insights capability. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Site administrators do &#039;&#039;&#039;not&#039;&#039;&#039; automatically receive insight notifications, though they can choose to view details of any insight notifications on the system. To enable site administrators to receive notifications of insights, assign an additional role that includes the list insights capability to the site administrator at the system level.&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Configuraciones de analítica]]&lt;br /&gt;
[[de:Analytics-Einstellungen]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Analytics_settings&amp;diff=142521</id>
		<title>Analytics settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Analytics_settings&amp;diff=142521"/>
		<updated>2021-11-11T17:46:37Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Specify the versions to be used by different Moodle branches&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Analytics}}&lt;br /&gt;
The Moodle learning analytics system requires some initial configuration before it can be used. You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Site information ==&lt;br /&gt;
&lt;br /&gt;
Site information will be used to help learning analytics models take characteristics of the institution into account. This information is also reported as part of site data collection when you register your site. This will allow HQ to understand which areas in learning analytics are seeing the most use and prioritize development resources appropriately.&lt;br /&gt;
&lt;br /&gt;
== Configure learning analytics settings ==&lt;br /&gt;
&lt;br /&gt;
Analytics may be disabled from Site administration / Advanced features&lt;br /&gt;
&lt;br /&gt;
They may then be configured from Site administration / Analytics. &lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
==== PHP predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
&lt;br /&gt;
==== Python predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The Python processor is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package. The package can be installed in the web server (in all the nodes if in a clustered environment) or in a separate server.&lt;br /&gt;
&lt;br /&gt;
===== Versions =====&lt;br /&gt;
&lt;br /&gt;
* Moodle 3.8 and up uses package 2.3.* (minimum 2.3.1)&lt;br /&gt;
* Moodle 3.9.11 and up uses package 2.6.* (minimum 2.6.4)&lt;br /&gt;
* Moodle 3.10.8 and up uses package 2.6.* (minimum 2.6.4)&lt;br /&gt;
* Moodle 3.11.4 and up uses package 2.6.* (minimum 2.6.4)&lt;br /&gt;
* Moodle 4.0 and up uses package 3.0.* (minimum 3.0.2)&lt;br /&gt;
&lt;br /&gt;
===== Installed in the web server ===== &lt;br /&gt;
&lt;br /&gt;
The latest version of the [https://pypi.org/project/moodlemlbackend/ packages for &#039;&#039;&#039;Moodle 3.8&#039;&#039;&#039; and up] are compatible with &#039;&#039;&#039;Python 3.4, 3.5, 3.6 and 3.7&#039;&#039;&#039;. Note that the package should be available for both the Command Line Interface (CLI) user and the user who runs the web server (e.g. www-data).&lt;br /&gt;
&lt;br /&gt;
# If necessary, install Python 3 (and pip for Python 3)&lt;br /&gt;
# Ensure that you use Python 3 to install the moodlemlbackend package (for VERSION, see the previous section):&lt;br /&gt;
&lt;br /&gt;
    sudo -H python3 -m pip install &amp;quot;moodlemlbackend==VERSION&amp;quot;&lt;br /&gt;
# You must also enter the path to the Python 3 executable in Site administration -&amp;gt; Server -&amp;gt; System paths:&lt;br /&gt;
[[File:path_to_python_3.png|frame|center|Enter system path for Python 3]]&lt;br /&gt;
&lt;br /&gt;
===== Installed in a separate server =====&lt;br /&gt;
&lt;br /&gt;
To install the python package in a separate server instead of installing it on the web server/s have some advantages:&lt;br /&gt;
* Keeps the python ML backend as an external service&lt;br /&gt;
* To keep a separated control of the resources the web server/s dedicate to serving Moodle and the resources dedicated to the python ML backend&lt;br /&gt;
* You can reuse the same ML server for multiple Moodle sites. Easier to setup and maintain than to install/upgrade the python package in all nodes in the cluster&lt;br /&gt;
* You can install the package as a new docker container in your dockerized environment&lt;br /&gt;
* You can serve the ML backend from AWS through the API gateway and AWS lambda, storing the trained model files in S3&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is expected that there can be some added latency in connecting to the python ML backend server.&lt;br /&gt;
&lt;br /&gt;
The python backend is exposed as a Flask application. The Flask application is part of the official &#039;moodlemlbackend&#039; Python package and its FLASK_APP script is &#039;webapp&#039;, in the root of the package. You are free to use the setup that better suits your existing infrastructure.&lt;br /&gt;
&lt;br /&gt;
====== New server in your infrastructure ======&lt;br /&gt;
&lt;br /&gt;
The python ML backend is exposed as a Flask application, which uses a WSGI server (https://wsgi.readthedocs.io/en/latest/what.html) to be exposed to the www. The official documentation on how to deploy a Flask app can be found in https://flask.palletsprojects.com/en/1.0.x/tutorial/deploy/.&lt;br /&gt;
&lt;br /&gt;
* Use MOODLE_MLBACKEND_PYTHON_USERS environment var to set a list of users and password (comma-separated). The value is &#039;default:sshhhh&#039; (user: default, password: sshhhh).&lt;br /&gt;
* Set MOODLE_MLBACKEND_PYTHON_DIR to the path you want to use to store the data generated by the package&lt;br /&gt;
&lt;br /&gt;
====== Docker ======&lt;br /&gt;
&lt;br /&gt;
https://hub.docker.com/r/moodlehq/moodle-mlbackend-python is the official moodle-mlbackend-python docker image. We use it internally at Moodle HQ for internal testing and you can use it as well. You may want more control over the image, if that is the case https://github.com/moodlehq/moodle-docker-mlbackend-python/blob/master/Dockerfile can serve as an example of what is needed to get the python moodlemlbackend package working.&lt;br /&gt;
&lt;br /&gt;
* Use MOODLE_MLBACKEND_PYTHON_USERS environment var to set a list of users and passwords (comma-separated). The value is &#039;default:sshhhh&#039; (user: default, password: sshhhh).&lt;br /&gt;
&lt;br /&gt;
To run the docker container locally you can execute:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
docker pull moodlehq/moodle-mlbackend-python:2.4.0-python3.7.5&lt;br /&gt;
# Note that you need to add --network=moodledocker_default if your are using moodle-docker and you want this container to be visible from the web server.&lt;br /&gt;
docker run -d -p 5000:5000 --name=mlbackendpython --rm --add-host=mlbackendpython:0.0.0.0 moodlehq/moodle-mlbackend-python:2.4.0-python3.7.5&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then add this to your config.php file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;pathtopython = &#039;python&#039;;&lt;br /&gt;
define(&#039;TEST_MLBACKEND_PYTHON_HOST&#039;, &#039;localhost&#039;); // Change to &amp;quot;mlbackendpython&amp;quot; if your are using moodle-docker.&lt;br /&gt;
define(&#039;TEST_MLBACKEND_PYTHON_PORT&#039;, 5000);&lt;br /&gt;
define(&#039;TEST_MLBACKEND_PYTHON_USERNAME&#039;, &#039;default&#039;);&lt;br /&gt;
define(&#039;TEST_MLBACKEND_PYTHON_PASSWORD&#039;, &#039;sshhhh&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check if it works, this command should not Skip any test:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
vendor/bin/phpunit analytics/tests/prediction_test.php --verbose&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== AWS serverless service ======&lt;br /&gt;
&lt;br /&gt;
You can serve the Flask application as a serverless application using the AWS API gateway and AWS lambda. The easiest way to do it is using Zappa https://github.com/Miserlou/Zappa to deploy the Flask application contained in the python ML package.&lt;br /&gt;
&lt;br /&gt;
* Use MOODLE_MLBACKEND_PYTHON_USERS environment var to set a list of users and password (comma-separated). The value is &#039;default:sshhhh&#039; (user: default, password: sshhhh).&lt;br /&gt;
* Set MOODLE_MLBACKEND_PYTHON_DIR to the path you want to use to store the data generated by the package&lt;br /&gt;
* Set these environment variables below to setup the S3 access:&lt;br /&gt;
** MOODLE_MLBACKEND_PYTHON_S3_BUCKET_NAME to the bucket name&lt;br /&gt;
**AWS_ACCESS_KEY_ID as usual&lt;br /&gt;
** AWS_SECRET_ACCESS_KEY as usual&lt;br /&gt;
&lt;br /&gt;
Once this has been done, you can select the Python prediction processor as the default or for an individual model:&lt;br /&gt;
[[File:python_backend.png|frame|center|Predictions processor default]]&lt;br /&gt;
&lt;br /&gt;
[[File:python_backend_at_model.png|frame|center|Predictions processor selection for an individual model]]&lt;br /&gt;
&lt;br /&gt;
=== Log store ===&lt;br /&gt;
From Moodle version 2.7 and up, the “Standard logstore” is the default. If for some reason you also have data in the older “legacy logs,” you can enable the Moodle Learning Analytics system to access them instead.&lt;br /&gt;
&lt;br /&gt;
=== Analysis intervals ===&lt;br /&gt;
&lt;br /&gt;
Analysis intervals determine how often insights will be generated, and how much information to use for each calculation. Using proportional analysis intervals allows courses of different lengths to be used to train a single model.&lt;br /&gt;
&lt;br /&gt;
Several analysis intervals are available for models in the system. In this setting, the analysis intervals that will be used to evaluate models are defined, e.g. so the best analysis interval identified by the evaluation process can be selected for the model. This setting does not restrict the analysis intervals that can be used for specific models.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Analysis intervals]]&lt;br /&gt;
&lt;br /&gt;
Each analysis interval divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the analysis intervals you are interested in using; the evaluation process will iterate through all enabled analysis intervals, so the more analysis intervals enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
=== Models output directory ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
==Capabilities==&lt;br /&gt;
&lt;br /&gt;
There are two analytics capabilities:&lt;br /&gt;
&lt;br /&gt;
* [[Capabilities/moodle/analytics:managemodels|Manage models]] - allowed for the default role of manager only&lt;br /&gt;
* [[Capabilities/moodle/analytics:listinsights|List insights]] - allowed for the default roles of manager, teacher and non-editing teacher&lt;br /&gt;
&lt;br /&gt;
To receive notifications and view insights, a user must have the list insights capability within the context used as the &amp;quot;Analysable&amp;quot; for the model. For example, the [[Students at risk of dropping out]] model operates within the context of a course. Insights will be generated for each enrolment within any course matching the criteria of the model (courses with a start date in the past and an end date in the future, with at least one teacher and student), and these insights will be sent to anyone with the list insights capability in that course. &lt;br /&gt;
&lt;br /&gt;
Some models (e.g. the &#039;&#039;No teaching&#039;&#039; model) generate insights at the Site level. To receive insights from these models, the user must have a role assignment at the System level which includes the list insights capability. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Site administrators do &#039;&#039;&#039;not&#039;&#039;&#039; automatically receive insight notifications, though they can choose to view details of any insight notifications on the system. To enable site administrators to receive notifications of insights, assign an additional role that includes the list insights capability to the site administrator at the system level.&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Configuraciones de analítica]]&lt;br /&gt;
[[de:Analytics-Einstellungen]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Configuration_file&amp;diff=141664</id>
		<title>Configuration file</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Configuration_file&amp;diff=141664"/>
		<updated>2021-09-09T14:22:48Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: fix filter_tex plugin name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
The name for Moodle&#039;s configuration file is config.php. The file is located in the moodle directory. It is not included in the Moodle download packages and is created by the installation process from the template file config-dist.php (which is included in Moodle packages).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==config-dist.php==&lt;br /&gt;
Although the installation process creates the config.php file for you, there may be times when you want to do this yourself. A sample config file, called config-dist.php, is shipped with Moodle.&lt;br /&gt;
&lt;br /&gt;
To get started simply copy config-dist.php to config.php, then edit config.php with you favourite editor. The file is very well commented. The important options (which you must supply) are all nearer the top. Other less common options are further down.&lt;br /&gt;
&lt;br /&gt;
==Setting $CFG-&amp;gt;wwwroot correctly==&lt;br /&gt;
This setting must be a fixed URL (a string constant) that points to your site. Do not try to set this with any PHP code that can generate a variable URL. This is not supported, can cause strange problems and will stop command line scripts working completely. If your site is accessed from different IP addresses this should be done with a split DNS, see [[Masquerading]]&lt;br /&gt;
&lt;br /&gt;
If you change your site from http to https, you &#039;&#039;&#039;MUST&#039;&#039;&#039; update this setting. If you don’t, you will have problems - for example (but not limited to) css scripts won’t load properly and you will also experience problems with logging in to your site. Also see [[Transitioning_to_HTTPS]]&lt;br /&gt;
&lt;br /&gt;
==Enabling password salting==&lt;br /&gt;
&lt;br /&gt;
See [[Password salting]].&lt;br /&gt;
&lt;br /&gt;
==Including passwords in backups==&lt;br /&gt;
&lt;br /&gt;
Hashed user passwords are no longer saved in backup files containing user data.&lt;br /&gt;
&lt;br /&gt;
If you really need passwords to be saved (in the rare case of restoring a [[Backup of user data|backup with user data]] to a different site), the following line may be added to config.php:&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;includeuserpasswordsinbackup = true;&lt;br /&gt;
&lt;br /&gt;
Note regarding restoring Moodle 2.5 backups to sites with old PHP versions:&lt;br /&gt;
&lt;br /&gt;
Because bcrypt is not supported in PHP versions below 5.3.7, course backups made using the $CFG-&amp;gt;includeuserpasswordsinbackup setting on a site using PHP version 5.3.7+ that are subsequently restored to a site with PHP version &amp;lt; 5.3.7 will require a password reset.&lt;br /&gt;
&lt;br /&gt;
==Changing default block layout for new courses==&lt;br /&gt;
&lt;br /&gt;
See [[Block layout]].&lt;br /&gt;
&lt;br /&gt;
==Adding extra theme directory location==&lt;br /&gt;
It is possible to add an extra themes directory stored outside of $CFG-&amp;gt;dirroot. This local directory does not have to be accessible from internet. Themes placed in the directory specified by these variables will then be available for selection using the theme selector.&lt;br /&gt;
&lt;br /&gt;
For example, should you wish to place extra themes in a subdirectory called &#039;my_moodle_themes&#039;, your config.php might look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;wwwroot   = &#039;http://my.moodle.site.edu&#039;;&lt;br /&gt;
$CFG-&amp;gt;dirroot   = &#039;/var/www/my.moodle.site.edu/public_html&#039;;&lt;br /&gt;
$CFG-&amp;gt;themedir  = $CFG-&amp;gt;dirroot . &#039;/my_moodle_themes&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disabling update notifications==&lt;br /&gt;
&lt;br /&gt;
See [[Notifications]].&lt;br /&gt;
&lt;br /&gt;
==Enabling debugging==&lt;br /&gt;
&lt;br /&gt;
See [[Debugging]].&lt;br /&gt;
&lt;br /&gt;
==Forcing the value of admin settings==&lt;br /&gt;
&lt;br /&gt;
As explained in config-dist.php, it is possible to specify normal admin settings here, the point is that they can not be changed through the standard admin settings pages any more. Just set the value in config.php like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;showuseridentity = &#039;email,idnumber,username&#039;;&lt;br /&gt;
$CFG-&amp;gt;preventexecpath = true;&lt;br /&gt;
$CFG-&amp;gt;pathtodu = &amp;quot;/usr/bin/du&amp;quot;;&lt;br /&gt;
$CFG-&amp;gt;pathtodot = &amp;quot;/usr/bin/dot&amp;quot;;&lt;br /&gt;
$CFG-&amp;gt;pathtogs = &amp;quot;/usr/bin/gs&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration for plugins can also be forced by the syntax is different, eg continuing the example above for security to always hard coded paths to all executable files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;forced_plugin_settings[&#039;filter_tex&#039;][&#039;pathconvert&#039;] = &#039;/usr/bin/convert&#039;;&lt;br /&gt;
$CFG-&amp;gt;forced_plugin_settings[&#039;filter_tex&#039;][&#039;pathdvips&#039;]   = &#039;/usr/bin/dvips&#039;;&lt;br /&gt;
$CFG-&amp;gt;forced_plugin_settings[&#039;filter_tex&#039;][&#039;pathdvisvgm&#039;] = &#039;/usr/bin/dvisvgm&#039;;&lt;br /&gt;
$CFG-&amp;gt;forced_plugin_settings[&#039;filter_tex&#039;][&#039;pathlatex&#039;]   = &#039;/usr/bin/latex&#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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=137889 Moodle Salting] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[de:Konfigurationsdatei]]&lt;br /&gt;
[[es:config.php]]&lt;br /&gt;
[[fr:Fichier de configuration]]&lt;br /&gt;
[[ja:設定ファイル]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Administration_via_command_line&amp;diff=140558</id>
		<title>Administration via command line</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Administration_via_command_line&amp;diff=140558"/>
		<updated>2021-06-02T22:06:12Z</updated>

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

		<summary type="html">&lt;p&gt;Stronk7: Moodle 3.11 required Moodle 3.6&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}	&lt;br /&gt;
&#039;&#039;This page explains in detail how to upgrade Moodle. For a summary of the process, see [[Upgrade overview]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Check the requirements==&lt;br /&gt;
&lt;br /&gt;
Before upgrading, check that your server meets all requirements for {{Version}} in &#039;&#039;Site administration &amp;gt; Server &amp;gt; [[Environment]]&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for both [{{Release notes}}#Server_requirements server] and [{{Release notes}}#Client_requirements client] software requirements.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* You can only upgrade to Moodle {{Version}} from Moodle 3.6 or later. If upgrading from earlier versions, you must [https://docs.moodle.org/36/en/Upgrading_to_Moodle_3.6 upgrade to 3.6] as a first step.&lt;br /&gt;
&lt;br /&gt;
==Before upgrading==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We advise that you test the upgrade first on a COPY of your production site, to make sure it works as you expect.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider setting the [[Upgrade key|upgrade key]] for your site.&lt;br /&gt;
&lt;br /&gt;
== Backup important data ==&lt;br /&gt;
&lt;br /&gt;
There are three areas that should be backed up before any upgrade:&lt;br /&gt;
#Moodle software (For example, everything in server/htdocs/moodle)&lt;br /&gt;
#Moodle uploaded files (For example, server/moodledata)&lt;br /&gt;
#Moodle database (For example, your Postgres or MySQL database dump)&lt;br /&gt;
&lt;br /&gt;
See [[Site backup]] for more specific information.&lt;br /&gt;
&lt;br /&gt;
== Check for plugin updates ==&lt;br /&gt;
&lt;br /&gt;
If you have [[Automatic updates deployment]] enabled, you will be able to update installed plugins automatically during the upgrade. Just make sure you check for available updates (via the button for it) at the Plugins check screen.&lt;br /&gt;
&lt;br /&gt;
If you are updating plugins manually, it is a good moment now to check in the [http://moodle.org/plugins Moodle Plugins directory] whether there is a {{Version}} version available for any plugins (including themes) that you have previously installed on your site. If so, download the plugin package. In the next step, you will copy it to the appropriate location in your Moodle code (see [[Installing plugins]]).&lt;br /&gt;
&lt;br /&gt;
The upgrade of the plugin will then happen as part of the Moodle upgrade process.&lt;br /&gt;
&lt;br /&gt;
If an out-of-date plugin causes your upgrade to fail, you can usually delete the plugin code rather than uninstalling it from within Moodle so that the data associated with it is not deleted.&lt;br /&gt;
&lt;br /&gt;
==Put your site into maintenance mode==&lt;br /&gt;
Before you begin upgrading your site, you should put it into [[Maintenance_mode | maintenance mode]] to stop any non-admin users from logging in. Then you should wait for any currently running cron processes to complete before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Install the new Moodle software ==&lt;br /&gt;
You can fetch the current version of the software at&lt;br /&gt;
&lt;br /&gt;
wget http://sourceforge.net/projects/moodle/files/Moodle/stable39/moodle-latest-39.tgz&lt;br /&gt;
&lt;br /&gt;
=== Standard install package ===&lt;br /&gt;
&lt;br /&gt;
# Move your old Moodle software program files to another location. &#039;&#039;Do NOT copy new files over the old files.&#039;&#039;&lt;br /&gt;
# Unzip or unpack the upgrade file so that all the new Moodle software program files are in the location the old files used to be in on the server. Moodle will adjust SQL and moodledata if it needs to in the upgrade.&lt;br /&gt;
# Copy your old [[Configuration file|config.php file]] back to the new Moodle directory. &lt;br /&gt;
# As mentioned above, if you had installed any plugins on your site you should add them to the new code tree (Moodle directory structure) now. It is important to check that you get the correct version for your new version of Moodle. Be particularly careful that you do not overwrite any code in the new version of Moodle and that you place the plugin folders in the correct directory (the same directory that they are in in the current installation.)&lt;br /&gt;
# Your moodledata folder should be located separately to your Moodle code folder and, as such, should not need anything done to it.  Moodle 3.0 will throw a warning if it is located in a web accessible folder and the moodledata should never be located in the Moodle code folder.  If you are moving your installation to a new server or new location on your server, then you will need to follow the [[Migration]] documents.&lt;br /&gt;
&lt;br /&gt;
====Linux====&lt;br /&gt;
 mv moodle moodle.backup&lt;br /&gt;
 tar xvzf moodle-latest-{{Version}}.tgz&lt;br /&gt;
&lt;br /&gt;
Next, copy across your config.php, any custom plugins, and your .htaccess file if you created one (&#039;&#039;&#039;check that custom plugins are the correct version for your new Moodle first&#039;&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
 cp moodle.backup/config.php moodle&lt;br /&gt;
 cp -pr moodle.backup/theme/mytheme moodle/theme/mytheme&lt;br /&gt;
 cp -pr moodle.backup/mod/mymod moodle/mod/mymod&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to make moodle/config.php (and the rest of the source code) readable by your www server. For maximum security the files should not be writeable by your server. This is especially important on a &#039;production&#039; server open to the public internet. &lt;br /&gt;
&lt;br /&gt;
 chown -R root:root moodle (Linux debian - or even create a user especially for moodle. &#039;&#039;&#039;Don&#039;t&#039;&#039;&#039; use the web server user, e.g. www-data)&lt;br /&gt;
 chmod -R 755 moodle&lt;br /&gt;
&lt;br /&gt;
If you use cron, take care that cron.php is executeable and uses the correct php command: &lt;br /&gt;
 chmod 740 admin/cli/cron.php (some configurations need chmod 750 or chmod 755)&lt;br /&gt;
 copy the first line from cron.php (if it looks like &#039;#!/usr/local/bin/php&#039; or &#039;#!/usr/local/bin/php5.3&#039;, no need to copy &#039;&amp;lt;?php&#039;) &lt;br /&gt;
if necessary.  However, for a simple upgrade, there should be no need to change anything with cron.&lt;br /&gt;
&lt;br /&gt;
=== Using Git ===&lt;br /&gt;
&lt;br /&gt;
You can use Git for updating or upgrading your Moodle. See [[Git for Administrators]] for details.&lt;br /&gt;
&lt;br /&gt;
===Command line upgrade===&lt;br /&gt;
&lt;br /&gt;
On Linux servers, Moodle {{Version}} supports running the [[CLI|upgrade from the command line]], rather than through a web browser. This is likely to be more reliable, particularly for large sites.&lt;br /&gt;
&lt;br /&gt;
== Finishing the upgrade ==&lt;br /&gt;
&lt;br /&gt;
The last step is to trigger the upgrade processes within Moodle. &lt;br /&gt;
&lt;br /&gt;
If you put your site into Maintenance mode earlier; take it out now!&lt;br /&gt;
&lt;br /&gt;
To do this just go to &#039;&#039;Site administration &amp;gt; Notifications&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Moodle will automatically detect the new version and perform all the SQL database or file system upgrades that are necessary. If there is anything it can&#039;t do itself (very rare) then you will see messages telling you what you need to do.&lt;br /&gt;
&lt;br /&gt;
Assuming all goes well (no error messages) then you can start using your new version of Moodle and enjoy the new features!&lt;br /&gt;
&lt;br /&gt;
Note: If you are running multiple servers then you should purge all caches manually (via &#039;&#039;Site administration &amp;gt; Development &amp;gt; Purge all caches&#039;&#039;) after completing the upgrade on all servers.&lt;br /&gt;
&lt;br /&gt;
===Fatal error: Maximum execution time of 30 seconds exceeded...===&lt;br /&gt;
&lt;br /&gt;
If your server uses a main language other than English, you may encounter a &#039;Fatal error: Maximum execution time of 30 seconds exceeded&#039; when you try to upgrade it. You can increase max_execution_time = 160 on php.ini to allow the scripts enough time to process the language update. Otherwise, you can switch to English as the default language before doing the upgrade and back to your original language after a successful upgrade. See the forum discussion at https://moodle.org/mod/forum/discuss.php?d=119598.&lt;br /&gt;
&lt;br /&gt;
==After upgrading==&lt;br /&gt;
&lt;br /&gt;
==Possible issues that may affect you in Moodle {{Version}}==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please add items here...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See also the list of [https://tracker.moodle.org/issues/?jql=project%20%3D%20MDL%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%203.10%20AND%20labels%20%3D%20upgrade_notes upgrade_notes-labelled issues] and [https://tracker.moodle.org/issues/?jql=project%20%3D%20MDL%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%203.10%20AND%20labels%20%3D%20ui_change ui_change-labelled issues]. &lt;br /&gt;
&lt;br /&gt;
===New capabilities in Moodle {{Version}}===&lt;br /&gt;
&lt;br /&gt;
* block/accessreview:addinstance&lt;br /&gt;
* block/accessreview:view&lt;br /&gt;
* mod/quiz:viewoverrides&lt;br /&gt;
* moodle/contentbank:viewunlistedcontent&lt;br /&gt;
* tool/brickfield:viewcoursetools&lt;br /&gt;
* tool/brickfield:viewsystemtools&lt;br /&gt;
&lt;br /&gt;
=== Moodle 3.6, 3.7, 3.8, 3.9 and 3.10 improvements ===&lt;br /&gt;
&lt;br /&gt;
Depending on which version you are upgrading from, please see the section &#039;Possible issues that may affect you&#039; in the documentation&lt;br /&gt;
&lt;br /&gt;
* [https://docs.moodle.org/36/en/Upgrading Upgrading to Moodle 3.6]&lt;br /&gt;
* [https://docs.moodle.org/37/en/Upgrading Upgrading to Moodle 3.7]&lt;br /&gt;
* [https://docs.moodle.org/38/en/Upgrading Upgrading to Moodle 3.8]&lt;br /&gt;
* [https://docs.moodle.org/39/en/Upgrading Upgrading to Moodle 3.9]&lt;br /&gt;
* [https://docs.moodle.org/310/en/Upgrading Upgrading to Moodle 3.10]&lt;br /&gt;
&lt;br /&gt;
==Any questions about the process?==&lt;br /&gt;
&lt;br /&gt;
Please post in the [https://moodle.org/mod/forum/view.php?id=28 Installing and upgrading help forum] on moodle.org.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[dev:Moodle {{Version}} release notes|Moodle {{Version}} release notes]]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=393570 Problem accessing dropdown such as personal profile since 3.8 (20191118) update] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[es:Actualización de moodle]]&lt;br /&gt;
[[fr:Mise à jour]]&lt;br /&gt;
[[ja:Moodleをアップグレードする]]&lt;br /&gt;
[[de:Aktualisierung von Moodle]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Environment_-_max_input_vars&amp;diff=140255</id>
		<title>Environment - max input vars</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Environment_-_max_input_vars&amp;diff=140255"/>
		<updated>2021-05-06T17:02:43Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Add environment category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The PHP setting &#039;&#039;&#039;max_input_vars&#039;&#039;&#039; determines how many input variables may be accepted (limit is applied to $_GET, $_POST and $_COOKIE superglobal separately). If there are more input variables than specified by this directive, an E_WARNING is issued, and further input variables are truncated from the request. &lt;br /&gt;
&lt;br /&gt;
There are a lot of big or potentially big forms in Moodle, such as:&lt;br /&gt;
* Site administration tree search&lt;br /&gt;
* Editing roles&lt;br /&gt;
* Grading courses with big number of participants&lt;br /&gt;
* Large quizzes and quiz settings&lt;br /&gt;
 &lt;br /&gt;
The default value for max_input_vars in PHP is &#039;&#039;&#039;1000&#039;&#039;&#039;, this is not enough for many cases.&lt;br /&gt;
&lt;br /&gt;
If you are using PHP 7 the recommended value for the &#039;&#039;&#039;max_input_vars&#039;&#039;&#039; in Moodle is &#039;&#039;&#039;5000&#039;&#039;&#039; but you can still use Moodle with the lower value. Moodle code has a workaround that allows to submit the forms even with bigger limit however this workaround is not perfect. It is much better to increase the setting.&lt;br /&gt;
&lt;br /&gt;
If you are using PHP 8 the minimum value of 5000 &#039;&#039;&#039;is required&#039;&#039;&#039;.  By default PHP 8 sets to display startup errors (see [[https://php.watch/versions/8.0/startup-errors-enabled]]). This means that the warning about exceeding max_input_vars appears before the workaround even applied.&lt;br /&gt;
&lt;br /&gt;
To change max_input_vars you can either set it in php.ini or modify it in runtime, for example for Apache you can create &#039;&#039;&#039;.htaccess&#039;&#039;&#039; file:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
php_value max_input_vars 5000&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|PHP]]&lt;br /&gt;
&lt;br /&gt;
[[es:admin/environment/custom check/max input vars]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Environment_-_PHP_extension_sodium&amp;diff=140251</id>
		<title>Environment - PHP extension sodium</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Environment_-_PHP_extension_sodium&amp;diff=140251"/>
		<updated>2021-05-06T12:25:04Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Environment}}&lt;br /&gt;
&lt;br /&gt;
The php-sodium extension provides strong encryption capabilities in an easy and consistent way. &lt;br /&gt;
&lt;br /&gt;
Note that, for sites not having the extension installed, a php-openssl based solution, considered suboptimal, is used, and this fallback will stop working in a few versions (Moodle 4.2). See MDL-71421 for more details.&lt;br /&gt;
&lt;br /&gt;
Hence, it&#039;s highly recommended to start using php-sodium.&lt;br /&gt;
&lt;br /&gt;
Please see [https://www.php.net/manual/book.sodium.php https://www.php.net/manual/book.sodium.php]&lt;br /&gt;
&lt;br /&gt;
Please see [https://py-ipv8.readthedocs.io/en/latest/preliminaries/install_libsodium/]&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|PHP]]&lt;br /&gt;
&lt;br /&gt;
[[es:admin/environment/php extension/sodium]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Environment_-_PHP_extension_sodium&amp;diff=140250</id>
		<title>Environment - PHP extension sodium</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Environment_-_PHP_extension_sodium&amp;diff=140250"/>
		<updated>2021-05-06T12:24:39Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Some notes about php-sodium and current php-openssl fallback&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Environment}}&lt;br /&gt;
&lt;br /&gt;
The php-sodium extension provides strong encryption capabilities in an easy and consistent way. &lt;br /&gt;
&lt;br /&gt;
Note that, for sites not having the extension installed, a php-openssl based solution, considered suboptimal, is used, and this fallback will stop working in a few versions (Moodle 4.2).&lt;br /&gt;
&lt;br /&gt;
Hence, it&#039;s highly recommended to start using php-sodium.&lt;br /&gt;
&lt;br /&gt;
Please see [https://www.php.net/manual/book.sodium.php https://www.php.net/manual/book.sodium.php]&lt;br /&gt;
&lt;br /&gt;
Please see [https://py-ipv8.readthedocs.io/en/latest/preliminaries/install_libsodium/]&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|PHP]]&lt;br /&gt;
&lt;br /&gt;
[[es:admin/environment/php extension/sodium]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Upgrading&amp;diff=132613</id>
		<title>Upgrading</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Upgrading&amp;diff=132613"/>
		<updated>2018-12-03T00:49:37Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: reorganize the section to avoid duplicating incomplete information. Always refer to the release notes for server and client requirements.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}	&lt;br /&gt;
&#039;&#039;This page explains in detail how to upgrade Moodle. For a summary of the process, see [[Upgrade overview]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Check the requirements==&lt;br /&gt;
&lt;br /&gt;
Before upgrading, check that your server meets all requirements for {{Version}} in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; [[Environment]]&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for both [{{Release notes}}#Server_requirements server] and [{{Release notes}}#Client_requirements client] software requirements.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* You can only upgrade to Moodle {{Version}} from Moodle 3.1 or later. If upgrading from earlier versions, you must [https://docs.moodle.org/31/en/Upgrading_to_Moodle_3.1 upgrade to 3.1] as a first step.&lt;br /&gt;
&lt;br /&gt;
==Before upgrading==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We advise that you test the upgrade first on a COPY of your production site, to make sure it works as you expect.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider setting the [[Upgrade key|upgrade key]] for your site.&lt;br /&gt;
&lt;br /&gt;
== Backup important data ==&lt;br /&gt;
&lt;br /&gt;
There are three areas that should be backed up before any upgrade:&lt;br /&gt;
#Moodle software (For example, everything in server/htdocs/moodle)&lt;br /&gt;
#Moodle uploaded files (For example, server/moodledata)&lt;br /&gt;
#Moodle database (For example, your Postgres or MySQL database dump)&lt;br /&gt;
&lt;br /&gt;
See [[Site backup]] for more specific information.&lt;br /&gt;
&lt;br /&gt;
== Check for plugin updates ==&lt;br /&gt;
&lt;br /&gt;
If you have [[Automatic updates deployment]] enabled, you will be able to update installed plugins automatically during the upgrade. Just make sure you check for available updates (via the button for it) at the Plugins check screen.&lt;br /&gt;
&lt;br /&gt;
If you are updating plugins manually, it is a good moment now to check in the [http://moodle.org/plugins Moodle Plugins directory] whether there is a {{Version}} version available for any plugins (including themes) that you have previously installed on your site. If so, download the plugin package. In the next step, you will copy it to the appropriate location in your Moodle code (see [[Installing plugins]]).&lt;br /&gt;
&lt;br /&gt;
The upgrade of the plugin will then happen as part of the Moodle upgrade process.&lt;br /&gt;
&lt;br /&gt;
If an out-of-date plugin causes your upgrade to fail, you can usually delete the plugin code rather than uninstalling it from within Moodle so that the data associated with it is not deleted.&lt;br /&gt;
&lt;br /&gt;
==Put your site into maintenance mode==&lt;br /&gt;
Before you begin upgrading your site, you should put it into [[Maintenance_mode | maintenance mode]] to stop any non-admin users from logging in. Then you should wait for any currently running cron processes to complete before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Install the new Moodle software ==&lt;br /&gt;
You can fetch the current version of the software through &lt;br /&gt;
&lt;br /&gt;
wget http://sourceforge.net/projects/moodle/files/Moodle/stable{{Version2}}/moodle-latest-{{Version2}}.tgz&lt;br /&gt;
&lt;br /&gt;
=== Standard install package ===&lt;br /&gt;
&lt;br /&gt;
# Move your old Moodle software program files to another location. &#039;&#039;Do NOT copy new files over the old files.&#039;&#039;&lt;br /&gt;
# Unzip or unpack the upgrade file so that all the new Moodle software program files are in the location the old files used to be in on the server. Moodle will adjust SQL and moodledata if it needs to in the upgrade.&lt;br /&gt;
# Copy your old [[Configuration file|config.php file]] back to the new Moodle directory. &lt;br /&gt;
# As mentioned above, if you had installed any plugins on your site you should add them to the new code tree (Moodle directory structure) now. It is important to check that you get the correct version for your new version of Moodle. Be particularly careful that you do not overwrite any code in the new version of Moodle and that you place the plugin folders in the correct directory (the same directory that they are in in the current installation.)&lt;br /&gt;
# Your moodledata folder should be located separately to your Moodle code folder and, as such, should not need anything done to it.  Moodle 3.0 will throw a warning if it is located in a web accessible folder and the moodledata should never be located in the Moodle code folder.  If you are moving your installation to a new server or new location on your server, then you will need to follow the Migration documents.&lt;br /&gt;
&lt;br /&gt;
====Linux====&lt;br /&gt;
 mv moodle moodle.backup&lt;br /&gt;
 tar xvzf moodle-{{Version}}.tgz&lt;br /&gt;
&lt;br /&gt;
Next, copy across your config.php, any custom plugins, and your .htaccess file if you created one (&#039;&#039;&#039;check that custom plugins are the correct version for your new Moodle first&#039;&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
 cp moodle.backup/config.php moodle&lt;br /&gt;
 cp -pr moodle.backup/theme/mytheme moodle/theme/mytheme&lt;br /&gt;
 cp -pr moodle.backup/mod/mymod moodle/mod/mymod&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to make moodle/config.php (and the rest of the source code) readable by your www server. Ideally the files should not be writeable by your server.&lt;br /&gt;
&lt;br /&gt;
chown -R www-data:www-data moodle (Linux debian - change to appropriate user and group for your OS version)&lt;br /&gt;
chmod -R 755 moodle&lt;br /&gt;
&lt;br /&gt;
If you use cron, take care that cron.php is executeable and uses the correct php command: &lt;br /&gt;
 chmod 740 admin/cli/cron.php (some configurations need chmod 750 or chmod 755)&lt;br /&gt;
 copy the first line from cron.php (if it looks like &#039;#!/usr/local/bin/php&#039; or &#039;#!/usr/local/bin/php5.3&#039;, no need to copy &#039;&amp;lt;?php&#039;) &lt;br /&gt;
if necessary.  However, for a simple upgrade, there should be no need to change anything with cron.&lt;br /&gt;
&lt;br /&gt;
=== Using Git ===&lt;br /&gt;
&lt;br /&gt;
You can use Git for updating or upgrading your Moodle. See [[Git for Administrators]] for details.&lt;br /&gt;
&lt;br /&gt;
===Command line upgrade===&lt;br /&gt;
&lt;br /&gt;
On Linux servers, Moodle {{Version}} supports running the [[CLI|upgrade from the command line]], rather than through a web browser. This is likely to be more reliable, particularly for large sites.&lt;br /&gt;
&lt;br /&gt;
== Finishing the upgrade ==&lt;br /&gt;
&lt;br /&gt;
The last step is to trigger the upgrade processes within Moodle. &lt;br /&gt;
&lt;br /&gt;
If you put your site into Maintenance mode earlier; take it out now!&lt;br /&gt;
&lt;br /&gt;
To do this just go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Notifications&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Moodle will automatically detect the new version and perform all the SQL database or file system upgrades that are necessary. If there is anything it can&#039;t do itself (very rare) then you will see messages telling you what you need to do.&lt;br /&gt;
&lt;br /&gt;
Assuming all goes well (no error messages) then you can start using your new version of Moodle and enjoy the new features!&lt;br /&gt;
&lt;br /&gt;
Note: If you are running multiple servers then you should purge all caches manually (via &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Development &amp;gt; Purge all caches&#039;&#039;) after completing the upgrade on all servers.&lt;br /&gt;
&lt;br /&gt;
===Fatal error: Maximum execution time of 30 seconds exceeded...===&lt;br /&gt;
&lt;br /&gt;
If your server uses a main language other than English, you may encounter a &#039;Fatal error: Maximum execution time of 30 seconds exceeded&#039; when you try to upgrade it. You can increase max_execution_time = 160 on php.ini to allow the scripts enough time to process the language update. Otherwise, you can switch to English as the default language before doing the upgrade and back to your original language after a succcessful upgrade. See the forum discussion at https://moodle.org/mod/forum/discuss.php?d=119598.&lt;br /&gt;
&lt;br /&gt;
==After upgrading==&lt;br /&gt;
&lt;br /&gt;
The config.php file from your installation should work fine but if you take a look at config-dist.php that came with Moodle 3.0 there are more/different options available (e.g. database drivers and settings). It&#039;s a good idea to map your old config.php settings to a new one based on the 3.0 config-dist.php.&lt;br /&gt;
&lt;br /&gt;
===Cron===&lt;br /&gt;
&lt;br /&gt;
Cron has received a major update (MDL-25499) and now has support for both scheduled and ad hoc tasks.&lt;br /&gt;
&lt;br /&gt;
The benefits of these changes are:&lt;br /&gt;
* The schedule for every task can be configured by the admin&lt;br /&gt;
* Tasks can run in parallel&lt;br /&gt;
* Cron processes use locking to prevent the same task running at the same time by different processes&lt;br /&gt;
* Clusters with multiple identical application nodes are supported, you can run cron on all of them&lt;br /&gt;
&lt;br /&gt;
A result of this is that cron can be run much more often, which means (for example) forum posts can be sent out sooner.  To take advantage of the new cron system it is now strongly recommended that administrators increase the frequency that cron is run to at least &#039;&#039;once per minute&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You also may need to modify any automated scripts you have that are parsing the output from cron. It is no longer possible to simply monitor the output of cron for the string &amp;quot;Cron script completed correctly&amp;quot; (if that is what you were doing). An alternative is to monitor the output for the string &amp;quot;task failed:&amp;quot;. If you detect that a task is failing, [[Cron#Debugging_Scheduled_Tasks|here]] are some tips for debugging the failure. &lt;br /&gt;
&lt;br /&gt;
Before the upgrade, there may have been a cron task that was failing, which was preventing the rest of cron from being executed. A failure in any single task will no longer prevent the rest of the Moodle cron tasks from executing, so you may uncover previously masked bugs. It is a good idea to closely monitor the output from cron after the upgrade.&lt;br /&gt;
&lt;br /&gt;
===Assignments===&lt;br /&gt;
&lt;br /&gt;
The old assignment (2.2) module has been removed from core and has been replaced by a stub to support transparently remapping URLs and restoring course backups from the old module to the new one. &lt;br /&gt;
&lt;br /&gt;
If you are still using the old assignment (2.2) module, after upgrading to Moodle 3.0 all assignment (2.2) activities will be hidden. You need to run the [[Assignment upgrade tool]] to un-hide the activities.&lt;br /&gt;
&lt;br /&gt;
If you really, really need to keep using the old assignment (2.2) module, you should update the code to Moodle 3.0, and then replace the &amp;quot;mod/assignment&amp;quot; folder with the one from https://github.com/moodlehq/moodle-mod_assignment/releases before completing the upgrade.&lt;br /&gt;
&lt;br /&gt;
==Possible issues that may affect you in Moodle {{Version}}==&lt;br /&gt;
&lt;br /&gt;
* To use &#039;Run now&#039; links in [[Scheduled tasks]], you need to set &#039;Path to PHP CLI&#039; (pathtophp) in Site administration &amp;gt; Server &amp;gt; System paths.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Items to be added...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See also the list of [https://tracker.moodle.org/issues/?jql=project%20%3D%20mdl%20AND%20resolution%20%3D%20fixed%20AND%20fixVersion%20in%20(%223.6%22)%20AND%20labels%20%3D%20upgrade_notes upgrade_notes-labelled issues] and [https://tracker.moodle.org/issues/?jql=project%20%3D%20mdl%20AND%20resolution%20%3D%20fixed%20AND%20fixVersion%20in%20(%223.6%22)%20AND%20labels%20%3D%20ui_change%20 ui_change-labelled issues]. &lt;br /&gt;
&lt;br /&gt;
=== Moodle 3.1, 3.2, 3.3, 3.4 and 3.5 improvements ===&lt;br /&gt;
&lt;br /&gt;
Depending on which version you are upgrading from, please see the section &#039;Possible issues that may affect you&#039; in the documentation&lt;br /&gt;
&lt;br /&gt;
* [https://docs.moodle.org/31/en/Upgrading Upgrading to Moodle 3.1]&lt;br /&gt;
* [https://docs.moodle.org/32/en/Upgrading Upgrading to Moodle 3.2]&lt;br /&gt;
* [https://docs.moodle.org/33/en/Upgrading Upgrading to Moodle 3.3]&lt;br /&gt;
* [https://docs.moodle.org/34/en/Upgrading Upgrading to Moodle 3.4]&lt;br /&gt;
* [https://docs.moodle.org/35/en/Upgrading Upgrading to Moodle 3.5]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation help forum] &lt;br /&gt;
* [[dev:Moodle {{Version}} release notes|Moodle {{Version}} release notes]]&lt;br /&gt;
&lt;br /&gt;
[[es:Actualización de moodle]]&lt;br /&gt;
[[fr:Mise à jour]]&lt;br /&gt;
[[ja:Moodleをアップグレードする]]&lt;br /&gt;
[[de:Aktualisierung von Moodle]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Upgrading&amp;diff=132376</id>
		<title>Upgrading</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Upgrading&amp;diff=132376"/>
		<updated>2018-11-25T12:28:24Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Add a note about PHP 7.3 being work in progress.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}	&lt;br /&gt;
&#039;&#039;This page explains in detail how to upgrade Moodle. For a summary of the process, see [[Upgrade overview]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Check the requirements==&lt;br /&gt;
&lt;br /&gt;
Check that your server meets all requirements for {{Version}} in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; [[Environment]]&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* You can only upgrade to Moodle {{Version}} from Moodle 3.1 or later. If upgrading from earlier versions, you must [https://docs.moodle.org/31/en/Upgrading_to_Moodle_3.1 upgrade to 3.1] as a first step.&lt;br /&gt;
* The minimum PHP version has increased and is now 7.0.0. PHP 7.3 support is being implemented (MDL-63420) for Moodle 3.6.x and later releases. Hence it&#039;s still incomplete and only for development purposes.&lt;br /&gt;
* The PHP extension &#039;&#039;&#039;intl&#039;&#039;&#039; is now required in Moodle 3.4 (previously it was only recommended).&lt;br /&gt;
&lt;br /&gt;
==Before upgrading==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We advise that you test the upgrade first on a COPY of your production site, to make sure it works as you expect.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider setting the [[Upgrade key|upgrade key]] for your site.&lt;br /&gt;
&lt;br /&gt;
== Backup important data ==&lt;br /&gt;
&lt;br /&gt;
There are three areas that should be backed up before any upgrade:&lt;br /&gt;
#Moodle software (For example, everything in server/htdocs/moodle)&lt;br /&gt;
#Moodle uploaded files (For example, server/moodledata)&lt;br /&gt;
#Moodle database (For example, your Postgres or MySQL database dump)&lt;br /&gt;
&lt;br /&gt;
See [[Site backup]] for more specific information.&lt;br /&gt;
&lt;br /&gt;
== Check for plugin updates ==&lt;br /&gt;
&lt;br /&gt;
If you have [[Automatic updates deployment]] enabled, you will be able to update installed plugins automatically during the upgrade. Just make sure you check for available updates (via the button for it) at the Plugins check screen.&lt;br /&gt;
&lt;br /&gt;
If you are updating plugins manually, it is a good moment now to check in the [http://moodle.org/plugins Moodle Plugins directory] whether there is a {{Version}} version available for any plugins (including themes) that you have previously installed on your site. If so, download the plugin package. In the next step, you will copy it to the appropriate location in your Moodle code (see [[Installing plugins]]).&lt;br /&gt;
&lt;br /&gt;
The upgrade of the plugin will then happen as part of the Moodle upgrade process.&lt;br /&gt;
&lt;br /&gt;
If an out-of-date plugin causes your upgrade to fail, you can usually delete the plugin code rather than uninstalling it from within Moodle so that the data associated with it is not deleted.&lt;br /&gt;
&lt;br /&gt;
==Put your site into maintenance mode==&lt;br /&gt;
Before you begin upgrading your site, you should put it into [[Maintenance_mode | maintenance mode]] to stop any non-admin users from logging in. Then you should wait for any currently running cron processes to complete before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Install the new Moodle software ==&lt;br /&gt;
You can fetch the current version of the software through &lt;br /&gt;
&lt;br /&gt;
wget http://sourceforge.net/projects/moodle/files/Moodle/stable{{Version2}}/moodle-latest-{{Version2}}.tgz&lt;br /&gt;
&lt;br /&gt;
=== Standard install package ===&lt;br /&gt;
&lt;br /&gt;
# Move your old Moodle software program files to another location. &#039;&#039;Do NOT copy new files over the old files.&#039;&#039;&lt;br /&gt;
# Unzip or unpack the upgrade file so that all the new Moodle software program files are in the location the old files used to be in on the server. Moodle will adjust SQL and moodledata if it needs to in the upgrade.&lt;br /&gt;
# Copy your old [[Configuration file|config.php file]] back to the new Moodle directory. &lt;br /&gt;
# As mentioned above, if you had installed any plugins on your site you should add them to the new code tree (Moodle directory structure) now. It is important to check that you get the correct version for your new version of Moodle. Be particularly careful that you do not overwrite any code in the new version of Moodle and that you place the plugin folders in the correct directory (the same directory that they are in in the current installation.)&lt;br /&gt;
# Your moodledata folder should be located separately to your Moodle code folder and, as such, should not need anything done to it.  Moodle 3.0 will throw a warning if it is located in a web accessible folder and the moodledata should never be located in the Moodle code folder.  If you are moving your installation to a new server or new location on your server, then you will need to follow the Migration documents.&lt;br /&gt;
&lt;br /&gt;
====Linux====&lt;br /&gt;
 mv moodle moodle.backup&lt;br /&gt;
 tar xvzf moodle-{{Version}}.tgz&lt;br /&gt;
&lt;br /&gt;
Next, copy across your config.php, any custom plugins, and your .htaccess file if you created one (&#039;&#039;&#039;check that custom plugins are the correct version for your new Moodle first&#039;&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
 cp moodle.backup/config.php moodle&lt;br /&gt;
 cp -pr moodle.backup/theme/mytheme moodle/theme/mytheme&lt;br /&gt;
 cp -pr moodle.backup/mod/mymod moodle/mod/mymod&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to make moodle/config.php (and the rest of the source code) readable by your www server. Ideally the files should not be writeable by your server.&lt;br /&gt;
&lt;br /&gt;
chown -R www-data:www-data moodle (Linux debian - change to appropriate user and group for your OS version)&lt;br /&gt;
chmod -R 755 moodle&lt;br /&gt;
&lt;br /&gt;
If you use cron, take care that cron.php is executeable and uses the correct php command: &lt;br /&gt;
 chmod 740 admin/cli/cron.php (some configurations need chmod 750 or chmod 755)&lt;br /&gt;
 copy the first line from cron.php (if it looks like &#039;#!/usr/local/bin/php&#039; or &#039;#!/usr/local/bin/php5.3&#039;, no need to copy &#039;&amp;lt;?php&#039;) &lt;br /&gt;
if necessary.  However, for a simple upgrade, there should be no need to change anything with cron.&lt;br /&gt;
&lt;br /&gt;
=== Using Git ===&lt;br /&gt;
&lt;br /&gt;
You can use Git for updating or upgrading your Moodle. See [[Git for Administrators]] for details.&lt;br /&gt;
&lt;br /&gt;
===Command line upgrade===&lt;br /&gt;
&lt;br /&gt;
On Linux servers, Moodle {{Version}} supports running the [[CLI|upgrade from the command line]], rather than through a web browser. This is likely to be more reliable, particularly for large sites.&lt;br /&gt;
&lt;br /&gt;
== Finishing the upgrade ==&lt;br /&gt;
&lt;br /&gt;
The last step is to trigger the upgrade processes within Moodle. &lt;br /&gt;
&lt;br /&gt;
If you put your site into Maintenance mode earlier; take it out now!&lt;br /&gt;
&lt;br /&gt;
To do this just go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Notifications&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Moodle will automatically detect the new version and perform all the SQL database or file system upgrades that are necessary. If there is anything it can&#039;t do itself (very rare) then you will see messages telling you what you need to do.&lt;br /&gt;
&lt;br /&gt;
Assuming all goes well (no error messages) then you can start using your new version of Moodle and enjoy the new features!&lt;br /&gt;
&lt;br /&gt;
Note: If you are running multiple servers then you should purge all caches manually (via &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Development &amp;gt; Purge all caches&#039;&#039;) after completing the upgrade on all servers.&lt;br /&gt;
&lt;br /&gt;
===Fatal error: Maximum execution time of 30 seconds exceeded...===&lt;br /&gt;
&lt;br /&gt;
If your server uses a main language other than English, you may encounter a &#039;Fatal error: Maximum execution time of 30 seconds exceeded&#039; when you try to upgrade it. You can increase max_execution_time = 160 on php.ini to allow the scripts enough time to process the language update. Otherwise, you can switch to English as the default language before doing the upgrade and back to your original language after a succcessful upgrade. See the forum discussion at https://moodle.org/mod/forum/discuss.php?d=119598.&lt;br /&gt;
&lt;br /&gt;
==After upgrading==&lt;br /&gt;
&lt;br /&gt;
The config.php file from your installation should work fine but if you take a look at config-dist.php that came with Moodle 3.0 there are more/different options available (e.g. database drivers and settings). It&#039;s a good idea to map your old config.php settings to a new one based on the 3.0 config-dist.php.&lt;br /&gt;
&lt;br /&gt;
===Cron===&lt;br /&gt;
&lt;br /&gt;
Cron has received a major update (MDL-25499) and now has support for both scheduled and ad hoc tasks.&lt;br /&gt;
&lt;br /&gt;
The benefits of these changes are:&lt;br /&gt;
* The schedule for every task can be configured by the admin&lt;br /&gt;
* Tasks can run in parallel&lt;br /&gt;
* Cron processes use locking to prevent the same task running at the same time by different processes&lt;br /&gt;
* Clusters with multiple identical application nodes are supported, you can run cron on all of them&lt;br /&gt;
&lt;br /&gt;
A result of this is that cron can be run much more often, which means (for example) forum posts can be sent out sooner.  To take advantage of the new cron system it is now strongly recommended that administrators increase the frequency that cron is run to at least &#039;&#039;once per minute&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You also may need to modify any automated scripts you have that are parsing the output from cron. It is no longer possible to simply monitor the output of cron for the string &amp;quot;Cron script completed correctly&amp;quot; (if that is what you were doing). An alternative is to monitor the output for the string &amp;quot;task failed:&amp;quot;. If you detect that a task is failing, [[Cron#Debugging_Scheduled_Tasks|here]] are some tips for debugging the failure. &lt;br /&gt;
&lt;br /&gt;
Before the upgrade, there may have been a cron task that was failing, which was preventing the rest of cron from being executed. A failure in any single task will no longer prevent the rest of the Moodle cron tasks from executing, so you may uncover previously masked bugs. It is a good idea to closely monitor the output from cron after the upgrade.&lt;br /&gt;
&lt;br /&gt;
===Assignments===&lt;br /&gt;
&lt;br /&gt;
The old assignment (2.2) module has been removed from core and has been replaced by a stub to support transparently remapping URLs and restoring course backups from the old module to the new one. &lt;br /&gt;
&lt;br /&gt;
If you are still using the old assignment (2.2) module, after upgrading to Moodle 3.0 all assignment (2.2) activities will be hidden. You need to run the [[Assignment upgrade tool]] to un-hide the activities.&lt;br /&gt;
&lt;br /&gt;
If you really, really need to keep using the old assignment (2.2) module, you should update the code to Moodle 3.0, and then replace the &amp;quot;mod/assignment&amp;quot; folder with the one from https://github.com/moodlehq/moodle-mod_assignment/releases before completing the upgrade.&lt;br /&gt;
&lt;br /&gt;
==Possible issues that may affect you in Moodle {{Version}}==&lt;br /&gt;
&lt;br /&gt;
* To use &#039;Run now&#039; links in [[Scheduled tasks]], you need to set &#039;Path to PHP CLI&#039; (pathtophp) in Site administration &amp;gt; Server &amp;gt; System paths.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Items to be added...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See also the list of [https://tracker.moodle.org/issues/?jql=project%20%3D%20mdl%20AND%20resolution%20%3D%20fixed%20AND%20fixVersion%20in%20(%223.6%22)%20AND%20labels%20%3D%20upgrade_notes upgrade_notes-labelled issues] and [https://tracker.moodle.org/issues/?jql=project%20%3D%20mdl%20AND%20resolution%20%3D%20fixed%20AND%20fixVersion%20in%20(%223.6%22)%20AND%20labels%20%3D%20ui_change%20 ui_change-labelled issues]. &lt;br /&gt;
&lt;br /&gt;
=== Moodle 3.1, 3.2, 3.3, 3.4 and 3.5 improvements ===&lt;br /&gt;
&lt;br /&gt;
Depending on which version you are upgrading from, please see the section &#039;Possible issues that may affect you&#039; in the documentation&lt;br /&gt;
&lt;br /&gt;
* [https://docs.moodle.org/31/en/Upgrading Upgrading to Moodle 3.1]&lt;br /&gt;
* [https://docs.moodle.org/32/en/Upgrading Upgrading to Moodle 3.2]&lt;br /&gt;
* [https://docs.moodle.org/33/en/Upgrading Upgrading to Moodle 3.3]&lt;br /&gt;
* [https://docs.moodle.org/34/en/Upgrading Upgrading to Moodle 3.4]&lt;br /&gt;
* [https://docs.moodle.org/35/en/Upgrading Upgrading to Moodle 3.5]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation help forum] &lt;br /&gt;
* [[dev:Moodle {{Version}} release notes|Moodle {{Version}} release notes]]&lt;br /&gt;
&lt;br /&gt;
[[es:Actualización de moodle]]&lt;br /&gt;
[[fr:Mise à jour]]&lt;br /&gt;
[[ja:Moodleをアップグレードする]]&lt;br /&gt;
[[de:Aktualisierung von Moodle]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Upgrading&amp;diff=131339</id>
		<title>Upgrading</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Upgrading&amp;diff=131339"/>
		<updated>2018-07-01T22:13:09Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Add a note in upgrade about the new PostgreSQL default behavior in 3.5 and up.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}	&lt;br /&gt;
&#039;&#039;This page explains in detail how to upgrade Moodle. For a summary of the process, see [[Upgrade overview]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Check the requirements==&lt;br /&gt;
&lt;br /&gt;
Check that your server meets all requirements for {{Version}} in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; [[Environment]]&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* You can only upgrade to Moodle {{Version}} from Moodle 3.1 or later. If upgrading from earlier versions, you must [https://docs.moodle.org/31/en/Upgrading_to_Moodle_3.1 upgrade to 3.1] as a first step.&lt;br /&gt;
* The minimum PHP version has increased and is now 7.0.0.&lt;br /&gt;
* The PHP extension &#039;&#039;&#039;intl&#039;&#039;&#039; is now required in Moodle 3.4 (previously it was only recommended).&lt;br /&gt;
&lt;br /&gt;
==Before upgrading==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We advise that you test the upgrade first on a COPY of your production site, to make sure it works as you expect.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider setting the [[Upgrade key|upgrade key]] for your site.&lt;br /&gt;
&lt;br /&gt;
== Backup important data ==&lt;br /&gt;
&lt;br /&gt;
There are three areas that should be backed up before any upgrade:&lt;br /&gt;
#Moodle software (For example, everything in server/htdocs/moodle)&lt;br /&gt;
#Moodle uploaded files (For example, server/moodledata)&lt;br /&gt;
#Moodle database (For example, your Postgres or MySQL database dump)&lt;br /&gt;
&lt;br /&gt;
See [[Site backup]] for more specific information.&lt;br /&gt;
&lt;br /&gt;
== Check for plugin updates ==&lt;br /&gt;
&lt;br /&gt;
If you have [[Automatic updates deployment]] enabled, you will be able to update installed plugins automatically during the upgrade. Just make sure you check for available updates (via the button for it) at the Plugins check screen.&lt;br /&gt;
&lt;br /&gt;
If you are updating plugins manually, it is a good moment now to check in the [http://moodle.org/plugins Moodle Plugins directory] whether there is a {{Version}} version available for any plugins (including themes) that you have previously installed on your site. If so, download the plugin package. In the next step, you will copy it to the appropriate location in your Moodle code (see [[Installing plugins]]).&lt;br /&gt;
&lt;br /&gt;
The upgrade of the plugin will then happen as part of the Moodle upgrade process.&lt;br /&gt;
&lt;br /&gt;
If an out-of-date plugin causes your upgrade to fail, you can usually delete the plugin code rather than uninstalling it from within Moodle so that the data associated with it is not deleted.&lt;br /&gt;
&lt;br /&gt;
==Put your site into maintenance mode==&lt;br /&gt;
Before you begin upgrading your site, you should put it into [[Maintenance_mode | maintenance mode]] to stop any non-admin users from logging in. Then you should wait for any currently running cron processes to complete before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Install the new Moodle software ==&lt;br /&gt;
You can fetch the current version of the software through &lt;br /&gt;
&lt;br /&gt;
wget http://sourceforge.net/projects/moodle/files/Moodle/stable{{Version2}}/moodle-latest-{{Version2}}.tgz&lt;br /&gt;
&lt;br /&gt;
=== Standard install package ===&lt;br /&gt;
&lt;br /&gt;
# Move your old Moodle software program files to another location. &#039;&#039;Do NOT copy new files over the old files.&#039;&#039;&lt;br /&gt;
# Unzip or unpack the upgrade file so that all the new Moodle software program files are in the location the old files used to be in on the server. Moodle will adjust SQL and moodledata if it needs to in the upgrade.&lt;br /&gt;
# Copy your old [[Configuration file|config.php file]] back to the new Moodle directory. &lt;br /&gt;
# As mentioned above, if you had installed any plugins on your site you should add them to the new code tree (Moodle directory structure) now. It is important to check that you get the correct version for your new version of Moodle. Be particularly careful that you do not overwrite any code in the new version of Moodle and that you place the plugin folders in the correct directory (the same directory that they are in in the current installation.)&lt;br /&gt;
# Your moodledata folder should be located separately to your Moodle code folder and, as such, should not need anything done to it.  Moodle 3.0 will throw a warning if it is located in a web accessible folder and the moodledata should never be located in the Moodle code folder.  If you are moving your installation to a new server or new location on your server, then you will need to follow the Migration documents.&lt;br /&gt;
&lt;br /&gt;
====Linux====&lt;br /&gt;
 mv moodle moodle.backup&lt;br /&gt;
 tar xvzf moodle-{{Version}}.tgz&lt;br /&gt;
&lt;br /&gt;
Next, copy across your config.php, any custom plugins, and your .htaccess file if you created one (&#039;&#039;&#039;check that custom plugins are the correct version for your new Moodle first&#039;&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
 cp moodle.backup/config.php moodle&lt;br /&gt;
 cp -pr moodle.backup/theme/mytheme moodle/theme/mytheme&lt;br /&gt;
 cp -pr moodle.backup/mod/mymod moodle/mod/mymod&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to make moodle/config.php (and the rest of the source code) readable by your www server. Ideally the files should not be writeable by your server.&lt;br /&gt;
&lt;br /&gt;
chown -R www-data:www-data moodle (Linux debian - change to appropriate user and group for your OS version)&lt;br /&gt;
chmod -R 755 moodle&lt;br /&gt;
&lt;br /&gt;
If you use cron, take care that cron.php is executeable and uses the correct php command: &lt;br /&gt;
 chmod 740 admin/cli/cron.php (some configurations need chmod 750 or chmod 755)&lt;br /&gt;
 copy the first line from cron.php (if it looks like &#039;#!/usr/local/bin/php&#039; or &#039;#!/usr/local/bin/php5.3&#039;, no need to copy &#039;&amp;lt;?php&#039;) &lt;br /&gt;
if necessary.  However, for a simple upgrade, there should be no need to change anything with cron.&lt;br /&gt;
&lt;br /&gt;
=== Using Git ===&lt;br /&gt;
&lt;br /&gt;
You can use Git for updating or upgrading your Moodle. See [[Git for Administrators]] for details.&lt;br /&gt;
&lt;br /&gt;
===Command line upgrade===&lt;br /&gt;
&lt;br /&gt;
On Linux servers, Moodle {{Version}} supports running the [[CLI|upgrade from the command line]], rather than through a web browser. This is likely to be more reliable, particularly for large sites.&lt;br /&gt;
&lt;br /&gt;
== Finishing the upgrade ==&lt;br /&gt;
&lt;br /&gt;
The last step is to trigger the upgrade processes within Moodle. &lt;br /&gt;
&lt;br /&gt;
If you put your site into Maintenance mode earlier; take it out now!&lt;br /&gt;
&lt;br /&gt;
To do this just go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Notifications&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Moodle will automatically detect the new version and perform all the SQL database or file system upgrades that are necessary. If there is anything it can&#039;t do itself (very rare) then you will see messages telling you what you need to do.&lt;br /&gt;
&lt;br /&gt;
Assuming all goes well (no error messages) then you can start using your new version of Moodle and enjoy the new features!&lt;br /&gt;
&lt;br /&gt;
Note: If you are running multiple servers then you should purge all caches manually (via &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Development &amp;gt; Purge all caches&#039;&#039;) after completing the upgrade on all servers.&lt;br /&gt;
&lt;br /&gt;
===Fatal error: Maximum execution time of 30 seconds exceeded...===&lt;br /&gt;
&lt;br /&gt;
If your server uses a main language other than English, you may encounter a &#039;Fatal error: Maximum execution time of 30 seconds exceeded&#039; when you try to upgrade it. You can increase max_execution_time = 160 on php.ini to allow the scripts enough time to process the language update. Otherwise, you can switch to English as the default language before doing the upgrade and back to your original language after a succcessful upgrade. See the forum discussion at https://moodle.org/mod/forum/discuss.php?d=119598.&lt;br /&gt;
&lt;br /&gt;
==After upgrading==&lt;br /&gt;
&lt;br /&gt;
The config.php file from your installation should work fine but if you take a look at config-dist.php that came with Moodle 3.0 there are more/different options available (e.g. database drivers and settings). It&#039;s a good idea to map your old config.php settings to a new one based on the 3.0 config-dist.php.&lt;br /&gt;
&lt;br /&gt;
===Cron===&lt;br /&gt;
&lt;br /&gt;
Cron has received a major update (MDL-25499) and now has support for both scheduled and ad hoc tasks.&lt;br /&gt;
&lt;br /&gt;
The benefits of these changes are:&lt;br /&gt;
* The schedule for every task can be configured by the admin&lt;br /&gt;
* Tasks can run in parallel&lt;br /&gt;
* Cron processes use locking to prevent the same task running at the same time by different processes&lt;br /&gt;
* Clusters with multiple identical application nodes are supported, you can run cron on all of them&lt;br /&gt;
&lt;br /&gt;
A result of this is that cron can be run much more often, which means (for example) forum posts can be sent out sooner.  To take advantage of the new cron system it is now strongly recommended that administrators increase the frequency that cron is run to at least &#039;&#039;once per minute&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You also may need to modify any automated scripts you have that are parsing the output from cron. It is no longer possible to simply monitor the output of cron for the string &amp;quot;Cron script completed correctly&amp;quot; (if that is what you were doing). An alternative is to monitor the output for the string &amp;quot;task failed:&amp;quot;. If you detect that a task is failing, [[Cron#Debugging_Scheduled_Tasks|here]] are some tips for debugging the failure. &lt;br /&gt;
&lt;br /&gt;
Before the upgrade, there may have been a cron task that was failing, which was preventing the rest of cron from being executed. A failure in any single task will no longer prevent the rest of the Moodle cron tasks from executing, so you may uncover previously masked bugs. It is a good idea to closely monitor the output from cron after the upgrade.&lt;br /&gt;
&lt;br /&gt;
===Assignments===&lt;br /&gt;
&lt;br /&gt;
The old assignment (2.2) module has been removed from core and has been replaced by a stub to support transparently remapping URLs and restoring course backups from the old module to the new one. &lt;br /&gt;
&lt;br /&gt;
If you are still using the old assignment (2.2) module, after upgrading to Moodle 3.0 all assignment (2.2) activities will be hidden. You need to run the [[Assignment upgrade tool]] to un-hide the activities.&lt;br /&gt;
&lt;br /&gt;
If you really, really need to keep using the old assignment (2.2) module, you should update the code to Moodle 3.0, and then replace the &amp;quot;mod/assignment&amp;quot; folder with the one from https://github.com/moodlehq/moodle-mod_assignment/releases before completing the upgrade.&lt;br /&gt;
&lt;br /&gt;
==Possible issues that may affect you in Moodle {{Version}}==&lt;br /&gt;
&lt;br /&gt;
* &#039;Site policies&#039; in the Site administration has been renamed &#039;[[Site security settings]]&#039;.&lt;br /&gt;
&lt;br /&gt;
* Moodle presets have changed. Most of the Bootstrap 4 variables have changed and the way bootstrap, font awesome and core scss is included. For more info on the Bootstrap 4 changes visit https://getbootstrap.com/docs/4.0/migration/&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Example code, place scss variables here.&lt;br /&gt;
// $font-size-base: 0.9375rem&lt;br /&gt;
&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Example code, place scss using Bootstrap mixins and extends here.&lt;br /&gt;
// .navbar {&lt;br /&gt;
//   @include shadow();&lt;br /&gt;
// }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The PostgreSQL driver has been improved and, now, the &amp;lt;tt&amp;gt;get_recordset_xxx()&amp;lt;/tt&amp;gt; operations don&#039;t fetch all the records into memory for big (&amp;gt;100000) datasets. This can be configured or disabled using the new &amp;lt;tt&amp;gt;fetchbuffersize&amp;lt;/tt&amp;gt; [https://github.com/moodle/moodle/blob/f61ee4e857a894a5b8b69516b00be88ae499964b/config-dist.php#L73 dboption]. Note this is known to affect installations using pg_bouncer in transaction mode. See MDL-60174 for more information.&lt;br /&gt;
&lt;br /&gt;
See also the list of [https://tracker.moodle.org/issues/?jql=project%20%3D%20mdl%20AND%20resolution%20%3D%20fixed%20AND%20fixVersion%20in%20(%223.5%22)%20AND%20labels%20%3D%20ui_change%20 issues fixed in Moodle 3.5 which are labelled ui_change]. &lt;br /&gt;
&lt;br /&gt;
=== Moodle 3.1, 3.2, 3.3 and 3.4 improvements ===&lt;br /&gt;
&lt;br /&gt;
Depending on which version you are upgrading from, please see the section &#039;Possible issues that may affect you&#039; in the documentation&lt;br /&gt;
&lt;br /&gt;
* [https://docs.moodle.org/31/en/Upgrading Upgrading to Moodle 3.1]&lt;br /&gt;
* [https://docs.moodle.org/32/en/Upgrading Upgrading to Moodle 3.2]&lt;br /&gt;
* [https://docs.moodle.org/33/en/Upgrading Upgrading to Moodle 3.3]&lt;br /&gt;
* [https://docs.moodle.org/34/en/Upgrading Upgrading to Moodle 3.4]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation help forum] &lt;br /&gt;
* [[dev:Moodle {{Version}} release notes|Moodle {{Version}} release notes]]&lt;br /&gt;
&lt;br /&gt;
[[es:Actualización de moodle]]&lt;br /&gt;
[[fr:Mise à jour]]&lt;br /&gt;
[[ja:Moodleをアップグレードする]]&lt;br /&gt;
[[de:Aktualisierung von Moodle]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Complete_install_packages_for_Windows&amp;diff=131076</id>
		<title>Complete install packages for Windows</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Complete_install_packages_for_Windows&amp;diff=131076"/>
		<updated>2018-05-19T18:50:12Z</updated>

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

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

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

		<summary type="html">&lt;p&gt;Stronk7: Stronk7 moved page admin/environment/custom check/check is https to admin/environment/custom check/site not https without leaving a redirect: because I&amp;#039;ve changed the name of the environment check in MDL-54901&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#Redirect[[Transitioning to HTTPS]]&lt;br /&gt;
&lt;br /&gt;
[[es:HTTPS]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=admin/environment/custom_check/site_not_https&amp;diff=127403</id>
		<title>admin/environment/custom check/site not https</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=admin/environment/custom_check/site_not_https&amp;diff=127403"/>
		<updated>2017-04-17T12:10:52Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: WIP on https://tracker.moodle.org/browse/MDL-54901 ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#Redirect[[Transitioning to HTTPS]]&lt;br /&gt;
&lt;br /&gt;
[[es:HTTPS]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=admin/environment/custom_check/check_ssl_wwwroot&amp;diff=127402</id>
		<title>admin/environment/custom check/check ssl wwwroot</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=admin/environment/custom_check/check_ssl_wwwroot&amp;diff=127402"/>
		<updated>2017-04-17T11:57:34Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: I really think that HTTPS was a better target, but as far as we have wgMaxRedirects = 1, cannot get multiple redirects working, it seems. So straight redirecting here.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#Redirect[[Transitioning to HTTPS]]&lt;br /&gt;
&lt;br /&gt;
[[es:HTTPS]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=admin/environment/custom_check/check_ssl_wwwroot&amp;diff=127401</id>
		<title>admin/environment/custom check/check ssl wwwroot</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=admin/environment/custom_check/check_ssl_wwwroot&amp;diff=127401"/>
		<updated>2017-04-17T11:51:19Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Working on MDL-54901 ... testing ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#Redirect[[HTTPS]]&lt;br /&gt;
&lt;br /&gt;
[[es:HTTPS]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Complete_install_packages_for_Windows&amp;diff=125450</id>
		<title>Complete install packages for Windows</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Complete_install_packages_for_Windows&amp;diff=125450"/>
		<updated>2016-09-27T10:08:25Z</updated>

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

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

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

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

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

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

		<summary type="html">&lt;p&gt;Stronk7: Added note about PHP 7 and this driver status.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 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;
Some of this may also apply if you wish to access an MSSQL server for external db authentication/enrollment. &lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9).&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;
&amp;lt;span id=&amp;quot;Configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;4. Configure these settings in your created (and still empty) database:&lt;br /&gt;
Configure these settings in your created (and still empty) database:&lt;br /&gt;
:*Use a case sensitive collation, such as Latin1_General_CS_AS.&lt;br /&gt;
:*ANSI NULLS Enabled = True (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:*Quoted Identifiers Enabled = True (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:*Is Read Committed transaction ON = True (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
:** In older versions this is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the &amp;quot;Object Explorer&amp;quot; (right-click &amp;gt; Disconnect), then create a &amp;quot;New Query&amp;quot; and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.&lt;br /&gt;
:** If your DB name starts with a number, you may need to put quotes around the DB name in the query.&lt;br /&gt;
&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;
&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;
== Microsoft Drivers for SQL Server for PHP ==&lt;br /&gt;
&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] a new SQL Server Driver for PHP. This is a PHP extension that allows PHP scripts to read and write data on Microsoft SQL Server databases and it overcomes the problems with the native SQL Server extension that was previously bundled with PHP.&lt;br /&gt;
&lt;br /&gt;
When using [[IIS]] it is strongly recommended to use the official Microsoft PHP installer from http://php.iis.net/, it should include the latest version of necessary drivers and it also simplifies future upgrades and configuration.&lt;br /&gt;
&lt;br /&gt;
For Windows servers with [[Apache]] see http://www.microsoft.com/en-us/download/details.aspx?id=20098.&lt;br /&gt;
&lt;br /&gt;
To know more about how to run Moodle with these drivers go to [[Using the Microsoft SQL Server Driver for PHP]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&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 some previous bugs it&#039;s highly recommendable to use PHP &amp;gt;= 5.2.6 and FreeTDS 0.82 + post-release patches ([http://tracker.moodle.org/browse/MDL-14725 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Important Note 2:&#039;&#039;&#039; PHP 7 and following do not support the php_mssql driver [http://php.net/manual/en/intro.mssql.php anymore]. People wanting to use SQL*Server database services should switch to the [[Using_the_Microsoft_SQL_Server_Driver_for_PHP|sqlsrv drivers]] in the platforms were they are available or keep using PHP 5.6.x&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039;. Despite the name, it&#039;s FreeTDS compiled for Windows. (Go to this page for information on [https://docs.moodle.org/en/FreeTDS Using FreeTDS for Unix].) &lt;br /&gt;
&lt;br /&gt;
Originally we were using the DLLs available at [http://kromann.info/article.php?Id=11062598797760000 Frank Kromann&#039;s site], but they are outdated (using old versions of FreeTDS) and that has caused [http://tracker.moodle.org/browse/MDL-14725 some problems] in the past.&lt;br /&gt;
&lt;br /&gt;
So, right now, the recommended way to use FreeTDS under Windows is to use PHP 5.2.x following the following instructions:&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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;table table-striped table-bordered&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP version !! [http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries Thread Safe]  !! FreeTDS version !! Download URL&lt;br /&gt;
|-&lt;br /&gt;
| PHP 5.6.x (vc11-unkown architecture) || Both || 0.95 || You can find some (unverified/untested) drivers in [https://moodle.org/mod/forum/discuss.php?d=232844#p1297504 this forum post], courtesy of Josh Urbain.&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |  Thanks to [http://remote-learner.net/ Remote-Learner]] (Moodle [http://moodle.com/partners/ Partner]) and specially to Bryan Williams, donating one Visual C++ 6.0 Pro license to Moodle. Thanks to Trevor Johnson and his builds of the dblib extensions. Thanks to Daniele, Doug, Luis, Sean and many others by their collaboration in MDL-14725. Thanks to Frediano Ziglio and James K. Lowden from [http://freetds.org freetds.org] by their support. Thanks to [[User:Alastair Hole|Alastair Hole]] and Matt Rusiniak for providing the PHP 5.3 builds of the libraries. Thanks to Enyby by providing the PHP 5.4 builds of the libraries. Thanks to David Aylmer and Matt Rusiniak for providing the PHP 5.5 builds of the libraries. Thanks!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For versions of the DLLs working with older PHP engines, you can visit [https://docs.moodle.org/30/en/Installing_MSSQL_for_PHP this page for previous Moodle releases].&lt;br /&gt;
&lt;br /&gt;
(alternatively here you can find some [[Development:Compiling FreeTDS under Windows|instructions to build those freetds extensions under win32]] yourself).&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. When the PHP engine loads the FreeTDS extension it needs to be passed certain infiormation in order to be able to connect to your Moodle database. To retrieve this information FreeTDS looks for a file called &#039;&#039;&#039;freetds.conf&#039;&#039;&#039; in the root folder of the server that PHP installed on (e.g. C:\).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;freetds.conf&#039;&#039;&#039; should have the following structure:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to connect to a particular [http://msdn.microsoft.com/en-us/library/aa174516(SQL.80).aspx instance] of MSSQL you should specify the instance name:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      instance = xxx (instance name, e.g. INST2)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
*You can configure FreeTDS to look for the freetds.conf file in any directory that you want - you don&#039;t have to use C:\. To do this create a SYSTEM environment variable called &#039;&#039;&#039;FREETDS&#039;&#039;&#039; and point it to the directory where you have installed the freetds.conf file. If you do not set this environment variable FreeTDS will look for the freetds.conf file in the C:\ folder, which is the default. One possible benefit of setting the FREETDS environment variable and using a different installation directory for freetds.conf is that C:\ is very predictable to a hacker that knows anything about FreeTDS and that is the first place that he would look if he wanted to compromise your system. So, using a different installation directory would just make your system stronger. See the FreeTDS [http://www.freetds.org/userguide/envvar.htm Setting the environment variables] documentation for more information about this FREETDS environment variable.&lt;br /&gt;
&lt;br /&gt;
*Alternatively, you can [[Development:Compiling FreeTDS under Windows|recompile]] the FreeTDS extension yourself and change the default location to your preferred location at compile time. Then it is not necessary to create any environment variable. You must just ensure that freetds.conf is in the same folder that you specify when you compile php_dblib.dll.&lt;br /&gt;
&lt;br /&gt;
*MSSQL is usually installed with port 1433 as the default. However, if the port was changed on your server when you installed MSSQL then you need to specify the correct port number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;mssql&#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 NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;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. Alternatively you can use the config-dist.php file that comes with the Moodle package to create your own config.php file.&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. Database conection test, try this PHP script, just put in a text file called test.php change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to suite your setup, and load from local host (http://localhost/test.php)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	$link = mssql_connect(&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;);&lt;br /&gt;
	if(!$link) {&lt;br /&gt;
		echo&#039;Could not connect&#039;;&lt;br /&gt;
		die(&#039;Could not connect: &#039; . mssql_error());&lt;br /&gt;
	}&lt;br /&gt;
	echo&#039;Successful connection&#039;;&lt;br /&gt;
	mssql_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
If you encounter some problems you can try:&lt;br /&gt;
*check that you have DotNet framework 1.1 installed (later version are installed on Vista, but you could need this specific one)&amp;lt;br /&amp;gt;&lt;br /&gt;
*enable TCP/IP for MSSQL: SQL Server 2005 Network Configuration -&amp;gt; Protocols for MSSQLSERVER -&amp;gt; TCP/IP (Enable) -&amp;gt; Properties -&amp;gt; Ip Addresses -&amp;gt; 127.0.0.1 (Active+Enable)&amp;lt;br /&amp;gt;&lt;br /&gt;
*make sure the SQL Server Browser service is running SQL Server 2005 Network Configuration -&amp;gt; SQL Server Services&amp;lt;br /&amp;gt;&lt;br /&gt;
*if you are using SQL Server 2005 and you have the error &#039;&#039;4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier&#039;&#039;, try the ODBTP method (next chapter). The SQL Server complaining that it doesn&#039;t support pure Unicode via TDS or older versions of ODBC. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren&#039;t accessible via DB-Library so if you need them, you could have to switch away from tools based on TDS and DB-Library :(&lt;br /&gt;
&lt;br /&gt;
== FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) ==&lt;br /&gt;
This is a good read to [http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/ building a FreeTDS based mssql extension for apache on Ubuntu]. Do note that [http://www.freetds.org/news.html freeTDS] 0.91 was recently released, you can find latest versions [http://freetds.sourceforge.net/ here]. &lt;br /&gt;
&lt;br /&gt;
Note: the freetds.conf file you use should have &amp;quot;text size = 20971520&amp;quot; as mentioned in the FreeTDS on Windows section otherwise you might see sessions logging out or worse apache segmentation faults. Also see [[FreeTDS]].&lt;br /&gt;
&lt;br /&gt;
Note2: Please note that updating php tends to remove the freetds configurations. You might need to reconfigure freetds after an upgrade&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Debian Lenny ==&lt;br /&gt;
I found the following solution using:&lt;br /&gt;
* PHP Version 5.2.6-1+lenny9&lt;br /&gt;
* Microsoft SQL Server Enterprise Edition, version: 9.00.4053.00&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install libsybdb5 freetds-common php5-sybase&lt;br /&gt;
/etc/init.d/apache2 restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the end of the process, if all goes fine, you will find in the mssql section of phpinfo();&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MSSQL Support&lt;br /&gt;
! enabled&lt;br /&gt;
|-&lt;br /&gt;
| Library version &lt;br /&gt;
| FreeTDS &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once FreeTDS is correctly installed, don not forget to set it up following explanations in https://docs.moodle.org/en/FreeTDS&lt;br /&gt;
&lt;br /&gt;
== See also ==&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:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;br /&gt;
[[Category:SQL databases]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=125315</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=125315"/>
		<updated>2016-09-14T09:27:13Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: typo!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 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;
Some of this may also apply if you wish to access an MSSQL server for external db authentication/enrollment. &lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9).&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;
&amp;lt;span id=&amp;quot;Configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;4. Configure these settings in your created (and still empty) database:&lt;br /&gt;
Configure these settings in your created (and still empty) database:&lt;br /&gt;
:*Use a case sensitive collation, such as Latin1_General_CS_AS.&lt;br /&gt;
:*ANSI NULLS Enabled = True (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:*Quoted Identifiers Enabled = True (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:*Is Read Committed transaction ON = True (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
:** In older versions this is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the &amp;quot;Object Explorer&amp;quot; (right-click &amp;gt; Disconnect), then create a &amp;quot;New Query&amp;quot; and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.&lt;br /&gt;
:** If your DB name starts with a number, you may need to put quotes around the DB name in the query.&lt;br /&gt;
&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;
&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;
== Microsoft Drivers for SQL Server for PHP ==&lt;br /&gt;
&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] a new SQL Server Driver for PHP. This is a PHP extension that allows PHP scripts to read and write data on Microsoft SQL Server databases and it overcomes the problems with the native SQL Server extension that was previously bundled with PHP.&lt;br /&gt;
&lt;br /&gt;
When using [[IIS]] it is strongly recommended to use the official Microsoft PHP installer from http://php.iis.net/, it should include the latest version of necessary drivers and it also simplifies future upgrades and configuration.&lt;br /&gt;
&lt;br /&gt;
For Windows servers with [[Apache]] see http://www.microsoft.com/en-us/download/details.aspx?id=20098.&lt;br /&gt;
&lt;br /&gt;
To know more about how to run Moodle with these drivers go to [[Using the Microsoft SQL Server Driver for PHP]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&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 some previous bugs it&#039;s highly recommendable to use PHP &amp;gt;= 5.2.6 and FreeTDS 0.82 + post-release patches ([http://tracker.moodle.org/browse/MDL-14725 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039;. Despite the name, it&#039;s FreeTDS compiled for Windows. (Go to this page for information on [https://docs.moodle.org/en/FreeTDS Using FreeTDS for Unix].) &lt;br /&gt;
&lt;br /&gt;
Originally we were using the DLLs available at [http://kromann.info/article.php?Id=11062598797760000 Frank Kromann&#039;s site], but they are outdated (using old versions of FreeTDS) and that has caused [http://tracker.moodle.org/browse/MDL-14725 some problems] in the past.&lt;br /&gt;
&lt;br /&gt;
So, right now, the recommended way to use FreeTDS under Windows is to use PHP 5.2.x following the following instructions:&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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;table table-striped table-bordered&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP version !! [http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries Thread Safe]  !! FreeTDS version !! Download URL&lt;br /&gt;
|-&lt;br /&gt;
| PHP 5.6.x (vc11-unkown architecture) || Both || 0.95 || You can find some (unverified/untested) drivers in [https://moodle.org/mod/forum/discuss.php?d=232844#p1297504 this forum post], courtesy of Josh Urbain.&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |  Thanks to [http://remote-learner.net/ Remote-Learner]] (Moodle [http://moodle.com/partners/ Partner]) and specially to Bryan Williams, donating one Visual C++ 6.0 Pro license to Moodle. Thanks to Trevor Johnson and his builds of the dblib extensions. Thanks to Daniele, Doug, Luis, Sean and many others by their collaboration in MDL-14725. Thanks to Frediano Ziglio and James K. Lowden from [http://freetds.org freetds.org] by their support. Thanks to [[User:Alastair Hole|Alastair Hole]] and Matt Rusiniak for providing the PHP 5.3 builds of the libraries. Thanks to Enyby by providing the PHP 5.4 builds of the libraries. Thanks to David Aylmer and Matt Rusiniak for providing the PHP 5.5 builds of the libraries. Thanks!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For versions of the DLLs working with older PHP engines, you can visit [https://docs.moodle.org/30/en/Installing_MSSQL_for_PHP this page for previous Moodle releases].&lt;br /&gt;
&lt;br /&gt;
(alternatively here you can find some [[Development:Compiling FreeTDS under Windows|instructions to build those freetds extensions under win32]] yourself).&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. When the PHP engine loads the FreeTDS extension it needs to be passed certain infiormation in order to be able to connect to your Moodle database. To retrieve this information FreeTDS looks for a file called &#039;&#039;&#039;freetds.conf&#039;&#039;&#039; in the root folder of the server that PHP installed on (e.g. C:\).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;freetds.conf&#039;&#039;&#039; should have the following structure:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to connect to a particular [http://msdn.microsoft.com/en-us/library/aa174516(SQL.80).aspx instance] of MSSQL you should specify the instance name:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      instance = xxx (instance name, e.g. INST2)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
*You can configure FreeTDS to look for the freetds.conf file in any directory that you want - you don&#039;t have to use C:\. To do this create a SYSTEM environment variable called &#039;&#039;&#039;FREETDS&#039;&#039;&#039; and point it to the directory where you have installed the freetds.conf file. If you do not set this environment variable FreeTDS will look for the freetds.conf file in the C:\ folder, which is the default. One possible benefit of setting the FREETDS environment variable and using a different installation directory for freetds.conf is that C:\ is very predictable to a hacker that knows anything about FreeTDS and that is the first place that he would look if he wanted to compromise your system. So, using a different installation directory would just make your system stronger. See the FreeTDS [http://www.freetds.org/userguide/envvar.htm Setting the environment variables] documentation for more information about this FREETDS environment variable.&lt;br /&gt;
&lt;br /&gt;
*Alternatively, you can [[Development:Compiling FreeTDS under Windows|recompile]] the FreeTDS extension yourself and change the default location to your preferred location at compile time. Then it is not necessary to create any environment variable. You must just ensure that freetds.conf is in the same folder that you specify when you compile php_dblib.dll.&lt;br /&gt;
&lt;br /&gt;
*MSSQL is usually installed with port 1433 as the default. However, if the port was changed on your server when you installed MSSQL then you need to specify the correct port number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;mssql&#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 NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;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. Alternatively you can use the config-dist.php file that comes with the Moodle package to create your own config.php file.&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. Database conection test, try this PHP script, just put in a text file called test.php change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to suite your setup, and load from local host (http://localhost/test.php)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	$link = mssql_connect(&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;);&lt;br /&gt;
	if(!$link) {&lt;br /&gt;
		echo&#039;Could not connect&#039;;&lt;br /&gt;
		die(&#039;Could not connect: &#039; . mssql_error());&lt;br /&gt;
	}&lt;br /&gt;
	echo&#039;Successful connection&#039;;&lt;br /&gt;
	mssql_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
If you encounter some problems you can try:&lt;br /&gt;
*check that you have DotNet framework 1.1 installed (later version are installed on Vista, but you could need this specific one)&amp;lt;br /&amp;gt;&lt;br /&gt;
*enable TCP/IP for MSSQL: SQL Server 2005 Network Configuration -&amp;gt; Protocols for MSSQLSERVER -&amp;gt; TCP/IP (Enable) -&amp;gt; Properties -&amp;gt; Ip Addresses -&amp;gt; 127.0.0.1 (Active+Enable)&amp;lt;br /&amp;gt;&lt;br /&gt;
*make sure the SQL Server Browser service is running SQL Server 2005 Network Configuration -&amp;gt; SQL Server Services&amp;lt;br /&amp;gt;&lt;br /&gt;
*if you are using SQL Server 2005 and you have the error &#039;&#039;4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier&#039;&#039;, try the ODBTP method (next chapter). The SQL Server complaining that it doesn&#039;t support pure Unicode via TDS or older versions of ODBC. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren&#039;t accessible via DB-Library so if you need them, you could have to switch away from tools based on TDS and DB-Library :(&lt;br /&gt;
&lt;br /&gt;
== FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) ==&lt;br /&gt;
This is a good read to [http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/ building a FreeTDS based mssql extension for apache on Ubuntu]. Do note that [http://www.freetds.org/news.html freeTDS] 0.91 was recently released, you can find latest versions [http://freetds.sourceforge.net/ here]. &lt;br /&gt;
&lt;br /&gt;
Note: the freetds.conf file you use should have &amp;quot;text size = 20971520&amp;quot; as mentioned in the FreeTDS on Windows section otherwise you might see sessions logging out or worse apache segmentation faults. Also see [[FreeTDS]].&lt;br /&gt;
&lt;br /&gt;
Note2: Please note that updating php tends to remove the freetds configurations. You might need to reconfigure freetds after an upgrade&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Debian Lenny ==&lt;br /&gt;
I found the following solution using:&lt;br /&gt;
* PHP Version 5.2.6-1+lenny9&lt;br /&gt;
* Microsoft SQL Server Enterprise Edition, version: 9.00.4053.00&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install libsybdb5 freetds-common php5-sybase&lt;br /&gt;
/etc/init.d/apache2 restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the end of the process, if all goes fine, you will find in the mssql section of phpinfo();&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MSSQL Support&lt;br /&gt;
! enabled&lt;br /&gt;
|-&lt;br /&gt;
| Library version &lt;br /&gt;
| FreeTDS &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once FreeTDS is correctly installed, don not forget to set it up following explanations in https://docs.moodle.org/en/FreeTDS&lt;br /&gt;
&lt;br /&gt;
== See also ==&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:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;br /&gt;
[[Category:SQL databases]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=125314</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=125314"/>
		<updated>2016-09-14T09:24:39Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Adding a link to previous docs (3.0) were the links to older extensions are available. People really downloads them.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 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;
Some of this may also apply if you wish to access an MSSQL server for external db authentication/enrollment. &lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9).&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;
&amp;lt;span id=&amp;quot;Configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;4. Configure these settings in your created (and still empty) database:&lt;br /&gt;
Configure these settings in your created (and still empty) database:&lt;br /&gt;
:*Use a case sensitive collation, such as Latin1_General_CS_AS.&lt;br /&gt;
:*ANSI NULLS Enabled = True (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:*Quoted Identifiers Enabled = True (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:*Is Read Committed transaction ON = True (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
:** In older versions this is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the &amp;quot;Object Explorer&amp;quot; (right-click &amp;gt; Disconnect), then create a &amp;quot;New Query&amp;quot; and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.&lt;br /&gt;
:** If your DB name starts with a number, you may need to put quotes around the DB name in the query.&lt;br /&gt;
&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;
&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;
== Microsoft Drivers for SQL Server for PHP ==&lt;br /&gt;
&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] a new SQL Server Driver for PHP. This is a PHP extension that allows PHP scripts to read and write data on Microsoft SQL Server databases and it overcomes the problems with the native SQL Server extension that was previously bundled with PHP.&lt;br /&gt;
&lt;br /&gt;
When using [[IIS]] it is strongly recommended to use the official Microsoft PHP installer from http://php.iis.net/, it should include the latest version of necessary drivers and it also simplifies future upgrades and configuration.&lt;br /&gt;
&lt;br /&gt;
For Windows servers with [[Apache]] see http://www.microsoft.com/en-us/download/details.aspx?id=20098.&lt;br /&gt;
&lt;br /&gt;
To know more about how to run Moodle with these drivers go to [[Using the Microsoft SQL Server Driver for PHP]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&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 some previous bugs it&#039;s highly recommendable to use PHP &amp;gt;= 5.2.6 and FreeTDS 0.82 + post-release patches ([http://tracker.moodle.org/browse/MDL-14725 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039;. Despite the name, it&#039;s FreeTDS compiled for Windows. (Go to this page for information on [https://docs.moodle.org/en/FreeTDS Using FreeTDS for Unix].) &lt;br /&gt;
&lt;br /&gt;
Originally we were using the DLLs available at [http://kromann.info/article.php?Id=11062598797760000 Frank Kromann&#039;s site], but they are outdated (using old versions of FreeTDS) and that has caused [http://tracker.moodle.org/browse/MDL-14725 some problems] in the past.&lt;br /&gt;
&lt;br /&gt;
So, right now, the recommended way to use FreeTDS under Windows is to use PHP 5.2.x following the following instructions:&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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;table table-striped table-bordered&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP version !! [http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries Thread Safe]  !! FreeTDS version !! Download URL&lt;br /&gt;
|-&lt;br /&gt;
| PHP 5.6.x (vc11-unkown architecture) || Both || 0.95 || You can find some (unverified/untested) drivers in [https://moodle.org/mod/forum/discuss.php?d=232844#p1297504 this forum post], courtesy of Josh Urbain.&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |  Thanks to [http://remote-learner.net/ Remote-Learner]] (Moodle [http://moodle.com/partners/ Partner]) and specially to Bryan Williams, donating one Visual C++ 6.0 Pro license to Moodle. Thanks to Trevor Johnson and his builds of the dblib extensions. Thanks to Daniele, Doug, Luis, Sean and many others by their collaboration in MDL-14725. Thanks to Frediano Ziglio and James K. Lowden from [http://freetds.org freetds.org] by their support. Thanks to [[User:Alastair Hole|Alastair Hole]] and Matt Rusiniak for providing the PHP 5.3 builds of the libraries. Thanks to Enyby by providing the PHP 5.4 builds of the libraries. Thanks to David Aylmer and Matt Rusiniak for providing the PHP 5.5 builds of the libraries. Thanks!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For versions of the DLLs working with older PHP engines, you can visit [https://docs.moodle.org/30/en/Installing_MSSQL_for_PHP this page for previous Moodle relases].&lt;br /&gt;
&lt;br /&gt;
(alternatively here you can find some [[Development:Compiling FreeTDS under Windows|instructions to build those freetds extensions under win32]] yourself).&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. When the PHP engine loads the FreeTDS extension it needs to be passed certain infiormation in order to be able to connect to your Moodle database. To retrieve this information FreeTDS looks for a file called &#039;&#039;&#039;freetds.conf&#039;&#039;&#039; in the root folder of the server that PHP installed on (e.g. C:\).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;freetds.conf&#039;&#039;&#039; should have the following structure:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to connect to a particular [http://msdn.microsoft.com/en-us/library/aa174516(SQL.80).aspx instance] of MSSQL you should specify the instance name:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      instance = xxx (instance name, e.g. INST2)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
*You can configure FreeTDS to look for the freetds.conf file in any directory that you want - you don&#039;t have to use C:\. To do this create a SYSTEM environment variable called &#039;&#039;&#039;FREETDS&#039;&#039;&#039; and point it to the directory where you have installed the freetds.conf file. If you do not set this environment variable FreeTDS will look for the freetds.conf file in the C:\ folder, which is the default. One possible benefit of setting the FREETDS environment variable and using a different installation directory for freetds.conf is that C:\ is very predictable to a hacker that knows anything about FreeTDS and that is the first place that he would look if he wanted to compromise your system. So, using a different installation directory would just make your system stronger. See the FreeTDS [http://www.freetds.org/userguide/envvar.htm Setting the environment variables] documentation for more information about this FREETDS environment variable.&lt;br /&gt;
&lt;br /&gt;
*Alternatively, you can [[Development:Compiling FreeTDS under Windows|recompile]] the FreeTDS extension yourself and change the default location to your preferred location at compile time. Then it is not necessary to create any environment variable. You must just ensure that freetds.conf is in the same folder that you specify when you compile php_dblib.dll.&lt;br /&gt;
&lt;br /&gt;
*MSSQL is usually installed with port 1433 as the default. However, if the port was changed on your server when you installed MSSQL then you need to specify the correct port number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;mssql&#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 NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;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. Alternatively you can use the config-dist.php file that comes with the Moodle package to create your own config.php file.&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. Database conection test, try this PHP script, just put in a text file called test.php change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to suite your setup, and load from local host (http://localhost/test.php)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	$link = mssql_connect(&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;);&lt;br /&gt;
	if(!$link) {&lt;br /&gt;
		echo&#039;Could not connect&#039;;&lt;br /&gt;
		die(&#039;Could not connect: &#039; . mssql_error());&lt;br /&gt;
	}&lt;br /&gt;
	echo&#039;Successful connection&#039;;&lt;br /&gt;
	mssql_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
If you encounter some problems you can try:&lt;br /&gt;
*check that you have DotNet framework 1.1 installed (later version are installed on Vista, but you could need this specific one)&amp;lt;br /&amp;gt;&lt;br /&gt;
*enable TCP/IP for MSSQL: SQL Server 2005 Network Configuration -&amp;gt; Protocols for MSSQLSERVER -&amp;gt; TCP/IP (Enable) -&amp;gt; Properties -&amp;gt; Ip Addresses -&amp;gt; 127.0.0.1 (Active+Enable)&amp;lt;br /&amp;gt;&lt;br /&gt;
*make sure the SQL Server Browser service is running SQL Server 2005 Network Configuration -&amp;gt; SQL Server Services&amp;lt;br /&amp;gt;&lt;br /&gt;
*if you are using SQL Server 2005 and you have the error &#039;&#039;4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier&#039;&#039;, try the ODBTP method (next chapter). The SQL Server complaining that it doesn&#039;t support pure Unicode via TDS or older versions of ODBC. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren&#039;t accessible via DB-Library so if you need them, you could have to switch away from tools based on TDS and DB-Library :(&lt;br /&gt;
&lt;br /&gt;
== FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) ==&lt;br /&gt;
This is a good read to [http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/ building a FreeTDS based mssql extension for apache on Ubuntu]. Do note that [http://www.freetds.org/news.html freeTDS] 0.91 was recently released, you can find latest versions [http://freetds.sourceforge.net/ here]. &lt;br /&gt;
&lt;br /&gt;
Note: the freetds.conf file you use should have &amp;quot;text size = 20971520&amp;quot; as mentioned in the FreeTDS on Windows section otherwise you might see sessions logging out or worse apache segmentation faults. Also see [[FreeTDS]].&lt;br /&gt;
&lt;br /&gt;
Note2: Please note that updating php tends to remove the freetds configurations. You might need to reconfigure freetds after an upgrade&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Debian Lenny ==&lt;br /&gt;
I found the following solution using:&lt;br /&gt;
* PHP Version 5.2.6-1+lenny9&lt;br /&gt;
* Microsoft SQL Server Enterprise Edition, version: 9.00.4053.00&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install libsybdb5 freetds-common php5-sybase&lt;br /&gt;
/etc/init.d/apache2 restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the end of the process, if all goes fine, you will find in the mssql section of phpinfo();&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MSSQL Support&lt;br /&gt;
! enabled&lt;br /&gt;
|-&lt;br /&gt;
| Library version &lt;br /&gt;
| FreeTDS &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once FreeTDS is correctly installed, don not forget to set it up following explanations in https://docs.moodle.org/en/FreeTDS&lt;br /&gt;
&lt;br /&gt;
== See also ==&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:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;br /&gt;
[[Category:SQL databases]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Talk:PostgreSQL&amp;diff=124646</id>
		<title>Talk:PostgreSQL</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Talk:PostgreSQL&amp;diff=124646"/>
		<updated>2016-08-04T17:18:53Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Client Authentication Section ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve added a section called &#039;Client Authentication&#039; to the bottom of the page, with instructions on adding an entry to &#039;pg_hba.conf&#039;. I thought this was useful for people who aren&#039;t familiar with Postgres, as it will be an unfamiliar step to anyone with a background in MySQL.&lt;br /&gt;
&lt;br /&gt;
After six years of looking after Moodle with a MySQL setup, I had to set up my first PostgreSQL server yesterday, and this is something that stumped me for a while. If these instructions can save somebody else a bit of time, they&#039;re probably a good thing.&lt;br /&gt;
&lt;br /&gt;
--[[User:Alex Walker 2|Alex Walker 2]] ([[User talk:Alex Walker 2|talk]]) 18:16, 4 August 2016 (AWST)&lt;br /&gt;
&lt;br /&gt;
: Thanks Alex! --[[User:Eloy Lafuente (stronk7)|Eloy Lafuente (stronk7)]] ([[User talk:Eloy Lafuente (stronk7)|talk]]) 01:18, 5 August 2016 (AWST)&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=124401</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=124401"/>
		<updated>2016-07-25T15:46:39Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Adding PHP 5.6 mssql candidate module link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 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;
Some of this may also apply if you wish to access an MSSQL server for external db authentication/enrollment. &lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9).&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;
&amp;lt;span id=&amp;quot;Configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;4. Configure these settings in your created (and still empty) database:&lt;br /&gt;
Configure these settings in your created (and still empty) database:&lt;br /&gt;
:*Use a case sensitive collation, such as Latin1_General_CS_AS.&lt;br /&gt;
:*ANSI NULLS Enabled = True (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:*Quoted Identifiers Enabled = True (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:*Is Read Committed transaction ON = True (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
:** In older versions this is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the &amp;quot;Object Explorer&amp;quot; (right-click &amp;gt; Disconnect), then create a &amp;quot;New Query&amp;quot; and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.&lt;br /&gt;
:** If your DB name starts with a number, you may need to put quotes around the DB name in the query.&lt;br /&gt;
&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;
&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;
== Microsoft Drivers for SQL Server for PHP ==&lt;br /&gt;
&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] a new SQL Server Driver for PHP. This is a PHP extension that allows PHP scripts to read and write data on Microsoft SQL Server databases and it overcomes the problems with the native SQL Server extension that was previously bundled with PHP.&lt;br /&gt;
&lt;br /&gt;
When using [[IIS]] it is strongly recommended to use the official Microsoft PHP installer from http://php.iis.net/, it should include the latest version of necessary drivers and it also simplifies future upgrades and configuration.&lt;br /&gt;
&lt;br /&gt;
For Windows servers with [[Apache]] see http://www.microsoft.com/en-us/download/details.aspx?id=20098.&lt;br /&gt;
&lt;br /&gt;
To know more about how to run Moodle with these drivers go to [[Using the Microsoft SQL Server Driver for PHP]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&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 some previous bugs it&#039;s highly recommendable to use PHP &amp;gt;= 5.2.6 and FreeTDS 0.82 + post-release patches ([http://tracker.moodle.org/browse/MDL-14725 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039;. Despite the name, it&#039;s FreeTDS compiled for Windows. (Go to this page for information on [https://docs.moodle.org/en/FreeTDS Using FreeTDS for Unix].) &lt;br /&gt;
&lt;br /&gt;
Originally we were using the DLLs available at [http://kromann.info/article.php?Id=11062598797760000 Frank Kromann&#039;s site], but they are outdated (using old versions of FreeTDS) and that has caused [http://tracker.moodle.org/browse/MDL-14725 some problems] in the past.&lt;br /&gt;
&lt;br /&gt;
So, right now, the recommended way to use FreeTDS under Windows is to use PHP 5.2.x following the following instructions:&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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;table table-striped table-bordered&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP version !! [http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries Thread Safe]  !! FreeTDS version !! Download URL&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.2.x (vc6) || Yes || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc6) || Yes || 0.82 + 20090904 patches (unconfirmed) || [http://download.moodle.org/download.php/dblib/php53_vc6/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches (unconfirmed) || [http://download.moodle.org/download.php/dblib/php53_vc6/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc9) || Yes || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.4.x (vc9) || Yes || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_ts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_TS.zip 2 (ftp)] [http://www.sendspace.com/file/vtger3 3]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_NOTS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_nts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_NTS.zip 2 (ftp)] [http://www.sendspace.com/file/nkg2j4 3]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.4.x (vc9) || Yes || 0.91.102 || [http://download.moodle.org/download.php/dblib/php54_vc9_091102/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.102 || [http://download.moodle.org/download.php/dblib/php54_vc9_091102/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x86) || Yes || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x64) || Yes || 0.91.93 || [http://download.moodle.org/download.php/dblib/php55_vc11_x64/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.93 || [http://download.moodle.org/download.php/dblib/php55_vc11_x64/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| PHP 5.6.x (vc11-unkown architecture) || Both || 0.95 || You can find some (unverified/untested) drivers in [https://moodle.org/mod/forum/discuss.php?d=232844#p1297504 this forum post], courtesy of Josh Urbain.&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |  Thanks to [http://remote-learner.net/ Remote-Learner]] (Moodle [http://moodle.com/partners/ Partner]) and specially to Bryan Williams, donating one Visual C++ 6.0 Pro license to Moodle. Thanks to Trevor Johnson and his builds of the dblib extensions. Thanks to Daniele, Doug, Luis, Sean and many others by their collaboration in MDL-14725. Thanks to Frediano Ziglio and James K. Lowden from [http://freetds.org freetds.org] by their support. Thanks to [[User:Alastair Hole|Alastair Hole]] and Matt Rusiniak for providing the PHP 5.3 builds of the libraries. Thanks to Enyby by providing the PHP 5.4 builds of the libraries. Thanks to David Aylmer and Matt Rusiniak for providing the PHP 5.5 builds of the libraries. Thanks!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(alternatively here you can find some [[Development:Compiling FreeTDS under Windows|instructions to build those freetds extensions under win32]] yourself)&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. When the PHP engine loads the FreeTDS extension it needs to be passed certain infiormation in order to be able to connect to your Moodle database. To retrieve this information FreeTDS looks for a file called &#039;&#039;&#039;freetds.conf&#039;&#039;&#039; in the root folder of the server that PHP installed on (e.g. C:\).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;freetds.conf&#039;&#039;&#039; should have the following structure:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to connect to a particular [http://msdn.microsoft.com/en-us/library/aa174516(SQL.80).aspx instance] of MSSQL you should specify the instance name:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      instance = xxx (instance name, e.g. INST2)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
*You can configure FreeTDS to look for the freetds.conf file in any directory that you want - you don&#039;t have to use C:\. To do this create a SYSTEM environment variable called &#039;&#039;&#039;FREETDS&#039;&#039;&#039; and point it to the directory where you have installed the freetds.conf file. If you do not set this environment variable FreeTDS will look for the freetds.conf file in the C:\ folder, which is the default. One possible benefit of setting the FREETDS environment variable and using a different installation directory for freetds.conf is that C:\ is very predictable to a hacker that knows anything about FreeTDS and that is the first place that he would look if he wanted to compromise your system. So, using a different installation directory would just make your system stronger. See the FreeTDS [http://www.freetds.org/userguide/envvar.htm Setting the environment variables] documentation for more information about this FREETDS environment variable.&lt;br /&gt;
&lt;br /&gt;
*Alternatively, you can [[Development:Compiling FreeTDS under Windows|recompile]] the FreeTDS extension yourself and change the default location to your preferred location at compile time. Then it is not necessary to create any environment variable. You must just ensure that freetds.conf is in the same folder that you specify when you compile php_dblib.dll.&lt;br /&gt;
&lt;br /&gt;
*MSSQL is usually installed with port 1433 as the default. However, if the port was changed on your server when you installed MSSQL then you need to specify the correct port number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;mssql&#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 NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;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. Alternatively you can use the config-dist.php file that comes with the Moodle package to create your own config.php file.&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. Database conection test, try this PHP script, just put in a text file called test.php change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to suite your setup, and load from local host (http://localhost/test.php)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	$link = mssql_connect(&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;);&lt;br /&gt;
	if(!$link) {&lt;br /&gt;
		echo&#039;Could not connect&#039;;&lt;br /&gt;
		die(&#039;Could not connect: &#039; . mssql_error());&lt;br /&gt;
	}&lt;br /&gt;
	echo&#039;Successful connection&#039;;&lt;br /&gt;
	mssql_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
If you encounter some problems you can try:&lt;br /&gt;
*check that you have DotNet framework 1.1 installed (later version are installed on Vista, but you could need this specific one)&amp;lt;br /&amp;gt;&lt;br /&gt;
*enable TCP/IP for MSSQL: SQL Server 2005 Network Configuration -&amp;gt; Protocols for MSSQLSERVER -&amp;gt; TCP/IP (Enable) -&amp;gt; Properties -&amp;gt; Ip Addresses -&amp;gt; 127.0.0.1 (Active+Enable)&amp;lt;br /&amp;gt;&lt;br /&gt;
*make sure the SQL Server Browser service is running SQL Server 2005 Network Configuration -&amp;gt; SQL Server Services&amp;lt;br /&amp;gt;&lt;br /&gt;
*if you are using SQL Server 2005 and you have the error &#039;&#039;4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier&#039;&#039;, try the ODBTP method (next chapter). The SQL Server complaining that it doesn&#039;t support pure Unicode via TDS or older versions of ODBC. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren&#039;t accessible via DB-Library so if you need them, you could have to switch away from tools based on TDS and DB-Library :(&lt;br /&gt;
&lt;br /&gt;
== FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) ==&lt;br /&gt;
This is a good read to [http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/ building a FreeTDS based mssql extension for apache on Ubuntu]. Do note that [http://www.freetds.org/news.html freeTDS] 0.91 was recently released, you can find latest versions [http://freetds.sourceforge.net/ here]. &lt;br /&gt;
&lt;br /&gt;
Note: the freetds.conf file you use should have &amp;quot;text size = 20971520&amp;quot; as mentioned in the FreeTDS on Windows section otherwise you might see sessions logging out or worse apache segmentation faults. Also see [[FreeTDS]].&lt;br /&gt;
&lt;br /&gt;
Note2: Please note that updating php tends to remove the freetds configurations. You might need to reconfigure freetds after an upgrade&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Debian Lenny ==&lt;br /&gt;
I found the following solution using:&lt;br /&gt;
* PHP Version 5.2.6-1+lenny9&lt;br /&gt;
* Microsoft SQL Server Enterprise Edition, version: 9.00.4053.00&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install libsybdb5 freetds-common php5-sybase&lt;br /&gt;
/etc/init.d/apache2 restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the end of the process, if all goes fine, you will find in the mssql section of phpinfo();&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MSSQL Support&lt;br /&gt;
! enabled&lt;br /&gt;
|-&lt;br /&gt;
| Library version &lt;br /&gt;
| FreeTDS &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once FreeTDS is correctly installed, don not forget to set it up following explanations in https://docs.moodle.org/en/FreeTDS&lt;br /&gt;
&lt;br /&gt;
== See also ==&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:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;br /&gt;
[[Category:SQL databases]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=AMOS&amp;diff=122242</id>
		<title>AMOS</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=AMOS&amp;diff=122242"/>
		<updated>2016-02-10T22:12:26Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Redirected page to dev:AMOS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[dev:AMOS]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=AMOS&amp;diff=122241</id>
		<title>AMOS</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=AMOS&amp;diff=122241"/>
		<updated>2016-02-10T21:30:09Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[dev:AMOS manual]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=AMOS&amp;diff=122240</id>
		<title>AMOS</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=AMOS&amp;diff=122240"/>
		<updated>2016-02-10T21:28:28Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#redirect [[dev:AMOS manual]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Upgrading_to_Moodle_3.0&amp;diff=121241</id>
		<title>Upgrading to Moodle 3.0</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Upgrading_to_Moodle_3.0&amp;diff=121241"/>
		<updated>2015-11-16T01:20:51Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Just detected that this was missing and it&amp;#039;s the schema followed by downloads links... we can change to the new one if all releases do support it.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#redirect [[Upgrading]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=119765</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=119765"/>
		<updated>2015-09-08T00:40:25Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: /* Installation overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 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;
Some of this may also apply if you wish to access an MSSQL server for external db authentication/enrollment. &lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9).&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;
&amp;lt;span id=&amp;quot;Configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;4. Configure these settings in your created (and still empty) database:&lt;br /&gt;
Configure these settings in your created (and still empty) database:&lt;br /&gt;
:*Use a case sensitive collation, such as Latin1_General_CS_AS.&lt;br /&gt;
:*ANSI NULLS Enabled = True (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:*Quoted Identifiers Enabled = True (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:*Is Read Committed transaction ON = True (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
:** In older versions this is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the &amp;quot;Object Explorer&amp;quot; (right-click &amp;gt; Disconnect), then create a &amp;quot;New Query&amp;quot; and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.&lt;br /&gt;
:** If your DB name starts with a number, you may need to put quotes around the DB name in the query.&lt;br /&gt;
&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;
&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;
== Microsoft Drivers for SQL Server for PHP ==&lt;br /&gt;
&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] a new SQL Server Driver for PHP. This is a PHP extension that allows PHP scripts to read and write data on Microsoft SQL Server databases and it overcomes the problems with the native SQL Server extension that was previously bundled with PHP.&lt;br /&gt;
&lt;br /&gt;
When using [[IIS]] it is strongly recommended to use the official Microsoft PHP installer from http://php.iis.net/, it should include the latest version of necessary drivers and it also simplifies future upgrades and configuration.&lt;br /&gt;
&lt;br /&gt;
For Windows servers with [[Apache]] see http://www.microsoft.com/en-us/download/details.aspx?id=20098.&lt;br /&gt;
&lt;br /&gt;
To know more about how to run Moodle with these drivers go to [[Using the Microsoft SQL Server Driver for PHP]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&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 some previous bugs it&#039;s highly recommendable to use PHP &amp;gt;= 5.2.6 and FreeTDS 0.82 + post-release patches ([http://tracker.moodle.org/browse/MDL-14725 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039;. Despite the name, it&#039;s FreeTDS compiled for Windows. (Go to this page for information on [https://docs.moodle.org/en/FreeTDS Using FreeTDS for Unix].) &lt;br /&gt;
&lt;br /&gt;
Originally we were using the DLLs available at [http://kromann.info/article.php?Id=11062598797760000 Frank Kromann&#039;s site], but they are outdated (using old versions of FreeTDS) and that has caused [http://tracker.moodle.org/browse/MDL-14725 some problems] in the past.&lt;br /&gt;
&lt;br /&gt;
So, right now, the recommended way to use FreeTDS under Windows is to use PHP 5.2.x following the following instructions:&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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;table table-striped table-bordered&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP version !! [http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries Thread Safe]  !! FreeTDS version !! Download URL&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.2.x (vc6) || Yes || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc6) || Yes || 0.82 + 20090904 patches (unconfirmed) || [http://download.moodle.org/download.php/dblib/php53_vc6/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches (unconfirmed) || [http://download.moodle.org/download.php/dblib/php53_vc6/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc9) || Yes || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.4.x (vc9) || Yes || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_ts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_TS.zip 2 (ftp)] [http://www.sendspace.com/file/vtger3 3]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_NOTS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_nts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_NTS.zip 2 (ftp)] [http://www.sendspace.com/file/nkg2j4 3]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.4.x (vc9) || Yes || 0.91.102 || [http://download.moodle.org/download.php/dblib/php54_vc9_091102/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.102 || [http://download.moodle.org/download.php/dblib/php54_vc9_091102/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x86) || Yes || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x64) || Yes || 0.91.93 || [http://download.moodle.org/download.php/dblib/php55_vc11_x64/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.93 || [http://download.moodle.org/download.php/dblib/php55_vc11_x64/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |  Thanks to [http://remote-learner.net/ Remote-Learner]] (Moodle [http://moodle.com/partners/ Partner]) and specially to Bryan Williams, donating one Visual C++ 6.0 Pro license to Moodle. Thanks to Trevor Johnson and his builds of the dblib extensions. Thanks to Daniele, Doug, Luis, Sean and many others by their collaboration in MDL-14725. Thanks to Frediano Ziglio and James K. Lowden from [http://freetds.org freetds.org] by their support. Thanks to [[User:Alastair Hole|Alastair Hole]] and Matt Rusiniak for providing the PHP 5.3 builds of the libraries. Thanks to Enyby by providing the PHP 5.4 builds of the libraries. Thanks to David Aylmer and Matt Rusiniak for providing the PHP 5.5 builds of the libraries. Thanks!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(alternatively here you can find some [[Development:Compiling FreeTDS under Windows|instructions to build those freetds extensions under win32]] yourself)&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. When the PHP engine loads the FreeTDS extension it needs to be passed certain infiormation in order to be able to connect to your Moodle database. To retrieve this information FreeTDS looks for a file called &#039;&#039;&#039;freetds.conf&#039;&#039;&#039; in the root folder of the server that PHP installed on (e.g. C:\).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;freetds.conf&#039;&#039;&#039; should have the following structure:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to connect to a particular [http://msdn.microsoft.com/en-us/library/aa174516(SQL.80).aspx instance] of MSSQL you should specify the instance name:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      instance = xxx (instance name, e.g. INST2)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
*You can configure FreeTDS to look for the freetds.conf file in any directory that you want - you don&#039;t have to use C:\. To do this create a SYSTEM environment variable called &#039;&#039;&#039;FREETDS&#039;&#039;&#039; and point it to the directory where you have installed the freetds.conf file. If you do not set this environment variable FreeTDS will look for the freetds.conf file in the C:\ folder, which is the default. One possible benefit of setting the FREETDS environment variable and using a different installation directory for freetds.conf is that C:\ is very predictable to a hacker that knows anything about FreeTDS and that is the first place that he would look if he wanted to compromise your system. So, using a different installation directory would just make your system stronger. See the FreeTDS [http://www.freetds.org/userguide/envvar.htm Setting the environment variables] documentation for more information about this FREETDS environment variable.&lt;br /&gt;
&lt;br /&gt;
*Alternatively, you can [[Development:Compiling FreeTDS under Windows|recompile]] the FreeTDS extension yourself and change the default location to your preferred location at compile time. Then it is not necessary to create any environment variable. You must just ensure that freetds.conf is in the same folder that you specify when you compile php_dblib.dll.&lt;br /&gt;
&lt;br /&gt;
*MSSQL is usually installed with port 1433 as the default. However, if the port was changed on your server when you installed MSSQL then you need to specify the correct port number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;mssql&#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 NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;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. Alternatively you can use the config-dist.php file that comes with the Moodle package to create your own config.php file.&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. Database conection test, try this PHP script, just put in a text file called test.php change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to suite your setup, and load from local host (http://localhost/test.php)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	$link = mssql_connect(&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;);&lt;br /&gt;
	if(!$link) {&lt;br /&gt;
		echo&#039;Could not connect&#039;;&lt;br /&gt;
		die(&#039;Could not connect: &#039; . mssql_error());&lt;br /&gt;
	}&lt;br /&gt;
	echo&#039;Successful connection&#039;;&lt;br /&gt;
	mssql_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
If you encounter some problems you can try:&lt;br /&gt;
*check that you have DotNet framework 1.1 installed (later version are installed on Vista, but you could need this specific one)&amp;lt;br /&amp;gt;&lt;br /&gt;
*enable TCP/IP for MSSQL: SQL Server 2005 Network Configuration -&amp;gt; Protocols for MSSQLSERVER -&amp;gt; TCP/IP (Enable) -&amp;gt; Properties -&amp;gt; Ip Addresses -&amp;gt; 127.0.0.1 (Active+Enable)&amp;lt;br /&amp;gt;&lt;br /&gt;
*make sure the SQL Server Browser service is running SQL Server 2005 Network Configuration -&amp;gt; SQL Server Services&amp;lt;br /&amp;gt;&lt;br /&gt;
*if you are using SQL Server 2005 and you have the error &#039;&#039;4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier&#039;&#039;, try the ODBTP method (next chapter). The SQL Server complaining that it doesn&#039;t support pure Unicode via TDS or older versions of ODBC. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren&#039;t accessible via DB-Library so if you need them, you could have to switch away from tools based on TDS and DB-Library :(&lt;br /&gt;
&lt;br /&gt;
== FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) ==&lt;br /&gt;
This is a good read to [http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/ building a FreeTDS based mssql extension for apache on Ubuntu]. Do note that [http://www.freetds.org/news.html freeTDS] 0.91 was recently released, you can find latest versions [http://freetds.sourceforge.net/ here]. &lt;br /&gt;
&lt;br /&gt;
Note: the freetds.conf file you use should have &amp;quot;text size = 20971520&amp;quot; as mentioned in the FreeTDS on Windows section otherwise you might see sessions logging out or worse apache segmentation faults. Also see [[FreeTDS]].&lt;br /&gt;
&lt;br /&gt;
Note2: Please note that updating php tends to remove the freetds configurations. You might need to reconfigure freetds after an upgrade&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Debian Lenny ==&lt;br /&gt;
I found the following solution using:&lt;br /&gt;
* PHP Version 5.2.6-1+lenny9&lt;br /&gt;
* Microsoft SQL Server Enterprise Edition, version: 9.00.4053.00&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install libsybdb5 freetds-common php5-sybase&lt;br /&gt;
/etc/init.d/apache2 restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the end of the process, if all goes fine, you will find in the mssql section of phpinfo();&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MSSQL Support&lt;br /&gt;
! enabled&lt;br /&gt;
|-&lt;br /&gt;
| Library version &lt;br /&gt;
| FreeTDS &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once FreeTDS is correctly installed, don not forget to set it up following explanations in https://docs.moodle.org/en/FreeTDS&lt;br /&gt;
&lt;br /&gt;
== See also ==&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:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;br /&gt;
[[Category:SQL databases]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Talk:Course_meta_link&amp;diff=118295</id>
		<title>Talk:Course meta link</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Talk:Course_meta_link&amp;diff=118295"/>
		<updated>2015-04-28T17:25:44Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Can anyone offer some explanation as to what the &amp;quot;External unenrol action&amp;quot; setting in the Course meta link plugin does? [[User:Jon Witts|Jon Witts]] ([[User talk:Jon Witts|talk]]) 03:54, 27 November 2014 (AWST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
One little (not so little) annoyance with the meta-link enrol is that here and there we use different nomenclatures to point to them (linked and meta, child and meta)... and I always end looking to the Docs or code to see which one is every one. I&#039;d suggest to move to something like source/target or, alternatively, at very least, define clearly what is the child course and what&#039;s the meta course. Of course that applies to both Docs and Moodle UI.&lt;br /&gt;
&lt;br /&gt;
In other words. I&#039;ve not idea about the best alternative, but can confirm that the current situation leads me to confusion every time I look (not often, surely that contributes to the confusion, be warned).&lt;br /&gt;
&lt;br /&gt;
Surely this is something that can wait for 3.0 or so, not critical at all.&lt;br /&gt;
&lt;br /&gt;
[[User:Eloy Lafuente (stronk7)|Eloy Lafuente (stronk7)]] ([[User talk:Eloy Lafuente (stronk7)|talk]]) 01:25, 29 April 2015 (AWST)&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Talk:Course_meta_link&amp;diff=118294</id>
		<title>Talk:Course meta link</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Talk:Course_meta_link&amp;diff=118294"/>
		<updated>2015-04-28T17:25:07Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Confusion with current child/meta nomenclature.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Can anyone offer some explanation as to what the &amp;quot;External unenrol action&amp;quot; setting in the Course meta link plugin does? [[User:Jon Witts|Jon Witts]] ([[User talk:Jon Witts|talk]]) 03:54, 27 November 2014 (AWST)&lt;br /&gt;
&lt;br /&gt;
One little (not so little) annoyance with the meta-link enrol is that here and there we use different nomenclatures to point to them (linked and meta, child and meta)... and I always end looking to the Docs or code to see which one is every one. I&#039;d suggest to move to something like source/target or, alternatively, at very least, define clearly what is the child course and what&#039;s the meta course. Of course that applies to both Docs and Moodle UI.&lt;br /&gt;
&lt;br /&gt;
In other words. I&#039;ve not idea about the best alternative, but can confirm that the current situation leads me to confusion every time I look (not often, surely that contributes to the confusion, be warned).&lt;br /&gt;
&lt;br /&gt;
Surely this is something that can wait for 3.0 or so, not critical at all.&lt;br /&gt;
&lt;br /&gt;
[[User:Eloy Lafuente (stronk7)|Eloy Lafuente (stronk7)]] ([[User talk:Eloy Lafuente (stronk7)|talk]]) 01:25, 29 April 2015 (AWST)&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=112281</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=112281"/>
		<updated>2014-05-05T01:44:11Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Added new freetds builds working on Windows7 (original ones were not)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 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;
Some of this may also apply if you wish to access an MSSQL server for external db authentication/enrollment. &lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9).&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;
Configure these settings in your created (and still empty) database:&lt;br /&gt;
:*Use a case sensitive collation, such as Latin1_General_CS_AS.&lt;br /&gt;
:*ANSI NULLS Enabled = True (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:*Quoted Identifiers Enabled = True (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:*Is Read Committed transaction ON = True (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
:** In older versions this is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the &amp;quot;Object Explorer&amp;quot; (right-click &amp;gt; Disconnect), then create a &amp;quot;New Query&amp;quot; and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.&lt;br /&gt;
:** If your DB name starts with a number, you may need to put quotes around the DB name in the query.&lt;br /&gt;
&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;
&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;
== Microsoft Drivers for SQL Server for PHP ==&lt;br /&gt;
&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] a new SQL Server Driver for PHP. This is a PHP extension that allows PHP scripts to read and write data on Microsoft SQL Server databases and it overcomes the problems with the native SQL Server extension that was previously bundled with PHP.&lt;br /&gt;
&lt;br /&gt;
When using [[IIS]] it is strongly recommended to use the official Microsoft PHP installer from http://php.iis.net/, it should include the latest version of necessary drivers and it also simplifies future upgrades and configuration.&lt;br /&gt;
&lt;br /&gt;
For Windows servers with [[Apache]] see http://www.microsoft.com/en-us/download/details.aspx?id=20098.&lt;br /&gt;
&lt;br /&gt;
To know more about how to run Moodle with these drivers go to [[Using the Microsoft SQL Server Driver for PHP]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&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 some previous bugs it&#039;s highly recommendable to use PHP &amp;gt;= 5.2.6 and FreeTDS 0.82 + post-release patches ([http://tracker.moodle.org/browse/MDL-14725 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039;. Despite the name, it&#039;s FreeTDS compiled for Windows. (Go to this page for information on [https://docs.moodle.org/en/FreeTDS Using FreeTDS for Unix].) &lt;br /&gt;
&lt;br /&gt;
Originally we were using the DLLs available at [http://kromann.info/article.php?Id=11062598797760000 Frank Kromann&#039;s site], but they are outdated (using old versions of FreeTDS) and that has caused [http://tracker.moodle.org/browse/MDL-14725 some problems] in the past.&lt;br /&gt;
&lt;br /&gt;
So, right now, the recommended way to use FreeTDS under Windows is to use PHP 5.2.x following the following instructions:&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.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP version !! [http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries Thread Safe]  !! FreeTDS version !! Download URL&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.2.x (vc6) || Yes || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc6) || Yes || 0.82 + 20090904 patches (unconfirmed) || [http://download.moodle.org/download.php/dblib/php53_vc6/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches (unconfirmed) || [http://download.moodle.org/download.php/dblib/php53_vc6/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc9) || Yes || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.4.x (vc9) || Yes || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_ts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_TS.zip 2 (ftp)] [http://www.sendspace.com/file/vtger3 3]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_NOTS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_nts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_NTS.zip 2 (ftp)] [http://www.sendspace.com/file/nkg2j4 3]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.4.x (vc9) || Yes || 0.91.102 || [http://download.moodle.org/download.php/dblib/php54_vc9_091102/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.102 || [http://download.moodle.org/download.php/dblib/php54_vc9_091102/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x86) || Yes || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x64) || Yes || 0.91.93 || [http://download.moodle.org/download.php/dblib/php55_vc11_x64/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.93 || [http://download.moodle.org/download.php/dblib/php55_vc11_x64/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |  Thanks to [http://remote-learner.net/ Remote-Learner]] (Moodle [http://moodle.com/partners/ Partner]) and specially to Bryan Williams, donating one Visual C++ 6.0 Pro license to Moodle. Thanks to Trevor Johnson and his builds of the dblib extensions. Thanks to Daniele, Doug, Luis, Sean and many others by their collaboration in MDL-14725. Thanks to Frediano Ziglio and James K. Lowden from [http://freetds.org freetds.org] by their support. Thanks to [[User:Alastair Hole|Alastair Hole]] and Matt Rusiniak for providing the PHP 5.3 builds of the libraries. Thanks to Enyby by providing the PHP 5.4 builds of the libraries. Thanks to David Aylmer and Matt Rusiniak for providing the PHP 5.5 builds of the libraries. Thanks!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(alternatively here you can find some [[Development:Compiling FreeTDS under Windows|instructions to build those freetds extensions under win32]] yourself)&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. When the PHP engine loads the FreeTDS extension it needs to be passed certain infiormation in order to be able to connect to your Moodle database. To retrieve this information FreeTDS looks for a file called &#039;&#039;&#039;freetds.conf&#039;&#039;&#039; in the root folder of the server that PHP installed on (e.g. C:\).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;freetds.conf&#039;&#039;&#039; should have the following structure:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to connect to a particular [http://msdn.microsoft.com/en-us/library/aa174516(SQL.80).aspx instance] of MSSQL you should specify the instance name:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      instance = xxx (instance name, e.g. INST2)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
*You can configure FreeTDS to look for the freetds.conf file in any directory that you want - you don&#039;t have to use C:\. To do this create a SYSTEM environment variable called &#039;&#039;&#039;FREETDS&#039;&#039;&#039; and point it to the directory where you have installed the freetds.conf file. If you do not set this environment variable FreeTDS will look for the freetds.conf file in the C:\ folder, which is the default. One possible benefit of setting the FREETDS environment variable and using a different installation directory for freetds.conf is that C:\ is very predictable to a hacker that knows anything about FreeTDS and that is the first place that he would look if he wanted to compromise your system. So, using a different installation directory would just make your system stronger. See the FreeTDS [http://www.freetds.org/userguide/envvar.htm Setting the environment variables] documentation for more information about this FREETDS environment variable.&lt;br /&gt;
&lt;br /&gt;
*Alternatively, you can [[Development:Compiling FreeTDS under Windows|recompile]] the FreeTDS extension yourself and change the default location to your preferred location at compile time. Then it is not necessary to create any environment variable. You must just ensure that freetds.conf is in the same folder that you specify when you compile php_dblib.dll.&lt;br /&gt;
&lt;br /&gt;
*MSSQL is usually installed with port 1433 as the default. However, if the port was changed on your server when you installed MSSQL then you need to specify the correct port number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;mssql&#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 NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;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. Alternatively you can use the config-dist.php file that comes with the Moodle package to create your own config.php file.&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. Database conection test, try this PHP script, just put in a text file called test.php change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to suite your setup, and load from local host (http://localhost/test.php)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	$link = mssql_connect(&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;);&lt;br /&gt;
	if(!$link) {&lt;br /&gt;
		echo&#039;Could not connect&#039;;&lt;br /&gt;
		die(&#039;Could not connect: &#039; . mssql_error());&lt;br /&gt;
	}&lt;br /&gt;
	echo&#039;Successful connection&#039;;&lt;br /&gt;
	mssql_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
If you encounter some problems you can try:&lt;br /&gt;
*check that you have DotNet framework 1.1 installed (later version are installed on Vista, but you could need this specific one)&amp;lt;br /&amp;gt;&lt;br /&gt;
*enable TCP/IP for MSSQL: SQL Server 2005 Network Configuration -&amp;gt; Protocols for MSSQLSERVER -&amp;gt; TCP/IP (Enable) -&amp;gt; Properties -&amp;gt; Ip Addresses -&amp;gt; 127.0.0.1 (Active+Enable)&amp;lt;br /&amp;gt;&lt;br /&gt;
*make sure the SQL Server Browser service is running SQL Server 2005 Network Configuration -&amp;gt; SQL Server Services&amp;lt;br /&amp;gt;&lt;br /&gt;
*if you are using SQL Server 2005 and you have the error &#039;&#039;4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier&#039;&#039;, try the ODBTP method (next chapter). The SQL Server complaining that it doesn&#039;t support pure Unicode via TDS or older versions of ODBC. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren&#039;t accessible via DB-Library so if you need them, you could have to switch away from tools based on TDS and DB-Library :(&lt;br /&gt;
&lt;br /&gt;
== FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) ==&lt;br /&gt;
This is a good read to [http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/ building a FreeTDS based mssql extension for apache on Ubuntu]. Do note that [http://www.freetds.org/news.html freeTDS] 0.91 was recently released, you can find latest versions [http://freetds.sourceforge.net/ here]. &lt;br /&gt;
&lt;br /&gt;
Note: the freetds.conf file you use should have &amp;quot;text size = 20971520&amp;quot; as mentioned in the FreeTDS on Windows section otherwise you might see sessions logging out or worse apache segmentation faults. Also see [[FreeTDS]].&lt;br /&gt;
&lt;br /&gt;
Note2: Please note that updating php tends to remove the freetds configurations. You might need to reconfigure freetds after an upgrade&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Debian Lenny ==&lt;br /&gt;
I found the following solution using:&lt;br /&gt;
* PHP Version 5.2.6-1+lenny9&lt;br /&gt;
* Microsoft SQL Server Enterprise Edition, version: 9.00.4053.00&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install libsybdb5 freetds-common php5-sybase&lt;br /&gt;
/etc/init.d/apache2 restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the end of the process, if all goes fine, you will find in the mssql section of phpinfo();&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MSSQL Support&lt;br /&gt;
! enabled&lt;br /&gt;
|-&lt;br /&gt;
| Library version &lt;br /&gt;
| FreeTDS &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once FreeTDS is correctly installed, don not forget to set it up following explanations in https://docs.moodle.org/en/FreeTDS&lt;br /&gt;
&lt;br /&gt;
== See also ==&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:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;br /&gt;
[[Category:SQL databases]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Git_for_Administrators&amp;diff=110574</id>
		<title>Git for Administrators</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Git_for_Administrators&amp;diff=110574"/>
		<updated>2014-03-01T10:21:53Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: fixed link to forum discussion&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
This page describes how to maintain a copy of Moodle on your production server which can easily be upgraded using Git. If you have customisations of Moodle core code, you are advised to follow the instructions in the [[Development:Quick Git start guide for Moodle development|Quick Git start guide for Moodle development]].&lt;br /&gt;
&lt;br /&gt;
To get the most of of Git it is worth making the effort to understand its basic concepts - see the See also section below. It can be a bit of a learning curve, especially if you are used to CVS or Subversion. &lt;br /&gt;
&lt;br /&gt;
== Getting hold of Git (Windows, OSX, Linux and others) ==&lt;br /&gt;
&lt;br /&gt;
Support for Git was, up until recently, mostly confined to Linux but builds are now available for most popular operating systems:&lt;br /&gt;
&lt;br /&gt;
* List of downloads from Git site - http://git-scm.com/download&lt;br /&gt;
&lt;br /&gt;
Once you have downloaded and installed your OS relevant git installation, the git commands in this document should work with your operating system.&lt;br /&gt;
&lt;br /&gt;
== Obtaining the code from Git ==&lt;br /&gt;
&lt;br /&gt;
The command line version of Git is discussed here. Graphical clients are little more than wrappers around the command line version, so you should be able to deduce the correct parameters quite easily. &lt;br /&gt;
&lt;br /&gt;
You can find the official Moodle git repository at git://git.moodle.org/moodle.git (with an official clone at git://github.com/moodle/moodle.git). To initialize your local checkout, use&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone git://git.moodle.org/moodle.git                       (1)&lt;br /&gt;
$ cd moodle&lt;br /&gt;
$ git branch -a                                                   (2)&lt;br /&gt;
$ git branch --track MOODLE_26_STABLE origin/MOODLE_26_STABLE     (3)&lt;br /&gt;
$ git checkout MOODLE_26_STABLE                                   (4)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* The command (1) initializes the new local repository as a clone of the &#039;upstream&#039; (i.e. the remote server based) moodle.git repository. The upstream repository is called &#039;origin&#039; by default. It creates a new directory named &#039;&#039;moodle&#039;&#039;, where it downloads all the files. This operation can take a while as it is actually getting the entire history of all Moodle versions&lt;br /&gt;
* The command (2) lists all available branches.&lt;br /&gt;
* Use the command (3) to create a new local branch called MOODLE_26_STABLE and set it to track the remote branch MOODLE_26_STABLE from the upstream repository.&lt;br /&gt;
* The command (4) actually switches to the newly created local branch. &lt;br /&gt;
&lt;br /&gt;
Note that Git has a huge number of options for each command and it&#039;s actually possible to do the above process with a single command (left as an exercise!!).&lt;br /&gt;
&lt;br /&gt;
==Git from behind a firewall==&lt;br /&gt;
&lt;br /&gt;
Git uses a read-only protocol that may be blocked by your firewall (port 9418). If this is a problem, you can use Github&#039;s http version &amp;lt;nowiki&amp;gt;https://github.com/moodle/moodle.git&amp;lt;/nowiki&amp;gt;. It&#039;s a bit slower, so use the Git protocol if you can.&lt;br /&gt;
&lt;br /&gt;
== Updating your installation ==&lt;br /&gt;
&lt;br /&gt;
The Moodle development team performs integration and testing of fixed bugs every Monday and Tuesday. On Wednesday you can install all patches by updating your code. Check the [http://git.moodle.org/gw?p=moodle.git;a=summary shortlog] to see if the official repository has been already updated or not.&lt;br /&gt;
&lt;br /&gt;
To update your code to the latest version (on the MOODLE_26_STABLE branch) &#039;&#039;&#039;all&#039;&#039;&#039; you have to do is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /path/to/your/moodle/&lt;br /&gt;
$ git pull&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If this is a production site you should still consider the [[Upgrade]] instructions (e.g. take backups).&lt;br /&gt;
&lt;br /&gt;
== Installing a contributed extension from its Git repository ==&lt;br /&gt;
&lt;br /&gt;
This is one way to handle adding plugins from other Git repositories into your Moodle repository. Another way is to use Git Submodules. However, at the time of writing, this is one of Git&#039;s rougher features and should be regarded as an advanced option. &lt;br /&gt;
&lt;br /&gt;
For example, let us say we want to install the [[Certificate module]] from its Git repository into our Moodle 2.6.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /path/to/your/moodle/&lt;br /&gt;
$ cd mod                                                          (1)&lt;br /&gt;
$ git clone https://github.com/markn86/moodle-mod_certificate.git certificate     (2)&lt;br /&gt;
$ cd certificate&lt;br /&gt;
$ git checkout -b MOODLE_26_STABLE origin/MOODLE_26_STABLE        (3)&lt;br /&gt;
$ git branch -d master                                            (4)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The command (1) changes the current directory into the &#039;&#039;mod&#039;&#039; folder of your local Moodle clone. The command (2) creates a new subdirectory &#039;&#039;certificate&#039;&#039; and makes a local clone of vanilla Certificate repository. The command (3) creates a new local branch that will track the remote branch with a Certificate version for Moodle 2.6. The command (4) deletes the &#039;&#039;master&#039;&#039; that was created automatically by git-clone in (2) as we do not want it in this production checkout.&lt;br /&gt;
&lt;br /&gt;
Note: you should check first the compatibility of a module with your Moodle branch by asking directly to the Maintainer before cloning the repo or - if you want to guess it - by issueing the command below before running the command (3), in order to verify what is available among the branches:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git branch -a&lt;br /&gt;
* master&lt;br /&gt;
  remotes/origin/HEAD -&amp;gt; origin/master&lt;br /&gt;
  remotes/origin/MOODLE_20_STABLE&lt;br /&gt;
  remotes/origin/MOODLE_21_STABLE&lt;br /&gt;
  remotes/origin/MOODLE_22_STABLE&lt;br /&gt;
  remotes/origin/MOODLE_23_STABLE&lt;br /&gt;
  remotes/origin/MOODLE_24_STABLE&lt;br /&gt;
  remotes/origin/MOODLE_25_STABLE&lt;br /&gt;
  remotes/origin/MOODLE_26_STABLE&lt;br /&gt;
  remotes/origin/master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will avoid an error message when you issue the command (3) against a nonexistent branch, e.g.:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
§ git checkout -b MOODLE_27_STABLE origin/MOODLE_27_STABLE&lt;br /&gt;
fatal: git checkout: updating paths is incompatible with switching branches.&lt;br /&gt;
Did you intend to checkout &#039;origin/MOODLE_27_STABLE&#039; which can not be resolved as commit?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it is wise to put the new directory mod/certificate/ to the list of ignored files of the main Moodle clone, otherwise a status of the main clone will keep reminding you that the new code has not been checked in.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /path/to/your/moodle/&lt;br /&gt;
$ echo /mod/certificate/ &amp;gt;&amp;gt; .git/info/exclude&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To update your Moodle installation now, you must visit both Git repositories and pull changes from upstream.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /path/to/your/moodle/&lt;br /&gt;
$ git pull&lt;br /&gt;
$ cd mod/certificate&lt;br /&gt;
$ git pull&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Writing a shell script with these lines in the root of Moodle installation is a very good idea. Otherwise it is easy to forget what Git repositories are there within the main Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
; Moodle Docs&lt;br /&gt;
* [[Git FAQ]]&lt;br /&gt;
* [[Windows installation using Git]]&lt;br /&gt;
* [[Git for Mac]]&lt;br /&gt;
* [[:dev:Moodle versions]]&lt;br /&gt;
* For some screenshots see [[User:Frank_Ralf/Git]] (still work in progress)&lt;br /&gt;
* For fixing a Tracker Issue (MDL) / Forking Moodle / CONTRIButing code ... [[User:Sam_Hemelryk/My_Moodle_Git_workflow]]&lt;br /&gt;
* [[Moodle_Production_Server_with_GIT|Case study Git + Moodle from Technical University Berlin]]&lt;br /&gt;
&lt;br /&gt;
; Moodle forum discussions&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=255175 Github and Moodle deployment for production]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=213695 Got GIT installed on my site- here&#039;s how!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=168094 GIT help needed]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=165236 Best way to manage CONTRIB code with GIT]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=167063 Handy Git tip for tracking 3rd-party modules and plugins]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=167730 Moodle Git repositories]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=183693 Git and CVS]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=208904 GIT for dummies]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=211930 Git and upgrading misunderstanding]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=231046 Clear git guide for Admins (not developers)]&lt;br /&gt;
&lt;br /&gt;
; External resources &lt;br /&gt;
* [http://thamblings.blogspot.com.au/2013/07/upgrading-moodle-from-git.html Deploying Moodle from git - Blog post from a production experience]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/everyday.html Everyday GIT With 20 Commands Or So]&lt;br /&gt;
* [http://gitref.org/ Git Reference]&lt;br /&gt;
* [http://progit.org/book/ Pro Git book]&lt;br /&gt;
* [http://eigenjoy.com/2008/05/15/git-from-the-bottom-up/ Git from the bottom up]&lt;br /&gt;
&lt;br /&gt;
[[ja:管理者用Git]]&lt;br /&gt;
[[fr:Git_pour_administrateurs]]&lt;br /&gt;
[[es:Git para Administradores]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Verify_Database_Schema&amp;diff=108384</id>
		<title>Verify Database Schema</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Verify_Database_Schema&amp;diff=108384"/>
		<updated>2013-12-14T15:46:26Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Get rid of databases forum link. [https://moodle.org/mod/forum/discuss.php?d=217775]&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
If you have been upgrading your Moodle site over several versions, it is possible (likely even) that some differences may have crept in between the database table definitions (the &amp;quot;schema&amp;quot;) in your database and the version you would get creating a new empty site. This happens because of small errors or oversights in the upgrade scripts. Most of these differences are not harmful, but some may cause strange or unexpected errors. For example, if a default value has been added to a field and this was not reflected in an upgrade script code that assumes the presence of the default may fail to work as expected. &lt;br /&gt;
&lt;br /&gt;
The solution is after doing an upgrade (or, if your problem is that the upgrade fails, before) to compare the database schema of the &amp;quot;production&amp;quot; site to that of a newly created site (where no upgrades have been performed) using &#039;&#039;&#039;exactly&#039;&#039;&#039; the same code base. There are a number of ways of doing this, but this article outlines a simple way using the Unix command line.&lt;br /&gt;
&lt;br /&gt;
* Complete the upgrade&lt;br /&gt;
* Generate the database schema from your recently upgraded site using the following command:&lt;br /&gt;
    # MySQL&lt;br /&gt;
    mysqldump --no-data -u root -p &#039;&#039;myproductiondb&#039;&#039; &amp;gt;production.schema&lt;br /&gt;
    # PostgreSQL&lt;br /&gt;
    pg_dump --schema-only -U postgres &#039;&#039;myproductiondb&#039;&#039; &amp;gt; production.schema&lt;br /&gt;
* Copy the code  of your production database to a new (web accessible) location (this is important, it *must* be the same version)&lt;br /&gt;
* Create a new, empty database and moodledata area for the new site as per the [[Installation]] instructions&lt;br /&gt;
* Edit the config.php file to point at the new database and locations, or delete it and use the install script&lt;br /&gt;
* Run the install script to generate the (if applicable) config.php file and the database (admin and site values are not important)&lt;br /&gt;
* Generate the database schema from your new site using the following command:&lt;br /&gt;
    # MySQL&lt;br /&gt;
    mysqldump --no-data -u root -p &#039;&#039;mycleandb&#039;&#039; &amp;gt;clean.schema&lt;br /&gt;
    # PostgreSQL&lt;br /&gt;
    pg_dump --schema-only -U postgres &#039;&#039;mycleandb&#039;&#039; &amp;gt; clean.schema&lt;br /&gt;
* Run the following command to detect the differences&lt;br /&gt;
    diff -u production.schema clean.schema &amp;gt;db.diff&lt;br /&gt;
&lt;br /&gt;
You can now look at &#039;&#039;db.diff&#039;&#039; with your favorite editor to see the differences.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; The above obviously applies to MySQL databases. Other databases are likely to have a similar function to dump only the schema. For example PostgreSQL has the &#039;&#039;&#039;pg_dump&#039;&#039;&#039; command. The remainder of the discussion still applies. &lt;br /&gt;
&lt;br /&gt;
==Interpreting the diff file==&lt;br /&gt;
&lt;br /&gt;
Firstly here&#039;s a (real) example:&lt;br /&gt;
&lt;br /&gt;
     --&lt;br /&gt;
     -- Table structure for table `mdl_backup_config`&lt;br /&gt;
        @@ -129,11 +93,11 @@&lt;br /&gt;
         DROP TABLE IF EXISTS `mdl_backup_config`;&lt;br /&gt;
         CREATE TABLE `mdl_backup_config` (&lt;br /&gt;
    -  `id` int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
    +  `id` bigint(10) unsigned NOT NULL auto_increment,&lt;br /&gt;
       `name` varchar(255) NOT NULL default &#039;&#039;,&lt;br /&gt;
       `value` varchar(255) NOT NULL default &#039;&#039;,&lt;br /&gt;
        PRIMARY KEY  (`id`),&lt;br /&gt;
    -  UNIQUE KEY `name` (`name`)&lt;br /&gt;
    +  UNIQUE KEY `mdl_backconf_nam_uix` (`name`)&lt;br /&gt;
         ) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT=&#039;To store backup configuration variables&#039;;&lt;br /&gt;
&lt;br /&gt;
The file may have lots of blocks of changes. The - lines show lines to be taken out and the + lines the ones to replace them (from the production to the clean). So here, the int has been replaced with a bigint and the key name changed. Both of these, technically, should have been changed at some point by upgrade scripts but have been missed. In this case they are unlikely to affect the operation of Moodle. &lt;br /&gt;
&lt;br /&gt;
===Too many changes to track manually?===&lt;br /&gt;
&lt;br /&gt;
You can also use database management programs to synchronize old and new Moodle databases.&lt;br /&gt;
&lt;br /&gt;
For example [http://wb.mysql.com/ MySQL Workbench] for MySQL databases.&lt;br /&gt;
&lt;br /&gt;
This is very useful, if you have a lot of changes.&lt;br /&gt;
&lt;br /&gt;
If you can work a Unix/Linux command line the Python script [http://schemasync.org/ Schema Sync] provides a quick and simple way to generate all the commands to update your database.&lt;br /&gt;
&lt;br /&gt;
==Should I worry?==&lt;br /&gt;
&lt;br /&gt;
Changes in field types (as long as they are compatible) and key name changes seem to be the common issues but &#039;&#039;&#039;should&#039;&#039;&#039; not cause problems. Things to look out for would be along the lines of missing fields and changes to default values.&lt;br /&gt;
&lt;br /&gt;
If you are about to upgrade to Moodle 2.0 you should be more concerned. In order for the upgrade to proceed smoothly it is a very good idea to correct these problems.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* The missing indexes report in &#039;&#039;SiteAdmin-&amp;gt;Misc-&amp;gt;XMLDB editor-&amp;gt;Check Indexes&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[de:Datenbank-Schema prüfen]]&lt;br /&gt;
[[fr:Vérification du schéma de la base de données]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=PostgreSQL&amp;diff=108383</id>
		<title>PostgreSQL</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=PostgreSQL&amp;diff=108383"/>
		<updated>2013-12-14T15:43:12Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Get rid of databases forum link. [https://moodle.org/mod/forum/discuss.php?d=217775]&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
PostgreSQL is one of the two databases that is fully supported by Moodle. A database is a required component of any Moodle installation.&lt;br /&gt;
&lt;br /&gt;
== Creating Moodle Database ==&lt;br /&gt;
&lt;br /&gt;
These instructions assume that the database server and web server are on the same machine. If that is not the case you have some more work to do. See the PostgreSQL documentation for further details. &lt;br /&gt;
&lt;br /&gt;
* Log into the PostgreSQL command line client. The exact form depends on how your PostgreSQL is configured but will be something like&lt;br /&gt;
&lt;br /&gt;
    $ psql -U postgres&lt;br /&gt;
    Password for user postgres:&lt;br /&gt;
&lt;br /&gt;
Enter the password for your &#039;postgres&#039; user set during installation. After some preamble you should see the prompt &#039;&#039;postgres=#&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Create the user for the Moodle database and assign a password:&lt;br /&gt;
&lt;br /&gt;
    postgres=# CREATE USER moodleuser WITH PASSWORD &#039;yourpassword&#039;;&lt;br /&gt;
&lt;br /&gt;
Provide a suitably strong password. Please note that the actual authentication method depends on your PostgreSQL server&#039;s pg_hba.conf file. Some authentication methods (like ident) do not require the password.&lt;br /&gt;
&lt;br /&gt;
* Create the database:&lt;br /&gt;
&lt;br /&gt;
    postgres=# CREATE DATABASE moodle WITH OWNER moodleuser;&lt;br /&gt;
&lt;br /&gt;
== Character set and collation ==&lt;br /&gt;
&lt;br /&gt;
If the PostgreSQL server&#039;s default collation does not suit your needs, you can provide explicit LC_CTYPE (character classification) and LC_COLLATE (string sort order) setting for your Moodle database. The following example creates new database called &#039;moodle&#039; optimised for a Czech Moodle site:&lt;br /&gt;
&lt;br /&gt;
    postgres=# CREATE DATABASE moodle WITH OWNER moodleuser ENCODING &#039;UTF8&#039; LC_COLLATE=&#039;cs_CZ.utf8&#039; LC_CTYPE=&#039;cs_CZ.utf8&#039; TEMPLATE=template0;&lt;br /&gt;
&lt;br /&gt;
For more details refer to [http://www.postgresql.org/docs/9.1/static/multibyte.html Character Set Support] chapter in PostgreSQL manual.&lt;br /&gt;
&lt;br /&gt;
To make sure the database was created correctly, use the &#039;&#039;\l&#039;&#039; at the psql console or execute &#039;&#039;psql -l&#039;&#039; shell command. You should get something like&lt;br /&gt;
&lt;br /&gt;
    postgres=# \l&lt;br /&gt;
                                       List of databases&lt;br /&gt;
       Name    |  Owner     | Encoding |  Collation  |    Ctype    |   Access privileges   &lt;br /&gt;
    -----------+------------+----------+-------------+-------------+-----------------------&lt;br /&gt;
     moodle    | moodleuser | UTF8     | cs_CZ.utf8  | cs_CZ.utf8  | &lt;br /&gt;
     postgres  | postgres   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | &lt;br /&gt;
     template0 | postgres   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres&lt;br /&gt;
                                                                   : postgres=CTc/postgres&lt;br /&gt;
     template1 | postgres   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres&lt;br /&gt;
                                                                   : postgres=CTc/postgres&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.postgresql.org PostgreSQL home page]&lt;br /&gt;
* [http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server Tuning Your PostgreSQL Server]&lt;br /&gt;
* [[Arguments in favour of PostgreSQL]]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Postgres Wikipedia article on PostgerSQL]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=49195 Upgrading to 1.6 and may need to switch to PostgreSQL] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:SQL databases]]&lt;br /&gt;
&lt;br /&gt;
[[es:PostgreSQL]]&lt;br /&gt;
[[ja:PostgreSQL]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=MySQL&amp;diff=108382</id>
		<title>MySQL</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=MySQL&amp;diff=108382"/>
		<updated>2013-12-14T15:42:46Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Get rid of databases forum link. [https://moodle.org/mod/forum/discuss.php?d=217775]&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
MySQL is one of the supported databases that underpins a Moodle installation. &lt;br /&gt;
&lt;br /&gt;
== Installing MySQL ==&lt;br /&gt;
&lt;br /&gt;
* If you are running Linux your preference should be to install using your distributions package manager. This ensures you will get any available updates. &lt;br /&gt;
* There are installers available for most popular operating systems at http://www.mysql.com/downloads/mysql/.&lt;br /&gt;
* It is possible and reasonably straightforward to build mysql from source but it is not recommended (the pre-built binaries are supposedly better optimised).&lt;br /&gt;
* Make sure you set a password for the &#039;root&#039; user (see http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html).&lt;br /&gt;
* Consider installing and configuring my.cnf (the MySQL settings file) to suit your needs. The default configuration is usually very conservative in respect of memory usage versus performance.&lt;br /&gt;
&lt;br /&gt;
== Creating Moodle database ==&lt;br /&gt;
&lt;br /&gt;
These are the steps to create an empty Moodle database. Substitute your own database name, user name and password as appropriate.&lt;br /&gt;
&lt;br /&gt;
The instructions assume that the web server and MySQL server are on the same machine. In this case the &#039;dbhost&#039; is &#039;localhost&#039;. If they are on different machines substitute the name of the web server for &#039;localhost&#039; in the following instructions and the &#039;dbhost&#039; setting will be the name of the database server. &lt;br /&gt;
&lt;br /&gt;
=== Command line === &lt;br /&gt;
&lt;br /&gt;
* To create a database using the &#039;mysql&#039; command line client, first log into MySQL&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mysql -u root -p&lt;br /&gt;
Enter password: &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(Enter the password you previously set - or been given - for the MySQL &#039;root&#039; user). After some pre-amble this should take you to the &#039;&#039;mysql&amp;gt;&#039;&#039; prompt.&lt;br /&gt;
* Create a new database (called &#039;moodle&#039; - substitute your own name if required).  We recommend you use &#039;&#039;&#039;utf8_unicode_ci&#039;&#039;&#039; for collation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add a user/password with the minimum needed permissions:&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 moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
...which creates a user called &#039;moodleuser&#039; with a password &#039;yourpassword&#039;. Make sure you invent a strong password and resist the temptation to &#039;GRANT ALL&#039;.&lt;br /&gt;
&lt;br /&gt;
=== phpMyAdmin ===&lt;br /&gt;
&lt;br /&gt;
[http://www.phpmyadmin.net/ phpMyAdmin] is a web based administration tool for MySQL. If this is available you can use it to create a new database. Make sure that you select &#039;UTF8&#039; as the default character set.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[MariaDB]]&lt;br /&gt;
* [http://www.mysql.com/ The MySQL homepage]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/MySQL Wikipedia article about &#039;&#039;MySQL&#039;&#039;]&lt;br /&gt;
* [http://forums.mysql.com/read.php?24,92131,92131 List of articles on MySQL performance tuning]&lt;br /&gt;
&lt;br /&gt;
[[Category:SQL databases]]&lt;br /&gt;
&lt;br /&gt;
[[ja:MySQL]]&lt;br /&gt;
[[de:MySQL]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108376</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108376"/>
		<updated>2013-12-13T19:32:25Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: 93, is 91.93 (in Matt Rusiniak words)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 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;
Some of this may also apply if you wish to access an MSSQL server for external db authentication/enrollment. &lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9).&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;
Configure these settings in your created (and still empty) database:&lt;br /&gt;
:*Use a case sensitive collation, such as Latin1_General_CS_AS.&lt;br /&gt;
:*ANSI NULLS Enabled = True (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:*Quoted Identifiers Enabled = True (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:*Is Read Committed transaction ON = True (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
:** In older versions this is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the &amp;quot;Object Explorer&amp;quot; (right-click &amp;gt; Disconnect), then create a &amp;quot;New Query&amp;quot; and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.&lt;br /&gt;
:** If your DB name starts with a number, you may need to put quotes around the DB name in the query.&lt;br /&gt;
&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;
&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;
== Microsoft Drivers for SQL Server for PHP ==&lt;br /&gt;
&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] a new SQL Server Driver for PHP. This is a PHP extension that allows PHP scripts to read and write data on Microsoft SQL Server databases and it overcomes the problems with the native SQL Server extension that was previously bundled with PHP.&lt;br /&gt;
&lt;br /&gt;
When using [[IIS]] it is strongly recommended to use the official Microsoft PHP installer from http://php.iis.net/, it should include the latest version of necessary drivers and it also simplifies future upgrades and configuration.&lt;br /&gt;
&lt;br /&gt;
For Windows servers with [[Apache]] see http://www.microsoft.com/en-us/download/details.aspx?id=20098.&lt;br /&gt;
&lt;br /&gt;
To know more about how to run Moodle with these drivers go to [[Using the Microsoft SQL Server Driver for PHP]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&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 some previous bugs it&#039;s highly recommendable to use PHP &amp;gt;= 5.2.6 and FreeTDS 0.82 + post-release patches ([http://tracker.moodle.org/browse/MDL-14725 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039;. Despite the name, it&#039;s FreeTDS compiled for Windows. (Go to this page for information on [https://docs.moodle.org/en/FreeTDS Using FreeTDS for Unix].) &lt;br /&gt;
&lt;br /&gt;
Originally we were using the DLLs available at [http://kromann.info/article.php?Id=11062598797760000 Frank Kromann&#039;s site], but they are outdated (using old versions of FreeTDS) and that has caused [http://tracker.moodle.org/browse/MDL-14725 some problems] in the past.&lt;br /&gt;
&lt;br /&gt;
So, right now, the recommended way to use FreeTDS under Windows is to use PHP 5.2.x following the following instructions:&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.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP version !! [http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries Thread Safe]  !! FreeTDS version !! Download URL&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.2.x (vc6) || Yes || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc6) || Yes || 0.82 + 20090904 patches (unconfirmed) || [http://download.moodle.org/download.php/dblib/php53_vc6/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches (unconfirmed) || [http://download.moodle.org/download.php/dblib/php53_vc6/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc9) || Yes || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.4.x (vc9) || Yes || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_ts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_TS.zip 2 (ftp)] [http://www.sendspace.com/file/vtger3 3]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_nts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_NTS.zip 2 (ftp)] [http://www.sendspace.com/file/nkg2j4 3]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x86) || Yes || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x64) || Yes || 0.91.93 || [http://download.moodle.org/download.php/dblib/php55_vc11_x64/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.93 || [http://download.moodle.org/download.php/dblib/php55_vc11_x64/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |  Thanks to [http://remote-learner.net/ Remote-Learner]] (Moodle [http://moodle.com/partners/ Partner]) and specially to Bryan Williams, donating one Visual C++ 6.0 Pro license to Moodle. Thanks to Trevor Johnson and his builds of the dblib extensions. Thanks to Daniele, Doug, Luis, Sean and many others by their collaboration in MDL-14725. Thanks to Frediano Ziglio and James K. Lowden from [http://freetds.org freetds.org] by their support. Thanks to [[User:Alastair Hole|Alastair Hole]] and Matt Rusiniak for providing the PHP 5.3 builds of the libraries. Thanks to Enyby by providing the PHP 5.4 builds of the libraries. Thanks to David Aylmer and Matt Rusiniak for providing the PHP 5.5 builds of the libraries. Thanks!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(alternatively here you can find some [[Development:Compiling FreeTDS under Windows|instructions to build those freetds extensions under win32]] yourself)&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. When the PHP engine loads the FreeTDS extension it needs to be passed certain infiormation in order to be able to connect to your Moodle database. To retrieve this information FreeTDS looks for a file called &#039;&#039;&#039;freetds.conf&#039;&#039;&#039; in the root folder of the server that PHP installed on (e.g. C:\).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;freetds.conf&#039;&#039;&#039; should have the following structure:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to connect to a particular [http://msdn.microsoft.com/en-us/library/aa174516(SQL.80).aspx instance] of MSSQL you should specify the instance name:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      instance = xxx (instance name, e.g. INST2)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
*You can configure FreeTDS to look for the freetds.conf file in any directory that you want - you don&#039;t have to use C:\. To do this create a SYSTEM environment variable called &#039;&#039;&#039;FREETDS&#039;&#039;&#039; and point it to the directory where you have installed the freetds.conf file. If you do not set this environment variable FreeTDS will look for the freetds.conf file in the C:\ folder, which is the default. One possible benefit of setting the FREETDS environment variable and using a different installation directory for freetds.conf is that C:\ is very predictable to a hacker that knows anything about FreeTDS and that is the first place that he would look if he wanted to compromise your system. So, using a different installation directory would just make your system stronger. See the FreeTDS [http://www.freetds.org/userguide/envvar.htm Setting the environment variables] documentation for more information about this FREETDS environment variable.&lt;br /&gt;
&lt;br /&gt;
*Alternatively, you can [[Development:Compiling FreeTDS under Windows|recompile]] the FreeTDS extension yourself and change the default location to your preferred location at compile time. Then it is not necessary to create any environment variable. You must just ensure that freetds.conf is in the same folder that you specify when you compile php_dblib.dll.&lt;br /&gt;
&lt;br /&gt;
*MSSQL is usually installed with port 1433 as the default. However, if the port was changed on your server when you installed MSSQL then you need to specify the correct port number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;mssql&#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 NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;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. Alternatively you can use the config-dist.php file that comes with the Moodle package to create your own config.php file.&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. Database conection test, try this PHP script, just put in a text file called test.php change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to suite your setup, and load from local host (http://localhost/test.php)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	$link = mssql_connect(&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;);&lt;br /&gt;
	if(!$link) {&lt;br /&gt;
		echo&#039;Could not connect&#039;;&lt;br /&gt;
		die(&#039;Could not connect: &#039; . mssql_error());&lt;br /&gt;
	}&lt;br /&gt;
	echo&#039;Successful connection&#039;;&lt;br /&gt;
	mssql_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
If you encounter some problems you can try:&lt;br /&gt;
*check that you have DotNet framework 1.1 installed (later version are installed on Vista, but you could need this specific one)&amp;lt;br /&amp;gt;&lt;br /&gt;
*enable TCP/IP for MSSQL: SQL Server 2005 Network Configuration -&amp;gt; Protocols for MSSQLSERVER -&amp;gt; TCP/IP (Enable) -&amp;gt; Properties -&amp;gt; Ip Addresses -&amp;gt; 127.0.0.1 (Active+Enable)&amp;lt;br /&amp;gt;&lt;br /&gt;
*make sure the SQL Server Browser service is running SQL Server 2005 Network Configuration -&amp;gt; SQL Server Services&amp;lt;br /&amp;gt;&lt;br /&gt;
*if you are using SQL Server 2005 and you have the error &#039;&#039;4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier&#039;&#039;, try the ODBTP method (next chapter). The SQL Server complaining that it doesn&#039;t support pure Unicode via TDS or older versions of ODBC. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren&#039;t accessible via DB-Library so if you need them, you could have to switch away from tools based on TDS and DB-Library :(&lt;br /&gt;
&lt;br /&gt;
== FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) ==&lt;br /&gt;
This is a good read to [http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/ building a FreeTDS based mssql extension for apache on Ubuntu]. Do note that [http://www.freetds.org/news.html freeTDS] 0.91 was recently released, you can find latest versions [http://freetds.sourceforge.net/ here]. &lt;br /&gt;
&lt;br /&gt;
Note: the freetds.conf file you use should have &amp;quot;text size = 20971520&amp;quot; as mentioned in the FreeTDS on Windows section otherwise you might see sessions logging out or worse apache segmentation faults. Also see [[FreeTDS]].&lt;br /&gt;
&lt;br /&gt;
Note2: Please note that updating php tends to remove the freetds configurations. You might need to reconfigure freetds after an upgrade&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Debian Lenny ==&lt;br /&gt;
I found the following solution using:&lt;br /&gt;
* PHP Version 5.2.6-1+lenny9&lt;br /&gt;
* Microsoft SQL Server Enterprise Edition, version: 9.00.4053.00&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install libsybdb5 freetds-common php5-sybase&lt;br /&gt;
/etc/init.d/apache2 restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the end of the process, if all goes fine, you will find in the mssql section of phpinfo();&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MSSQL Support&lt;br /&gt;
! enabled&lt;br /&gt;
|-&lt;br /&gt;
| Library version &lt;br /&gt;
| FreeTDS &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once FreeTDS is correctly installed, don not forget to set it up following explanations in https://docs.moodle.org/en/FreeTDS&lt;br /&gt;
&lt;br /&gt;
== See also ==&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:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;br /&gt;
[[Category:SQL databases]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108375</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108375"/>
		<updated>2013-12-13T19:02:05Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Adding links to download.moodle.org php53_vc6&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 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;
Some of this may also apply if you wish to access an MSSQL server for external db authentication/enrollment. &lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9).&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;
Configure these settings in your created (and still empty) database:&lt;br /&gt;
:*Use a case sensitive collation, such as Latin1_General_CS_AS.&lt;br /&gt;
:*ANSI NULLS Enabled = True (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:*Quoted Identifiers Enabled = True (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:*Is Read Committed transaction ON = True (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
:** In older versions this is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the &amp;quot;Object Explorer&amp;quot; (right-click &amp;gt; Disconnect), then create a &amp;quot;New Query&amp;quot; and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.&lt;br /&gt;
:** If your DB name starts with a number, you may need to put quotes around the DB name in the query.&lt;br /&gt;
&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;
&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;
== Microsoft Drivers for SQL Server for PHP ==&lt;br /&gt;
&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] a new SQL Server Driver for PHP. This is a PHP extension that allows PHP scripts to read and write data on Microsoft SQL Server databases and it overcomes the problems with the native SQL Server extension that was previously bundled with PHP.&lt;br /&gt;
&lt;br /&gt;
When using [[IIS]] it is strongly recommended to use the official Microsoft PHP installer from http://php.iis.net/, it should include the latest version of necessary drivers and it also simplifies future upgrades and configuration.&lt;br /&gt;
&lt;br /&gt;
For Windows servers with [[Apache]] see http://www.microsoft.com/en-us/download/details.aspx?id=20098.&lt;br /&gt;
&lt;br /&gt;
To know more about how to run Moodle with these drivers go to [[Using the Microsoft SQL Server Driver for PHP]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&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 some previous bugs it&#039;s highly recommendable to use PHP &amp;gt;= 5.2.6 and FreeTDS 0.82 + post-release patches ([http://tracker.moodle.org/browse/MDL-14725 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039;. Despite the name, it&#039;s FreeTDS compiled for Windows. (Go to this page for information on [https://docs.moodle.org/en/FreeTDS Using FreeTDS for Unix].) &lt;br /&gt;
&lt;br /&gt;
Originally we were using the DLLs available at [http://kromann.info/article.php?Id=11062598797760000 Frank Kromann&#039;s site], but they are outdated (using old versions of FreeTDS) and that has caused [http://tracker.moodle.org/browse/MDL-14725 some problems] in the past.&lt;br /&gt;
&lt;br /&gt;
So, right now, the recommended way to use FreeTDS under Windows is to use PHP 5.2.x following the following instructions:&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.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP version !! [http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries Thread Safe]  !! FreeTDS version !! Download URL&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.2.x (vc6) || Yes || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc6) || Yes || 0.82 + 20090904 patches (unconfirmed) || [http://download.moodle.org/download.php/dblib/php53_vc6/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches (unconfirmed) || [http://download.moodle.org/download.php/dblib/php53_vc6/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc9) || Yes || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.4.x (vc9) || Yes || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_ts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_TS.zip 2 (ftp)] [http://www.sendspace.com/file/vtger3 3]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_nts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_NTS.zip 2 (ftp)] [http://www.sendspace.com/file/nkg2j4 3]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x86) || Yes || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x64) || Yes || 0.91.92 || [http://download.moodle.org/download.php/dblib/php55_vc11_x64/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.92 || [http://download.moodle.org/download.php/dblib/php55_vc11_x64/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |  Thanks to [http://remote-learner.net/ Remote-Learner]] (Moodle [http://moodle.com/partners/ Partner]) and specially to Bryan Williams, donating one Visual C++ 6.0 Pro license to Moodle. Thanks to Trevor Johnson and his builds of the dblib extensions. Thanks to Daniele, Doug, Luis, Sean and many others by their collaboration in MDL-14725. Thanks to Frediano Ziglio and James K. Lowden from [http://freetds.org freetds.org] by their support. Thanks to [[User:Alastair Hole|Alastair Hole]] and Matt Rusiniak for providing the PHP 5.3 builds of the libraries. Thanks to Enyby by providing the PHP 5.4 builds of the libraries. Thanks to David Aylmer and Matt Rusiniak for providing the PHP 5.5 builds of the libraries. Thanks!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(alternatively here you can find some [[Development:Compiling FreeTDS under Windows|instructions to build those freetds extensions under win32]] yourself)&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. When the PHP engine loads the FreeTDS extension it needs to be passed certain infiormation in order to be able to connect to your Moodle database. To retrieve this information FreeTDS looks for a file called &#039;&#039;&#039;freetds.conf&#039;&#039;&#039; in the root folder of the server that PHP installed on (e.g. C:\).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;freetds.conf&#039;&#039;&#039; should have the following structure:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to connect to a particular [http://msdn.microsoft.com/en-us/library/aa174516(SQL.80).aspx instance] of MSSQL you should specify the instance name:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      instance = xxx (instance name, e.g. INST2)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
*You can configure FreeTDS to look for the freetds.conf file in any directory that you want - you don&#039;t have to use C:\. To do this create a SYSTEM environment variable called &#039;&#039;&#039;FREETDS&#039;&#039;&#039; and point it to the directory where you have installed the freetds.conf file. If you do not set this environment variable FreeTDS will look for the freetds.conf file in the C:\ folder, which is the default. One possible benefit of setting the FREETDS environment variable and using a different installation directory for freetds.conf is that C:\ is very predictable to a hacker that knows anything about FreeTDS and that is the first place that he would look if he wanted to compromise your system. So, using a different installation directory would just make your system stronger. See the FreeTDS [http://www.freetds.org/userguide/envvar.htm Setting the environment variables] documentation for more information about this FREETDS environment variable.&lt;br /&gt;
&lt;br /&gt;
*Alternatively, you can [[Development:Compiling FreeTDS under Windows|recompile]] the FreeTDS extension yourself and change the default location to your preferred location at compile time. Then it is not necessary to create any environment variable. You must just ensure that freetds.conf is in the same folder that you specify when you compile php_dblib.dll.&lt;br /&gt;
&lt;br /&gt;
*MSSQL is usually installed with port 1433 as the default. However, if the port was changed on your server when you installed MSSQL then you need to specify the correct port number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;mssql&#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 NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;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. Alternatively you can use the config-dist.php file that comes with the Moodle package to create your own config.php file.&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. Database conection test, try this PHP script, just put in a text file called test.php change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to suite your setup, and load from local host (http://localhost/test.php)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	$link = mssql_connect(&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;);&lt;br /&gt;
	if(!$link) {&lt;br /&gt;
		echo&#039;Could not connect&#039;;&lt;br /&gt;
		die(&#039;Could not connect: &#039; . mssql_error());&lt;br /&gt;
	}&lt;br /&gt;
	echo&#039;Successful connection&#039;;&lt;br /&gt;
	mssql_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
If you encounter some problems you can try:&lt;br /&gt;
*check that you have DotNet framework 1.1 installed (later version are installed on Vista, but you could need this specific one)&amp;lt;br /&amp;gt;&lt;br /&gt;
*enable TCP/IP for MSSQL: SQL Server 2005 Network Configuration -&amp;gt; Protocols for MSSQLSERVER -&amp;gt; TCP/IP (Enable) -&amp;gt; Properties -&amp;gt; Ip Addresses -&amp;gt; 127.0.0.1 (Active+Enable)&amp;lt;br /&amp;gt;&lt;br /&gt;
*make sure the SQL Server Browser service is running SQL Server 2005 Network Configuration -&amp;gt; SQL Server Services&amp;lt;br /&amp;gt;&lt;br /&gt;
*if you are using SQL Server 2005 and you have the error &#039;&#039;4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier&#039;&#039;, try the ODBTP method (next chapter). The SQL Server complaining that it doesn&#039;t support pure Unicode via TDS or older versions of ODBC. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren&#039;t accessible via DB-Library so if you need them, you could have to switch away from tools based on TDS and DB-Library :(&lt;br /&gt;
&lt;br /&gt;
== FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) ==&lt;br /&gt;
This is a good read to [http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/ building a FreeTDS based mssql extension for apache on Ubuntu]. Do note that [http://www.freetds.org/news.html freeTDS] 0.91 was recently released, you can find latest versions [http://freetds.sourceforge.net/ here]. &lt;br /&gt;
&lt;br /&gt;
Note: the freetds.conf file you use should have &amp;quot;text size = 20971520&amp;quot; as mentioned in the FreeTDS on Windows section otherwise you might see sessions logging out or worse apache segmentation faults. Also see [[FreeTDS]].&lt;br /&gt;
&lt;br /&gt;
Note2: Please note that updating php tends to remove the freetds configurations. You might need to reconfigure freetds after an upgrade&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Debian Lenny ==&lt;br /&gt;
I found the following solution using:&lt;br /&gt;
* PHP Version 5.2.6-1+lenny9&lt;br /&gt;
* Microsoft SQL Server Enterprise Edition, version: 9.00.4053.00&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install libsybdb5 freetds-common php5-sybase&lt;br /&gt;
/etc/init.d/apache2 restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the end of the process, if all goes fine, you will find in the mssql section of phpinfo();&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MSSQL Support&lt;br /&gt;
! enabled&lt;br /&gt;
|-&lt;br /&gt;
| Library version &lt;br /&gt;
| FreeTDS &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once FreeTDS is correctly installed, don not forget to set it up following explanations in https://docs.moodle.org/en/FreeTDS&lt;br /&gt;
&lt;br /&gt;
== See also ==&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:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;br /&gt;
[[Category:SQL databases]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108374</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108374"/>
		<updated>2013-12-13T18:51:11Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Adding links to download.moodle.org php55_vc11_x64&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 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;
Some of this may also apply if you wish to access an MSSQL server for external db authentication/enrollment. &lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9).&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;
Configure these settings in your created (and still empty) database:&lt;br /&gt;
:*Use a case sensitive collation, such as Latin1_General_CS_AS.&lt;br /&gt;
:*ANSI NULLS Enabled = True (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:*Quoted Identifiers Enabled = True (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:*Is Read Committed transaction ON = True (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
:** In older versions this is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the &amp;quot;Object Explorer&amp;quot; (right-click &amp;gt; Disconnect), then create a &amp;quot;New Query&amp;quot; and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.&lt;br /&gt;
:** If your DB name starts with a number, you may need to put quotes around the DB name in the query.&lt;br /&gt;
&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;
&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;
== Microsoft Drivers for SQL Server for PHP ==&lt;br /&gt;
&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] a new SQL Server Driver for PHP. This is a PHP extension that allows PHP scripts to read and write data on Microsoft SQL Server databases and it overcomes the problems with the native SQL Server extension that was previously bundled with PHP.&lt;br /&gt;
&lt;br /&gt;
When using [[IIS]] it is strongly recommended to use the official Microsoft PHP installer from http://php.iis.net/, it should include the latest version of necessary drivers and it also simplifies future upgrades and configuration.&lt;br /&gt;
&lt;br /&gt;
For Windows servers with [[Apache]] see http://www.microsoft.com/en-us/download/details.aspx?id=20098.&lt;br /&gt;
&lt;br /&gt;
To know more about how to run Moodle with these drivers go to [[Using the Microsoft SQL Server Driver for PHP]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&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 some previous bugs it&#039;s highly recommendable to use PHP &amp;gt;= 5.2.6 and FreeTDS 0.82 + post-release patches ([http://tracker.moodle.org/browse/MDL-14725 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039;. Despite the name, it&#039;s FreeTDS compiled for Windows. (Go to this page for information on [https://docs.moodle.org/en/FreeTDS Using FreeTDS for Unix].) &lt;br /&gt;
&lt;br /&gt;
Originally we were using the DLLs available at [http://kromann.info/article.php?Id=11062598797760000 Frank Kromann&#039;s site], but they are outdated (using old versions of FreeTDS) and that has caused [http://tracker.moodle.org/browse/MDL-14725 some problems] in the past.&lt;br /&gt;
&lt;br /&gt;
So, right now, the recommended way to use FreeTDS under Windows is to use PHP 5.2.x following the following instructions:&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.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP version !! [http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries Thread Safe]  !! FreeTDS version !! Download URL&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.2.x (vc6) || Yes || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc9) || Yes || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.4.x (vc9) || Yes || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_ts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_TS.zip 2 (ftp)] [http://www.sendspace.com/file/vtger3 3]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_nts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_NTS.zip 2 (ftp)] [http://www.sendspace.com/file/nkg2j4 3]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x86) || Yes || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x64) || Yes || 0.91.92 || [http://download.moodle.org/download.php/dblib/php55_vc11_x64/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.92 || [http://download.moodle.org/download.php/dblib/php55_vc11_x64/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |  Thanks to [http://remote-learner.net/ Remote-Learner]] (Moodle [http://moodle.com/partners/ Partner]) and specially to Bryan Williams, donating one Visual C++ 6.0 Pro license to Moodle. Thanks to Trevor Johnson and his builds of the dblib extensions. Thanks to Daniele, Doug, Luis, Sean and many others by their collaboration in MDL-14725. Thanks to Frediano Ziglio and James K. Lowden from [http://freetds.org freetds.org] by their support. Thanks to [[User:Alastair Hole|Alastair Hole]] for providing the PHP 5.3 builds of the libraries. Thanks to Enyby by providing the PHP 5.4 builds of the libraries. Thanks to David Aylmer and Matt Rusiniak for providing the PHP 5.5 builds of the libraries. Thanks!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(alternatively here you can find some [[Development:Compiling FreeTDS under Windows|instructions to build those freetds extensions under win32]] yourself)&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. When the PHP engine loads the FreeTDS extension it needs to be passed certain infiormation in order to be able to connect to your Moodle database. To retrieve this information FreeTDS looks for a file called &#039;&#039;&#039;freetds.conf&#039;&#039;&#039; in the root folder of the server that PHP installed on (e.g. C:\).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;freetds.conf&#039;&#039;&#039; should have the following structure:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to connect to a particular [http://msdn.microsoft.com/en-us/library/aa174516(SQL.80).aspx instance] of MSSQL you should specify the instance name:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      instance = xxx (instance name, e.g. INST2)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
*You can configure FreeTDS to look for the freetds.conf file in any directory that you want - you don&#039;t have to use C:\. To do this create a SYSTEM environment variable called &#039;&#039;&#039;FREETDS&#039;&#039;&#039; and point it to the directory where you have installed the freetds.conf file. If you do not set this environment variable FreeTDS will look for the freetds.conf file in the C:\ folder, which is the default. One possible benefit of setting the FREETDS environment variable and using a different installation directory for freetds.conf is that C:\ is very predictable to a hacker that knows anything about FreeTDS and that is the first place that he would look if he wanted to compromise your system. So, using a different installation directory would just make your system stronger. See the FreeTDS [http://www.freetds.org/userguide/envvar.htm Setting the environment variables] documentation for more information about this FREETDS environment variable.&lt;br /&gt;
&lt;br /&gt;
*Alternatively, you can [[Development:Compiling FreeTDS under Windows|recompile]] the FreeTDS extension yourself and change the default location to your preferred location at compile time. Then it is not necessary to create any environment variable. You must just ensure that freetds.conf is in the same folder that you specify when you compile php_dblib.dll.&lt;br /&gt;
&lt;br /&gt;
*MSSQL is usually installed with port 1433 as the default. However, if the port was changed on your server when you installed MSSQL then you need to specify the correct port number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;mssql&#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 NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;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. Alternatively you can use the config-dist.php file that comes with the Moodle package to create your own config.php file.&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. Database conection test, try this PHP script, just put in a text file called test.php change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to suite your setup, and load from local host (http://localhost/test.php)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	$link = mssql_connect(&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;);&lt;br /&gt;
	if(!$link) {&lt;br /&gt;
		echo&#039;Could not connect&#039;;&lt;br /&gt;
		die(&#039;Could not connect: &#039; . mssql_error());&lt;br /&gt;
	}&lt;br /&gt;
	echo&#039;Successful connection&#039;;&lt;br /&gt;
	mssql_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
If you encounter some problems you can try:&lt;br /&gt;
*check that you have DotNet framework 1.1 installed (later version are installed on Vista, but you could need this specific one)&amp;lt;br /&amp;gt;&lt;br /&gt;
*enable TCP/IP for MSSQL: SQL Server 2005 Network Configuration -&amp;gt; Protocols for MSSQLSERVER -&amp;gt; TCP/IP (Enable) -&amp;gt; Properties -&amp;gt; Ip Addresses -&amp;gt; 127.0.0.1 (Active+Enable)&amp;lt;br /&amp;gt;&lt;br /&gt;
*make sure the SQL Server Browser service is running SQL Server 2005 Network Configuration -&amp;gt; SQL Server Services&amp;lt;br /&amp;gt;&lt;br /&gt;
*if you are using SQL Server 2005 and you have the error &#039;&#039;4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier&#039;&#039;, try the ODBTP method (next chapter). The SQL Server complaining that it doesn&#039;t support pure Unicode via TDS or older versions of ODBC. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren&#039;t accessible via DB-Library so if you need them, you could have to switch away from tools based on TDS and DB-Library :(&lt;br /&gt;
&lt;br /&gt;
== FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) ==&lt;br /&gt;
This is a good read to [http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/ building a FreeTDS based mssql extension for apache on Ubuntu]. Do note that [http://www.freetds.org/news.html freeTDS] 0.91 was recently released, you can find latest versions [http://freetds.sourceforge.net/ here]. &lt;br /&gt;
&lt;br /&gt;
Note: the freetds.conf file you use should have &amp;quot;text size = 20971520&amp;quot; as mentioned in the FreeTDS on Windows section otherwise you might see sessions logging out or worse apache segmentation faults. Also see [[FreeTDS]].&lt;br /&gt;
&lt;br /&gt;
Note2: Please note that updating php tends to remove the freetds configurations. You might need to reconfigure freetds after an upgrade&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Debian Lenny ==&lt;br /&gt;
I found the following solution using:&lt;br /&gt;
* PHP Version 5.2.6-1+lenny9&lt;br /&gt;
* Microsoft SQL Server Enterprise Edition, version: 9.00.4053.00&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install libsybdb5 freetds-common php5-sybase&lt;br /&gt;
/etc/init.d/apache2 restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the end of the process, if all goes fine, you will find in the mssql section of phpinfo();&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MSSQL Support&lt;br /&gt;
! enabled&lt;br /&gt;
|-&lt;br /&gt;
| Library version &lt;br /&gt;
| FreeTDS &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once FreeTDS is correctly installed, don not forget to set it up following explanations in https://docs.moodle.org/en/FreeTDS&lt;br /&gt;
&lt;br /&gt;
== See also ==&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:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;br /&gt;
[[Category:SQL databases]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108373</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108373"/>
		<updated>2013-12-13T18:40:45Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: /* Using FreeTDS on Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 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;
Some of this may also apply if you wish to access an MSSQL server for external db authentication/enrollment. &lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9).&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;
Configure these settings in your created (and still empty) database:&lt;br /&gt;
:*Use a case sensitive collation, such as Latin1_General_CS_AS.&lt;br /&gt;
:*ANSI NULLS Enabled = True (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:*Quoted Identifiers Enabled = True (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:*Is Read Committed transaction ON = True (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
:** In older versions this is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the &amp;quot;Object Explorer&amp;quot; (right-click &amp;gt; Disconnect), then create a &amp;quot;New Query&amp;quot; and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.&lt;br /&gt;
:** If your DB name starts with a number, you may need to put quotes around the DB name in the query.&lt;br /&gt;
&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;
&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;
== Microsoft Drivers for SQL Server for PHP ==&lt;br /&gt;
&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] a new SQL Server Driver for PHP. This is a PHP extension that allows PHP scripts to read and write data on Microsoft SQL Server databases and it overcomes the problems with the native SQL Server extension that was previously bundled with PHP.&lt;br /&gt;
&lt;br /&gt;
When using [[IIS]] it is strongly recommended to use the official Microsoft PHP installer from http://php.iis.net/, it should include the latest version of necessary drivers and it also simplifies future upgrades and configuration.&lt;br /&gt;
&lt;br /&gt;
For Windows servers with [[Apache]] see http://www.microsoft.com/en-us/download/details.aspx?id=20098.&lt;br /&gt;
&lt;br /&gt;
To know more about how to run Moodle with these drivers go to [[Using the Microsoft SQL Server Driver for PHP]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&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 some previous bugs it&#039;s highly recommendable to use PHP &amp;gt;= 5.2.6 and FreeTDS 0.82 + post-release patches ([http://tracker.moodle.org/browse/MDL-14725 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039;. Despite the name, it&#039;s FreeTDS compiled for Windows. (Go to this page for information on [https://docs.moodle.org/en/FreeTDS Using FreeTDS for Unix].) &lt;br /&gt;
&lt;br /&gt;
Originally we were using the DLLs available at [http://kromann.info/article.php?Id=11062598797760000 Frank Kromann&#039;s site], but they are outdated (using old versions of FreeTDS) and that has caused [http://tracker.moodle.org/browse/MDL-14725 some problems] in the past.&lt;br /&gt;
&lt;br /&gt;
So, right now, the recommended way to use FreeTDS under Windows is to use PHP 5.2.x following the following instructions:&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.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP version !! [http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries Thread Safe]  !! FreeTDS version !! Download URL&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.2.x (vc6) || Yes || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc9) || Yes || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.4.x (vc9) || Yes || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_ts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_TS.zip 2 (ftp)] [http://www.sendspace.com/file/vtger3 3]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_nts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_NTS.zip 2 (ftp)] [http://www.sendspace.com/file/nkg2j4 3]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x86) || Yes || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |  Thanks to [http://remote-learner.net/ Remote-Learner]] (Moodle [http://moodle.com/partners/ Partner]) and specially to Bryan Williams, donating one Visual C++ 6.0 Pro license to Moodle. Thanks to Trevor Johnson and his builds of the dblib extensions. Thanks to Daniele, Doug, Luis, Sean and many others by their collaboration in MDL-14725. Thanks to Frediano Ziglio and James K. Lowden from [http://freetds.org freetds.org] by their support. Thanks to [[User:Alastair Hole|Alastair Hole]] for providing the PHP 5.3 builds of the libraries. Thanks to Enyby by providing the PHP 5.4 builds of the libraries. Thanks to David Aylmer for providing the PHP 5.5 builds of the libraries. Thanks!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(alternatively here you can find some [[Development:Compiling FreeTDS under Windows|instructions to build those freetds extensions under win32]] yourself)&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. When the PHP engine loads the FreeTDS extension it needs to be passed certain infiormation in order to be able to connect to your Moodle database. To retrieve this information FreeTDS looks for a file called &#039;&#039;&#039;freetds.conf&#039;&#039;&#039; in the root folder of the server that PHP installed on (e.g. C:\).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;freetds.conf&#039;&#039;&#039; should have the following structure:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to connect to a particular [http://msdn.microsoft.com/en-us/library/aa174516(SQL.80).aspx instance] of MSSQL you should specify the instance name:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      instance = xxx (instance name, e.g. INST2)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
*You can configure FreeTDS to look for the freetds.conf file in any directory that you want - you don&#039;t have to use C:\. To do this create a SYSTEM environment variable called &#039;&#039;&#039;FREETDS&#039;&#039;&#039; and point it to the directory where you have installed the freetds.conf file. If you do not set this environment variable FreeTDS will look for the freetds.conf file in the C:\ folder, which is the default. One possible benefit of setting the FREETDS environment variable and using a different installation directory for freetds.conf is that C:\ is very predictable to a hacker that knows anything about FreeTDS and that is the first place that he would look if he wanted to compromise your system. So, using a different installation directory would just make your system stronger. See the FreeTDS [http://www.freetds.org/userguide/envvar.htm Setting the environment variables] documentation for more information about this FREETDS environment variable.&lt;br /&gt;
&lt;br /&gt;
*Alternatively, you can [[Development:Compiling FreeTDS under Windows|recompile]] the FreeTDS extension yourself and change the default location to your preferred location at compile time. Then it is not necessary to create any environment variable. You must just ensure that freetds.conf is in the same folder that you specify when you compile php_dblib.dll.&lt;br /&gt;
&lt;br /&gt;
*MSSQL is usually installed with port 1433 as the default. However, if the port was changed on your server when you installed MSSQL then you need to specify the correct port number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;mssql&#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 NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;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. Alternatively you can use the config-dist.php file that comes with the Moodle package to create your own config.php file.&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. Database conection test, try this PHP script, just put in a text file called test.php change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to suite your setup, and load from local host (http://localhost/test.php)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	$link = mssql_connect(&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;);&lt;br /&gt;
	if(!$link) {&lt;br /&gt;
		echo&#039;Could not connect&#039;;&lt;br /&gt;
		die(&#039;Could not connect: &#039; . mssql_error());&lt;br /&gt;
	}&lt;br /&gt;
	echo&#039;Successful connection&#039;;&lt;br /&gt;
	mssql_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
If you encounter some problems you can try:&lt;br /&gt;
*check that you have DotNet framework 1.1 installed (later version are installed on Vista, but you could need this specific one)&amp;lt;br /&amp;gt;&lt;br /&gt;
*enable TCP/IP for MSSQL: SQL Server 2005 Network Configuration -&amp;gt; Protocols for MSSQLSERVER -&amp;gt; TCP/IP (Enable) -&amp;gt; Properties -&amp;gt; Ip Addresses -&amp;gt; 127.0.0.1 (Active+Enable)&amp;lt;br /&amp;gt;&lt;br /&gt;
*make sure the SQL Server Browser service is running SQL Server 2005 Network Configuration -&amp;gt; SQL Server Services&amp;lt;br /&amp;gt;&lt;br /&gt;
*if you are using SQL Server 2005 and you have the error &#039;&#039;4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier&#039;&#039;, try the ODBTP method (next chapter). The SQL Server complaining that it doesn&#039;t support pure Unicode via TDS or older versions of ODBC. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren&#039;t accessible via DB-Library so if you need them, you could have to switch away from tools based on TDS and DB-Library :(&lt;br /&gt;
&lt;br /&gt;
== FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) ==&lt;br /&gt;
This is a good read to [http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/ building a FreeTDS based mssql extension for apache on Ubuntu]. Do note that [http://www.freetds.org/news.html freeTDS] 0.91 was recently released, you can find latest versions [http://freetds.sourceforge.net/ here]. &lt;br /&gt;
&lt;br /&gt;
Note: the freetds.conf file you use should have &amp;quot;text size = 20971520&amp;quot; as mentioned in the FreeTDS on Windows section otherwise you might see sessions logging out or worse apache segmentation faults. Also see [[FreeTDS]].&lt;br /&gt;
&lt;br /&gt;
Note2: Please note that updating php tends to remove the freetds configurations. You might need to reconfigure freetds after an upgrade&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Debian Lenny ==&lt;br /&gt;
I found the following solution using:&lt;br /&gt;
* PHP Version 5.2.6-1+lenny9&lt;br /&gt;
* Microsoft SQL Server Enterprise Edition, version: 9.00.4053.00&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install libsybdb5 freetds-common php5-sybase&lt;br /&gt;
/etc/init.d/apache2 restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the end of the process, if all goes fine, you will find in the mssql section of phpinfo();&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MSSQL Support&lt;br /&gt;
! enabled&lt;br /&gt;
|-&lt;br /&gt;
| Library version &lt;br /&gt;
| FreeTDS &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once FreeTDS is correctly installed, don not forget to set it up following explanations in https://docs.moodle.org/en/FreeTDS&lt;br /&gt;
&lt;br /&gt;
== See also ==&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:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;br /&gt;
[[Category:SQL databases]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108372</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108372"/>
		<updated>2013-12-13T18:40:01Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Adding links to download.moodle.org php55_vc11_x86&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 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;
Some of this may also apply if you wish to access an MSSQL server for external db authentication/enrollment. &lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9).&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;
Configure these settings in your created (and still empty) database:&lt;br /&gt;
:*Use a case sensitive collation, such as Latin1_General_CS_AS.&lt;br /&gt;
:*ANSI NULLS Enabled = True (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:*Quoted Identifiers Enabled = True (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:*Is Read Committed transaction ON = True (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
:** In older versions this is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the &amp;quot;Object Explorer&amp;quot; (right-click &amp;gt; Disconnect), then create a &amp;quot;New Query&amp;quot; and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.&lt;br /&gt;
:** If your DB name starts with a number, you may need to put quotes around the DB name in the query.&lt;br /&gt;
&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;
&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;
== Microsoft Drivers for SQL Server for PHP ==&lt;br /&gt;
&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] a new SQL Server Driver for PHP. This is a PHP extension that allows PHP scripts to read and write data on Microsoft SQL Server databases and it overcomes the problems with the native SQL Server extension that was previously bundled with PHP.&lt;br /&gt;
&lt;br /&gt;
When using [[IIS]] it is strongly recommended to use the official Microsoft PHP installer from http://php.iis.net/, it should include the latest version of necessary drivers and it also simplifies future upgrades and configuration.&lt;br /&gt;
&lt;br /&gt;
For Windows servers with [[Apache]] see http://www.microsoft.com/en-us/download/details.aspx?id=20098.&lt;br /&gt;
&lt;br /&gt;
To know more about how to run Moodle with these drivers go to [[Using the Microsoft SQL Server Driver for PHP]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&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 some previous bugs it&#039;s highly recommendable to use PHP &amp;gt;= 5.2.6 and FreeTDS 0.82 + post-release patches ([http://tracker.moodle.org/browse/MDL-14725 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039;. Despite the name, it&#039;s FreeTDS compiled for Windows. (Go to this page for information on [https://docs.moodle.org/en/FreeTDS Using FreeTDS for Unix].) &lt;br /&gt;
&lt;br /&gt;
Originally we were using the DLLs available at [http://kromann.info/article.php?Id=11062598797760000 Frank Kromann&#039;s site], but they are outdated (using old versions of FreeTDS) and that has caused [http://tracker.moodle.org/browse/MDL-14725 some problems] in the past.&lt;br /&gt;
&lt;br /&gt;
So, right now, the recommended way to use FreeTDS under Windows is to use PHP 5.2.x following the following instructions:&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.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP version !! [http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries Thread Safe]  !! FreeTDS version !! Download URL&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.2.x (vc6) || Yes || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc9) || Yes || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.4.x (vc9) || Yes || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_ts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_TS.zip 2 (ftp)] [http://www.sendspace.com/file/vtger3 3]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_nts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_NTS.zip 2 (ftp)] [http://www.sendspace.com/file/nkg2j4 3]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11-x86) || Yes || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.89 || [http://download.moodle.org/download.php/dblib/php55_vc11_x86/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |  Thanks to [http://remote-learner.net/ Remote-Learner]] (Moodle [http://moodle.com/partners/ Partner]) and specially to Bryan Williams, donating one Visual C++ 6.0 Pro license to Moodle. Thanks to Trevor Johnson and his builds of the dblib extensions. Thanks to Daniele, Doug, Luis, Sean and many others by their collaboration in MDL-14725. Thanks to Frediano Ziglio and James K. Lowden from [http://freetds.org freetds.org] by their support. Thanks to [[User:Alastair Hole|Alastair Hole]] for providing the PHP 5.3 builds of the libraries. Thanks to Enyby by providing the PHP 5.4 builds of the libraries. Thanks to David Aylmer for providing the PHP 5.5 builds of the libraries. Thanks!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(alternatively here you can find some [[Development:Compiling FreeTDS under Windows|instructions to build those freetds extensions under win32]] yourself)&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. When the PHP engine loads the FreeTDS extension it needs to be passed certain infiormation in order to be able to connect to your Moodle database. To retrieve this information FreeTDS looks for a file called &#039;&#039;&#039;freetds.conf&#039;&#039;&#039; in the root folder of the server that PHP installed on (e.g. C:\).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;freetds.conf&#039;&#039;&#039; should have the following structure:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to connect to a particular [http://msdn.microsoft.com/en-us/library/aa174516(SQL.80).aspx instance] of MSSQL you should specify the instance name:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      instance = xxx (instance name, e.g. INST2)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
*You can configure FreeTDS to look for the freetds.conf file in any directory that you want - you don&#039;t have to use C:\. To do this create a SYSTEM environment variable called &#039;&#039;&#039;FREETDS&#039;&#039;&#039; and point it to the directory where you have installed the freetds.conf file. If you do not set this environment variable FreeTDS will look for the freetds.conf file in the C:\ folder, which is the default. One possible benefit of setting the FREETDS environment variable and using a different installation directory for freetds.conf is that C:\ is very predictable to a hacker that knows anything about FreeTDS and that is the first place that he would look if he wanted to compromise your system. So, using a different installation directory would just make your system stronger. See the FreeTDS [http://www.freetds.org/userguide/envvar.htm Setting the environment variables] documentation for more information about this FREETDS environment variable.&lt;br /&gt;
&lt;br /&gt;
*Alternatively, you can [[Development:Compiling FreeTDS under Windows|recompile]] the FreeTDS extension yourself and change the default location to your preferred location at compile time. Then it is not necessary to create any environment variable. You must just ensure that freetds.conf is in the same folder that you specify when you compile php_dblib.dll.&lt;br /&gt;
&lt;br /&gt;
*MSSQL is usually installed with port 1433 as the default. However, if the port was changed on your server when you installed MSSQL then you need to specify the correct port number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;mssql&#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 NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;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. Alternatively you can use the config-dist.php file that comes with the Moodle package to create your own config.php file.&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. Database conection test, try this PHP script, just put in a text file called test.php change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to suite your setup, and load from local host (http://localhost/test.php)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	$link = mssql_connect(&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;);&lt;br /&gt;
	if(!$link) {&lt;br /&gt;
		echo&#039;Could not connect&#039;;&lt;br /&gt;
		die(&#039;Could not connect: &#039; . mssql_error());&lt;br /&gt;
	}&lt;br /&gt;
	echo&#039;Successful connection&#039;;&lt;br /&gt;
	mssql_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
If you encounter some problems you can try:&lt;br /&gt;
*check that you have DotNet framework 1.1 installed (later version are installed on Vista, but you could need this specific one)&amp;lt;br /&amp;gt;&lt;br /&gt;
*enable TCP/IP for MSSQL: SQL Server 2005 Network Configuration -&amp;gt; Protocols for MSSQLSERVER -&amp;gt; TCP/IP (Enable) -&amp;gt; Properties -&amp;gt; Ip Addresses -&amp;gt; 127.0.0.1 (Active+Enable)&amp;lt;br /&amp;gt;&lt;br /&gt;
*make sure the SQL Server Browser service is running SQL Server 2005 Network Configuration -&amp;gt; SQL Server Services&amp;lt;br /&amp;gt;&lt;br /&gt;
*if you are using SQL Server 2005 and you have the error &#039;&#039;4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier&#039;&#039;, try the ODBTP method (next chapter). The SQL Server complaining that it doesn&#039;t support pure Unicode via TDS or older versions of ODBC. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren&#039;t accessible via DB-Library so if you need them, you could have to switch away from tools based on TDS and DB-Library :(&lt;br /&gt;
&lt;br /&gt;
== FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) ==&lt;br /&gt;
This is a good read to [http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/ building a FreeTDS based mssql extension for apache on Ubuntu]. Do note that [http://www.freetds.org/news.html freeTDS] 0.91 was recently released, you can find latest versions [http://freetds.sourceforge.net/ here]. &lt;br /&gt;
&lt;br /&gt;
Note: the freetds.conf file you use should have &amp;quot;text size = 20971520&amp;quot; as mentioned in the FreeTDS on Windows section otherwise you might see sessions logging out or worse apache segmentation faults. Also see [[FreeTDS]].&lt;br /&gt;
&lt;br /&gt;
Note2: Please note that updating php tends to remove the freetds configurations. You might need to reconfigure freetds after an upgrade&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Debian Lenny ==&lt;br /&gt;
I found the following solution using:&lt;br /&gt;
* PHP Version 5.2.6-1+lenny9&lt;br /&gt;
* Microsoft SQL Server Enterprise Edition, version: 9.00.4053.00&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install libsybdb5 freetds-common php5-sybase&lt;br /&gt;
/etc/init.d/apache2 restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the end of the process, if all goes fine, you will find in the mssql section of phpinfo();&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MSSQL Support&lt;br /&gt;
! enabled&lt;br /&gt;
|-&lt;br /&gt;
| Library version &lt;br /&gt;
| FreeTDS &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once FreeTDS is correctly installed, don not forget to set it up following explanations in https://docs.moodle.org/en/FreeTDS&lt;br /&gt;
&lt;br /&gt;
== See also ==&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:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;br /&gt;
[[Category:SQL databases]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108371</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108371"/>
		<updated>2013-12-13T18:21:21Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Adding links to download.moodle.org php53_vc9&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 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;
Some of this may also apply if you wish to access an MSSQL server for external db authentication/enrollment. &lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9).&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;
Configure these settings in your created (and still empty) database:&lt;br /&gt;
:*Use a case sensitive collation, such as Latin1_General_CS_AS.&lt;br /&gt;
:*ANSI NULLS Enabled = True (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:*Quoted Identifiers Enabled = True (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:*Is Read Committed transaction ON = True (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
:** In older versions this is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the &amp;quot;Object Explorer&amp;quot; (right-click &amp;gt; Disconnect), then create a &amp;quot;New Query&amp;quot; and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.&lt;br /&gt;
:** If your DB name starts with a number, you may need to put quotes around the DB name in the query.&lt;br /&gt;
&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;
&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;
== Microsoft Drivers for SQL Server for PHP ==&lt;br /&gt;
&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] a new SQL Server Driver for PHP. This is a PHP extension that allows PHP scripts to read and write data on Microsoft SQL Server databases and it overcomes the problems with the native SQL Server extension that was previously bundled with PHP.&lt;br /&gt;
&lt;br /&gt;
When using [[IIS]] it is strongly recommended to use the official Microsoft PHP installer from http://php.iis.net/, it should include the latest version of necessary drivers and it also simplifies future upgrades and configuration.&lt;br /&gt;
&lt;br /&gt;
For Windows servers with [[Apache]] see http://www.microsoft.com/en-us/download/details.aspx?id=20098.&lt;br /&gt;
&lt;br /&gt;
To know more about how to run Moodle with these drivers go to [[Using the Microsoft SQL Server Driver for PHP]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&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 some previous bugs it&#039;s highly recommendable to use PHP &amp;gt;= 5.2.6 and FreeTDS 0.82 + post-release patches ([http://tracker.moodle.org/browse/MDL-14725 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039;. Despite the name, it&#039;s FreeTDS compiled for Windows. (Go to this page for information on [https://docs.moodle.org/en/FreeTDS Using FreeTDS for Unix].) &lt;br /&gt;
&lt;br /&gt;
Originally we were using the DLLs available at [http://kromann.info/article.php?Id=11062598797760000 Frank Kromann&#039;s site], but they are outdated (using old versions of FreeTDS) and that has caused [http://tracker.moodle.org/browse/MDL-14725 some problems] in the past.&lt;br /&gt;
&lt;br /&gt;
So, right now, the recommended way to use FreeTDS under Windows is to use PHP 5.2.x following the following instructions:&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.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP version !! [http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries Thread Safe]  !! FreeTDS version !! Download URL&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.2.x (vc6) || Yes || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc9) || Yes || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53_vc9/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.4.x (vc9) || Yes || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_ts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_TS.zip 2 (ftp)] [http://www.sendspace.com/file/vtger3 3]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_nts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_NTS.zip 2 (ftp)] [http://www.sendspace.com/file/nkg2j4 3]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11) || Yes || 0.91.89 || [https://moodle.org/pluginfile.php/133/mod_forum/attachment/1012945/FreeTDS_0.91.89_PHP_5.5.x_%28vc11_ts_dblib%29.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.89 || [https://moodle.org/pluginfile.php/133/mod_forum/attachment/1012945/FreeTDS_0.91.89_PHP_5.5.x_%28vc11_nts_dblib%29.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |  Thanks to [http://remote-learner.net/ Remote-Learner]] (Moodle [http://moodle.com/partners/ Partner]) and specially to Bryan Williams, donating one Visual C++ 6.0 Pro license to Moodle. Thanks to Trevor Johnson and his builds of the dblib extensions. Thanks to Daniele, Doug, Luis, Sean and many others by their collaboration in MDL-14725. Thanks to Frediano Ziglio and James K. Lowden from [http://freetds.org freetds.org] by their support. Thanks to [[User:Alastair Hole|Alastair Hole]] for providing the PHP 5.3 builds of the libraries. Thanks to Enyby by providing the PHP 5.4 builds of the libraries. Thanks to David Aylmer for providing the PHP 5.5 builds of the libraries. Thanks!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(alternatively here you can find some [[Development:Compiling FreeTDS under Windows|instructions to build those freetds extensions under win32]] yourself)&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. When the PHP engine loads the FreeTDS extension it needs to be passed certain infiormation in order to be able to connect to your Moodle database. To retrieve this information FreeTDS looks for a file called &#039;&#039;&#039;freetds.conf&#039;&#039;&#039; in the root folder of the server that PHP installed on (e.g. C:\).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;freetds.conf&#039;&#039;&#039; should have the following structure:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to connect to a particular [http://msdn.microsoft.com/en-us/library/aa174516(SQL.80).aspx instance] of MSSQL you should specify the instance name:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      instance = xxx (instance name, e.g. INST2)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
*You can configure FreeTDS to look for the freetds.conf file in any directory that you want - you don&#039;t have to use C:\. To do this create a SYSTEM environment variable called &#039;&#039;&#039;FREETDS&#039;&#039;&#039; and point it to the directory where you have installed the freetds.conf file. If you do not set this environment variable FreeTDS will look for the freetds.conf file in the C:\ folder, which is the default. One possible benefit of setting the FREETDS environment variable and using a different installation directory for freetds.conf is that C:\ is very predictable to a hacker that knows anything about FreeTDS and that is the first place that he would look if he wanted to compromise your system. So, using a different installation directory would just make your system stronger. See the FreeTDS [http://www.freetds.org/userguide/envvar.htm Setting the environment variables] documentation for more information about this FREETDS environment variable.&lt;br /&gt;
&lt;br /&gt;
*Alternatively, you can [[Development:Compiling FreeTDS under Windows|recompile]] the FreeTDS extension yourself and change the default location to your preferred location at compile time. Then it is not necessary to create any environment variable. You must just ensure that freetds.conf is in the same folder that you specify when you compile php_dblib.dll.&lt;br /&gt;
&lt;br /&gt;
*MSSQL is usually installed with port 1433 as the default. However, if the port was changed on your server when you installed MSSQL then you need to specify the correct port number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;mssql&#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 NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;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. Alternatively you can use the config-dist.php file that comes with the Moodle package to create your own config.php file.&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. Database conection test, try this PHP script, just put in a text file called test.php change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to suite your setup, and load from local host (http://localhost/test.php)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	$link = mssql_connect(&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;);&lt;br /&gt;
	if(!$link) {&lt;br /&gt;
		echo&#039;Could not connect&#039;;&lt;br /&gt;
		die(&#039;Could not connect: &#039; . mssql_error());&lt;br /&gt;
	}&lt;br /&gt;
	echo&#039;Successful connection&#039;;&lt;br /&gt;
	mssql_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
If you encounter some problems you can try:&lt;br /&gt;
*check that you have DotNet framework 1.1 installed (later version are installed on Vista, but you could need this specific one)&amp;lt;br /&amp;gt;&lt;br /&gt;
*enable TCP/IP for MSSQL: SQL Server 2005 Network Configuration -&amp;gt; Protocols for MSSQLSERVER -&amp;gt; TCP/IP (Enable) -&amp;gt; Properties -&amp;gt; Ip Addresses -&amp;gt; 127.0.0.1 (Active+Enable)&amp;lt;br /&amp;gt;&lt;br /&gt;
*make sure the SQL Server Browser service is running SQL Server 2005 Network Configuration -&amp;gt; SQL Server Services&amp;lt;br /&amp;gt;&lt;br /&gt;
*if you are using SQL Server 2005 and you have the error &#039;&#039;4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier&#039;&#039;, try the ODBTP method (next chapter). The SQL Server complaining that it doesn&#039;t support pure Unicode via TDS or older versions of ODBC. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren&#039;t accessible via DB-Library so if you need them, you could have to switch away from tools based on TDS and DB-Library :(&lt;br /&gt;
&lt;br /&gt;
== FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) ==&lt;br /&gt;
This is a good read to [http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/ building a FreeTDS based mssql extension for apache on Ubuntu]. Do note that [http://www.freetds.org/news.html freeTDS] 0.91 was recently released, you can find latest versions [http://freetds.sourceforge.net/ here]. &lt;br /&gt;
&lt;br /&gt;
Note: the freetds.conf file you use should have &amp;quot;text size = 20971520&amp;quot; as mentioned in the FreeTDS on Windows section otherwise you might see sessions logging out or worse apache segmentation faults. Also see [[FreeTDS]].&lt;br /&gt;
&lt;br /&gt;
Note2: Please note that updating php tends to remove the freetds configurations. You might need to reconfigure freetds after an upgrade&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Debian Lenny ==&lt;br /&gt;
I found the following solution using:&lt;br /&gt;
* PHP Version 5.2.6-1+lenny9&lt;br /&gt;
* Microsoft SQL Server Enterprise Edition, version: 9.00.4053.00&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install libsybdb5 freetds-common php5-sybase&lt;br /&gt;
/etc/init.d/apache2 restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the end of the process, if all goes fine, you will find in the mssql section of phpinfo();&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MSSQL Support&lt;br /&gt;
! enabled&lt;br /&gt;
|-&lt;br /&gt;
| Library version &lt;br /&gt;
| FreeTDS &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once FreeTDS is correctly installed, don not forget to set it up following explanations in https://docs.moodle.org/en/FreeTDS&lt;br /&gt;
&lt;br /&gt;
== See also ==&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:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;br /&gt;
[[Category:SQL databases]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108370</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=108370"/>
		<updated>2013-12-13T18:20:14Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: Adding links to download.moodle.org php4_vc9&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 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;
Some of this may also apply if you wish to access an MSSQL server for external db authentication/enrollment. &lt;br /&gt;
&lt;br /&gt;
First of all, minimum required version of MSSQL has been stabilised to MSSQL 2005 (v.9).&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;
Configure these settings in your created (and still empty) database:&lt;br /&gt;
:*Use a case sensitive collation, such as Latin1_General_CS_AS.&lt;br /&gt;
:*ANSI NULLS Enabled = True (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:*Quoted Identifiers Enabled = True (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:*Is Read Committed transaction ON = True (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
:** In older versions this is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the &amp;quot;Object Explorer&amp;quot; (right-click &amp;gt; Disconnect), then create a &amp;quot;New Query&amp;quot; and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.&lt;br /&gt;
:** If your DB name starts with a number, you may need to put quotes around the DB name in the query.&lt;br /&gt;
&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;
&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;
== Microsoft Drivers for SQL Server for PHP ==&lt;br /&gt;
&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] a new SQL Server Driver for PHP. This is a PHP extension that allows PHP scripts to read and write data on Microsoft SQL Server databases and it overcomes the problems with the native SQL Server extension that was previously bundled with PHP.&lt;br /&gt;
&lt;br /&gt;
When using [[IIS]] it is strongly recommended to use the official Microsoft PHP installer from http://php.iis.net/, it should include the latest version of necessary drivers and it also simplifies future upgrades and configuration.&lt;br /&gt;
&lt;br /&gt;
For Windows servers with [[Apache]] see http://www.microsoft.com/en-us/download/details.aspx?id=20098.&lt;br /&gt;
&lt;br /&gt;
To know more about how to run Moodle with these drivers go to [[Using the Microsoft SQL Server Driver for PHP]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Windows ==&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 some previous bugs it&#039;s highly recommendable to use PHP &amp;gt;= 5.2.6 and FreeTDS 0.82 + post-release patches ([http://tracker.moodle.org/browse/MDL-14725 more info]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your web server is on Windows, use &#039;&#039;&#039;php_dblib.dll&#039;&#039;&#039;. Despite the name, it&#039;s FreeTDS compiled for Windows. (Go to this page for information on [https://docs.moodle.org/en/FreeTDS Using FreeTDS for Unix].) &lt;br /&gt;
&lt;br /&gt;
Originally we were using the DLLs available at [http://kromann.info/article.php?Id=11062598797760000 Frank Kromann&#039;s site], but they are outdated (using old versions of FreeTDS) and that has caused [http://tracker.moodle.org/browse/MDL-14725 some problems] in the past.&lt;br /&gt;
&lt;br /&gt;
So, right now, the recommended way to use FreeTDS under Windows is to use PHP 5.2.x following the following instructions:&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.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! PHP version !! [http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries Thread Safe]  !! FreeTDS version !! Download URL&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.2.x (vc6) || Yes || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090302 patches || [http://download.moodle.org/download.php/dblib/php52/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.3.x (vc9) || Yes || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53/DBLIB_TS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20090904 patches || [http://download.moodle.org/download.php/dblib/php53/DBLIB_NOTS.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.4.x (vc9) || Yes || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_ts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_TS.zip 2 (ftp)] [http://www.sendspace.com/file/vtger3 3]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.82 + 20110906 patches || [http://download.moodle.org/download.php/dblib/php54_vc9/DBLIB_TS.zip Download!] Mirrors: [http://inethub.olvi.net.ua/ftp/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/dblib_nts.zip 1] [ftp://inethub.olvi.net.ua/pub/soft/programming/php/ms%20sql%20driver%20for%20%20php%205.4.10/DBLIB_NTS.zip 2 (ftp)] [http://www.sendspace.com/file/nkg2j4 3]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | PHP 5.5.x (vc11) || Yes || 0.91.89 || [https://moodle.org/pluginfile.php/133/mod_forum/attachment/1012945/FreeTDS_0.91.89_PHP_5.5.x_%28vc11_ts_dblib%29.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| No || 0.91.89 || [https://moodle.org/pluginfile.php/133/mod_forum/attachment/1012945/FreeTDS_0.91.89_PHP_5.5.x_%28vc11_nts_dblib%29.zip Download!]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |  Thanks to [http://remote-learner.net/ Remote-Learner]] (Moodle [http://moodle.com/partners/ Partner]) and specially to Bryan Williams, donating one Visual C++ 6.0 Pro license to Moodle. Thanks to Trevor Johnson and his builds of the dblib extensions. Thanks to Daniele, Doug, Luis, Sean and many others by their collaboration in MDL-14725. Thanks to Frediano Ziglio and James K. Lowden from [http://freetds.org freetds.org] by their support. Thanks to [[User:Alastair Hole|Alastair Hole]] for providing the PHP 5.3 builds of the libraries. Thanks to Enyby by providing the PHP 5.4 builds of the libraries. Thanks to David Aylmer for providing the PHP 5.5 builds of the libraries. Thanks!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(alternatively here you can find some [[Development:Compiling FreeTDS under Windows|instructions to build those freetds extensions under win32]] yourself)&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. When the PHP engine loads the FreeTDS extension it needs to be passed certain infiormation in order to be able to connect to your Moodle database. To retrieve this information FreeTDS looks for a file called &#039;&#039;&#039;freetds.conf&#039;&#039;&#039; in the root folder of the server that PHP installed on (e.g. C:\).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;freetds.conf&#039;&#039;&#039; should have the following structure:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to connect to a particular [http://msdn.microsoft.com/en-us/library/aa174516(SQL.80).aspx instance] of MSSQL you should specify the instance name:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
      host = xxx.xxx.xxx.xxx (host name or ip of the MSSQL server)&lt;br /&gt;
      instance = xxx (instance name, e.g. INST2)&lt;br /&gt;
      port = 1433&lt;br /&gt;
      client charset = UTF-8&lt;br /&gt;
      tds version = 8.0&lt;br /&gt;
      text size = 20971520&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
*You can configure FreeTDS to look for the freetds.conf file in any directory that you want - you don&#039;t have to use C:\. To do this create a SYSTEM environment variable called &#039;&#039;&#039;FREETDS&#039;&#039;&#039; and point it to the directory where you have installed the freetds.conf file. If you do not set this environment variable FreeTDS will look for the freetds.conf file in the C:\ folder, which is the default. One possible benefit of setting the FREETDS environment variable and using a different installation directory for freetds.conf is that C:\ is very predictable to a hacker that knows anything about FreeTDS and that is the first place that he would look if he wanted to compromise your system. So, using a different installation directory would just make your system stronger. See the FreeTDS [http://www.freetds.org/userguide/envvar.htm Setting the environment variables] documentation for more information about this FREETDS environment variable.&lt;br /&gt;
&lt;br /&gt;
*Alternatively, you can [[Development:Compiling FreeTDS under Windows|recompile]] the FreeTDS extension yourself and change the default location to your preferred location at compile time. Then it is not necessary to create any environment variable. You must just ensure that freetds.conf is in the same folder that you specify when you compile php_dblib.dll.&lt;br /&gt;
&lt;br /&gt;
*MSSQL is usually installed with port 1433 as the default. However, if the port was changed on your server when you installed MSSQL then you need to specify the correct port number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Your Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;mssql&#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 NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;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. Alternatively you can use the config-dist.php file that comes with the Moodle package to create your own config.php file.&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. Database conection test, try this PHP script, just put in a text file called test.php change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to suite your setup, and load from local host (http://localhost/test.php)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	$link = mssql_connect(&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;);&lt;br /&gt;
	if(!$link) {&lt;br /&gt;
		echo&#039;Could not connect&#039;;&lt;br /&gt;
		die(&#039;Could not connect: &#039; . mssql_error());&lt;br /&gt;
	}&lt;br /&gt;
	echo&#039;Successful connection&#039;;&lt;br /&gt;
	mssql_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
If you encounter some problems you can try:&lt;br /&gt;
*check that you have DotNet framework 1.1 installed (later version are installed on Vista, but you could need this specific one)&amp;lt;br /&amp;gt;&lt;br /&gt;
*enable TCP/IP for MSSQL: SQL Server 2005 Network Configuration -&amp;gt; Protocols for MSSQLSERVER -&amp;gt; TCP/IP (Enable) -&amp;gt; Properties -&amp;gt; Ip Addresses -&amp;gt; 127.0.0.1 (Active+Enable)&amp;lt;br /&amp;gt;&lt;br /&gt;
*make sure the SQL Server Browser service is running SQL Server 2005 Network Configuration -&amp;gt; SQL Server Services&amp;lt;br /&amp;gt;&lt;br /&gt;
*if you are using SQL Server 2005 and you have the error &#039;&#039;4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier&#039;&#039;, try the ODBTP method (next chapter). The SQL Server complaining that it doesn&#039;t support pure Unicode via TDS or older versions of ODBC. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren&#039;t accessible via DB-Library so if you need them, you could have to switch away from tools based on TDS and DB-Library :(&lt;br /&gt;
&lt;br /&gt;
== FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) ==&lt;br /&gt;
This is a good read to [http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/ building a FreeTDS based mssql extension for apache on Ubuntu]. Do note that [http://www.freetds.org/news.html freeTDS] 0.91 was recently released, you can find latest versions [http://freetds.sourceforge.net/ here]. &lt;br /&gt;
&lt;br /&gt;
Note: the freetds.conf file you use should have &amp;quot;text size = 20971520&amp;quot; as mentioned in the FreeTDS on Windows section otherwise you might see sessions logging out or worse apache segmentation faults. Also see [[FreeTDS]].&lt;br /&gt;
&lt;br /&gt;
Note2: Please note that updating php tends to remove the freetds configurations. You might need to reconfigure freetds after an upgrade&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on Debian Lenny ==&lt;br /&gt;
I found the following solution using:&lt;br /&gt;
* PHP Version 5.2.6-1+lenny9&lt;br /&gt;
* Microsoft SQL Server Enterprise Edition, version: 9.00.4053.00&lt;br /&gt;
&amp;lt;pre&amp;gt;apt-get install libsybdb5 freetds-common php5-sybase&lt;br /&gt;
/etc/init.d/apache2 restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
At the end of the process, if all goes fine, you will find in the mssql section of phpinfo();&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MSSQL Support&lt;br /&gt;
! enabled&lt;br /&gt;
|-&lt;br /&gt;
| Library version &lt;br /&gt;
| FreeTDS &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once FreeTDS is correctly installed, don not forget to set it up following explanations in https://docs.moodle.org/en/FreeTDS&lt;br /&gt;
&lt;br /&gt;
== See also ==&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:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;br /&gt;
[[Category:SQL databases]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/311/en/index.php?title=Using_the_Microsoft_SQL_Server_Driver_for_PHP&amp;diff=108368</id>
		<title>Using the Microsoft SQL Server Driver for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/311/en/index.php?title=Using_the_Microsoft_SQL_Server_Driver_for_PHP&amp;diff=108368"/>
		<updated>2013-12-13T16:58:40Z</updated>

		<summary type="html">&lt;p&gt;Stronk7: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
== Using the SQL Server Driver for PHP from Microsoft ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This short manual is for running Moodle 2.0 (and upwards) using the Microsoft SQL Server (MSSQL) RDBMS. The 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, the minimum required version of MSSQL has been stabilized to MSSQL 2005 (v.9).&lt;br /&gt;
&lt;br /&gt;
== Installation overview ==&lt;br /&gt;
1. Install Microsoft SQL Server including SQL Server Management Studio. ([http://www.microsoft.com/sql/editions/express/default.mspx A free version, SQL Server Express Edition] is available for testing.)&lt;br /&gt;
:Make sure to choose mixed authentication (Windows and local accounts) to keep things simpler later.  Define the &amp;quot;sa&amp;quot; account password when requested (it&#039;s the default System Administrator account which has full access to all databases by default).&lt;br /&gt;
&lt;br /&gt;
2. Configure Windows for MSSQL.&lt;br /&gt;
:By default, MSSQL listens to port 1433 for incoming TCP/IP connections and this port needs to be opened in the firewall. This is explicitly configured in the firewall installed (either Windows Firewall in the Control Panel or the configuration interface for other firewalls). If the port was changed when MSSQL was installed, then specify the correct port number to open in the firewall.&lt;br /&gt;
:Confirm the TCP/IP protocol is enabled in: &#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. Create and configure a new database.&lt;br /&gt;
:Open &amp;quot;SQL Server Management Studio&amp;quot; and create a new empty database.&lt;br /&gt;
*Execute the following command to enable Row Versioning:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 USE MASTER&lt;br /&gt;
 GO&lt;br /&gt;
 ALTER DATABASE &amp;amp;lt;your-database-name&amp;amp;gt; SET READ_COMMITTED_SNAPSHOT ON&lt;br /&gt;
 GO&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Install PHP and a web server.&lt;br /&gt;
*PHP can be downloaded from [http://www.php.net/downloads.php www.php.net]&lt;br /&gt;
*If IIS is used as the web server, IIS 7.0 or later is recommended with [http://www.iis.net/download FastCGI and WinCache]. &lt;br /&gt;
&lt;br /&gt;
5. Install the SQL Server Driver for PHP.&lt;br /&gt;
:On the web server, install [http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=20098 SQL Server Driver for PHP] including all the pre-requisites listed on the download page. Note: it is critical to install the SQL Server Native Access Client version documented on the download page of the SQL Server Driver for PHP.&lt;br /&gt;
:Configure PHP to use the appropriate SQLSRV driver. In php.ini, set the following:&lt;br /&gt;
&lt;br /&gt;
For PHP 5.2.4 (or later)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [PHP_SQLSRV]&lt;br /&gt;
 extension=php_sqlsrv_52_nts_vc9.dll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For PHP 5.3.2 (or later)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [PHP_SQLSRV]&lt;br /&gt;
 extension=php_sqlsrv_53_nts_vc9.dll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Microsoft documentation for the SQL Server Driver for PHP is available at: http://msdn.microsoft.com/en-us/library/ee229548(v=SQL.10).aspx &lt;br /&gt;
&lt;br /&gt;
6. Install and configure Moodle.&lt;br /&gt;
:Continue with the [[Installing Moodle|standard Moodle installation]].&lt;br /&gt;
&lt;br /&gt;
7. The Moodle &#039;&#039;&#039;config.php&#039;&#039;&#039; should include lines like these:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;sqlsrv&#039;;         // Required&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // Assuming that MSSQL is on the same server, otherwise &lt;br /&gt;
                                    // use the actual name or IP address of your database server&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // The name of the newly created Moodle database&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // Usually 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 =  true;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;           // The prefix can be changed per individual preferences, &lt;br /&gt;
                                    // but NEVER leave this blank!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:If the config.php file doesn&#039;t exist, it will be generated as normal from the Moodle installer. Alternatively, use the config-dist.php file that comes with the Moodle package to create a custom config.php file.&lt;br /&gt;
&lt;br /&gt;
8. Restart or start your web server.&lt;br /&gt;
:If Moodle still cannot communicate with the database server, turn &#039;&#039;&#039;display_startup_errors&#039;&#039;&#039; to &amp;quot;On&amp;quot; in the /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;
9. Test the database connection.&lt;br /&gt;
:Try this PHP script, just add a text file called test.php from the example below and change (&#039;localhost&#039;, &#039;db_user&#039;, &#039;db_password&#039;) to align with the config.php settings, and load from local host (http://localhost/test.php).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$link = sqlsrv_connect($this-&amp;gt;dbhost, array(&#039;UID&#039; =&amp;gt; &#039;db_user&#039;, &#039;PWD&#039; =&amp;gt; &#039;db_password&#039;));&lt;br /&gt;
if($link === FALSE) {&lt;br /&gt;
    echo &#039;Could not connect&#039;;&lt;br /&gt;
    die(&#039;Could not connect: &#039; . sqlsrv_errors(SQLSRV_ERR_ALL));&lt;br /&gt;
}&lt;br /&gt;
echo &#039;Successful connection&#039;;&lt;br /&gt;
sqlsrv_close($link);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. Complete the rest of the Moodle installation as usual.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* [[Installing MSSQL for PHP]], about how to install Moodle on SQL*Server using the FreeTDS drivers.&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* Microsoft SQL Server Driver for PHP solves major Moodle performance problems. See: [http://moodle.org/mod/forum/discuss.php?d=183987 Hardware and Performance Forum]&lt;br /&gt;
&lt;br /&gt;
[[Category:XMLDB]]&lt;/div&gt;</summary>
		<author><name>Stronk7</name></author>
	</entry>
</feed>