<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aparup</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aparup"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/Special:Contributions/Aparup"/>
	<updated>2026-04-14T10:55:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Usage&amp;diff=114333</id>
		<title>Usage</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Usage&amp;diff=114333"/>
		<updated>2014-08-27T03:32:13Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Maintenance */ updates as a result of work in MDLSITE-2300&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{About Moodle}}&lt;br /&gt;
==Who uses Moodle?==&lt;br /&gt;
&lt;br /&gt;
Moodle is used by a variety of institutions and individuals, including:&lt;br /&gt;
* Universities &lt;br /&gt;
* High schools &lt;br /&gt;
* Primary schools&lt;br /&gt;
* Government departments &lt;br /&gt;
* Healthcare organisations &lt;br /&gt;
* Military organistions&lt;br /&gt;
* Airlines&lt;br /&gt;
* Oil companies &lt;br /&gt;
* Homeschoolers&lt;br /&gt;
* Independent educators&lt;br /&gt;
* special educators&lt;br /&gt;
&lt;br /&gt;
==How many Moodle sites are there==&lt;br /&gt;
There are tens of thousands of registered Moodle sites in the sites list that we maintain; however it is impossible to know exactly how many Moodle sites exist because Moodle is open source, free to download and distribute, and doesn&#039;t force registration on its users. Very often we find people, will not inform us about their sites.&lt;br /&gt;
&lt;br /&gt;
For up-to-date summary statistics about registered sites browse the [http://moodle.org/stats/ Moodle Statistics] page. Statistics shown on this page are updated daily to provide an accurate summary of collected information.&lt;br /&gt;
You can also browse the [http://moodle.org/sites/ Moodle Sites] page, which provides a useful list of registered sites grouped by country for all sites that have chosen to make their information public.&lt;br /&gt;
&lt;br /&gt;
==How statistics are collected and maintained==&lt;br /&gt;
===Registration===&lt;br /&gt;
All information collected by moodle.org is from site administrators that have registered their sites with us. For security and privacy reasons registration has been made a manual process that only a site administrator can undertake.&lt;br /&gt;
Registration can be undertaken by clicking on the Registration button shown in the site administration block under Notification, and filling out the simple form that then gets sent back to us.&lt;br /&gt;
&lt;br /&gt;
Sites can update the registration information we hold about them at any time them by repeating the manual process.&lt;br /&gt;
It is important to note that because of the manual process information that is collected by moodle.org may be out of date.&lt;br /&gt;
&lt;br /&gt;
Moodle since version 1.0 has allowed users to register their sites with us, registration being something that we encourage all publicly available sites to do.&lt;br /&gt;
You can read more about registration, the registration process and what is collected on the [[Moodle registration|Moodle Registration]] page.&lt;br /&gt;
&lt;br /&gt;
===Moderation===&lt;br /&gt;
To ensure that the statistics that we collect are as accurate as possible there are certain conditions that a registered site has to meet in order to be included into both the statistics and sites pages.&lt;br /&gt;
&lt;br /&gt;
When a site first registers we check the information about the site to ensure that the URL they have provided is valid and that the email address for the site administrator is a valid email address.&lt;br /&gt;
We also at this point sanity check the information being collected to remove obvious test sites.&lt;br /&gt;
&lt;br /&gt;
===Maintenance===&lt;br /&gt;
Like most of the web many sites come and go. Since we strive to maintain accurate statistics we need to check registered sites on a regular basis and clean out old data.&lt;br /&gt;
A sophisticated, automated site check process is used to undertake the task of checking every registered site on a weekly basis.&lt;br /&gt;
&lt;br /&gt;
In checking registered sites every sites is visited by our site check program that then evaluates and scores each site individually based on a collection of a number of defined rules that we have set to identify each and every Moodle release. The score that a site receives determines whether the site is included in the sites list or not.&lt;br /&gt;
Any site that fails the evaluation is then removed from the [http://moodle.net/sites sites list] and not included in any [http://moodle.net/stats statistics].&lt;br /&gt;
&lt;br /&gt;
===Ensuring your site passes the weekly evaluation===&lt;br /&gt;
To ensure that your site passes the weekly evaluation check that your site meets the following three criteria.&lt;br /&gt;
* Check the URL you registered is the URL of your Moodle registration. We check only the page returned from the URL you registered, we don&#039;t dig down into your site, or search any alternatives.&lt;br /&gt;
* Check the site is publicly available on the Internet. We can&#039;t check your site if it is only available locally, or has been wrapped in any means of authentication.&lt;br /&gt;
* Ensure you have content when you register your site. If you don&#039;t have any content when you register it is likely we will dismiss your site as a test site. Ensure that you have created at least one course, and three users within your installation before registering.&lt;br /&gt;
&lt;br /&gt;
If you want to find out when we last came through you can check your personal site statistics or web server logs and look for page requests on your registered URL that have the following user agent&lt;br /&gt;
&#039;&#039;moodle.org Link Checker (http://moodle.org/sites/)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[:Category:Installations|Moodle installation listings]]&lt;br /&gt;
&lt;br /&gt;
[[de:Nutzung]]&lt;br /&gt;
[[es:Uso]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=You_Might_Be_a_Moodler&amp;diff=114221</id>
		<title>You Might Be a Moodler</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=You_Might_Be_a_Moodler&amp;diff=114221"/>
		<updated>2014-08-19T07:23:15Z</updated>

		<summary type="html">&lt;p&gt;Aparup: &amp;#039;Using Moodle -&amp;gt; &amp;#039;Moodle in English&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In the spirit of Jeff Foxworthy&#039;s &#039;&#039;You Might be a Redneck&#039;&#039; - http://www.jefffoxworthy.com/comedy/jod/index.shtml &lt;br /&gt;
&lt;br /&gt;
*If you have ever turned on a football game and and the orange uniforms of one team caused you to leap up from the sofa and check out moodle.org, you might be a Moodler.&lt;br /&gt;
&lt;br /&gt;
*If you type &amp;quot;moodle.org&amp;quot; in your browser when you intend to type &amp;quot;google.com.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*If you look up recipes in moodle.org.&lt;br /&gt;
&lt;br /&gt;
*If you look up recipes in moodle.org... and [http://moodle.org/mod/forum/discuss.php?d=5395&amp;amp;parent=30227 find them]!&lt;br /&gt;
&lt;br /&gt;
*If you can spell &#039;&#039;&#039;Dougiamas&#039;&#039;&#039; without having to look it up.&lt;br /&gt;
&lt;br /&gt;
*If you can &#039;&#039;pronounce&#039;&#039; &#039;&#039;&#039;Dougiamas&#039;&#039;&#039; without having to look it up.&lt;br /&gt;
&lt;br /&gt;
*If you check the Moodle forums at 8:30 on a Saturday night.&lt;br /&gt;
&lt;br /&gt;
*If you find yourself heading to the bugtracker when the dishwasher is broken.&lt;br /&gt;
&lt;br /&gt;
*If you start seeing double square brackets around words you don&#039;t know the translation of.&lt;br /&gt;
&lt;br /&gt;
*If your neighbours wonder why you named your cats Helen and Howard.&lt;br /&gt;
&lt;br /&gt;
*Your spouse wants you to take up golf again because they hate being a &#039;moodle widow(er)&#039; more.&lt;br /&gt;
&lt;br /&gt;
*You describe the color of something as &amp;quot;Moodle&amp;quot; orange.&lt;br /&gt;
&lt;br /&gt;
*If you find yourself logging in to moodle.org during your summer holiday in Italy instead of enjoying the beautiful view or going to the beach. (Hi from Italy, Sigi)&lt;br /&gt;
&lt;br /&gt;
*If you come all the way from Germany to the US during your summer holiday and in addition to visiting lots of places you must absolutely go to a small town in South Carolina to find out about the latest Moodle tricks&lt;br /&gt;
&lt;br /&gt;
*You try to figure out how to grade e-mails from your friends without a drop down box&lt;br /&gt;
&lt;br /&gt;
*You find moodle.org is down for some reason and the first thing you want to do is post on moodle.org about it.&lt;br /&gt;
&lt;br /&gt;
*Every verb you use is &#039;to moodle&#039;.&lt;br /&gt;
&lt;br /&gt;
*You go into a Chinese restaurant and ask for a side order of Moodles with your Egg Foo Young.&lt;br /&gt;
&lt;br /&gt;
*You talk about Moodle so much that your non-Moodling, non-native English speaking husband asks if the noodles on the plate in front of him are moodles and when you ask him if that is what he meant to say he replies, &amp;quot;Yes, aren&#039;t they moodles?&amp;quot; (based on a true story)&lt;br /&gt;
&lt;br /&gt;
*You know that the course id for &#039;&#039;&#039;Moodle in English&#039;&#039;&#039; is 5.&lt;br /&gt;
&lt;br /&gt;
*And even if you drive a car, you always drive it in &#039;&#039;&#039;5&#039;&#039;&#039;th gear.&lt;br /&gt;
&lt;br /&gt;
*You throw away all but the orange M&amp;amp;amp;M&#039;s.&lt;br /&gt;
&lt;br /&gt;
*You eat all but the orange M&amp;amp;amp;M&#039;s (and keep it for good &#039;&#039;feng shui&#039;&#039; in your desktop).&lt;br /&gt;
&lt;br /&gt;
*You try to convince your wife and kids that there is a Disney Park in Perth.&lt;br /&gt;
&lt;br /&gt;
*The homepage of your computer is http://www.moodle.org.&lt;br /&gt;
&lt;br /&gt;
*The homepage of every computer you have ever laid hands on is http://www.moodle.org.&lt;br /&gt;
&lt;br /&gt;
*You only recently discovered that typing an address in your browser takes you to a page outside Moodle.org&lt;br /&gt;
 &lt;br /&gt;
*You sometimes refer to your third child as &#039;&#039;&#039;1.3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Your default response to a rerun on TV is to fire up the laptop and check out moodle.org.&lt;br /&gt;
&lt;br /&gt;
*If you put little labels on your TV&#039;s remote control that say... view.php?id=1, view.php?id=2, etc ...&lt;br /&gt;
&lt;br /&gt;
*You have five browser windows open right now, four of which are Moodle sites.&lt;br /&gt;
&lt;br /&gt;
*Reading the moodle.org forums is part of the morning routine:  coffee, newspaper, wake up the children. . .&lt;br /&gt;
&lt;br /&gt;
*You find yourself adding items to a list that only the Moodle clique will understand.&lt;br /&gt;
&lt;br /&gt;
*You tell people to &amp;quot;Keep Moodling&amp;quot; and that they have been &amp;quot;Moodlised&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*If instead of saying &#039;&#039;Have a good day&#039;&#039; you begin greeting folks by saying &#039;&#039;Happy Moodling!&#039;&#039; and even worse when you actually believe that the two statements mean the same thing. {Based on a true story}&lt;br /&gt;
&lt;br /&gt;
*If normal words start being morphed into &#039;&#039;Moodle-isms&#039;&#039;. For example, when someone asks &#039;&#039;How are you?&#039;&#039; you begin to reply with words like Moodle-rrific and Moodle-tastic. Subsequently, you get confused when someone gives you a quizzical look because they do not understand what have just said. {Based on a true story}&lt;br /&gt;
&lt;br /&gt;
*If your students start showing up to the Friday night football games wanting to know when the Moodle chant is going to begin and students begin painting  &#039;&#039;MOODLE&#039;&#039; on their chests! {Based on a true story}&lt;br /&gt;
&lt;br /&gt;
*You get custom plates for your new car... [http://moodle.org/mod/forum/discuss.php?d=54899 Moodle Plate]&lt;br /&gt;
&lt;br /&gt;
*You get a quote on a custom paint job for your new car [http://classroomrevolution.com/jeff/moodleorange.jpg Moodle Orange Car]&lt;br /&gt;
&lt;br /&gt;
* You are looking forward to Christmas vacation so that you will have time to upgrade Moodle!&lt;br /&gt;
&lt;br /&gt;
* You read something interesting and your first thought is, &amp;quot;I have to post that at moodle.org.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* You forget that the comment you just ignored from a co-worker won&#039;t be retrievable later in a Recent Activities block.&lt;br /&gt;
&lt;br /&gt;
* When in the supermarket, you prefer to buy orange capsicums (peppers) rather than any other colour.&lt;br /&gt;
&lt;br /&gt;
* If you go to http://moodle.org instead of http://google.com and try some (global) searches there, only realizing after some attempts that you are looking within Moodleland only. {Based on a true story}&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MNet&amp;diff=112744</id>
		<title>MNet</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MNet&amp;diff=112744"/>
		<updated>2014-05-22T08:12:47Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Assigning the role of admin */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Authentication}}&lt;br /&gt;
The Moodle network feature allows a Moodle administrator to establish a link with another Moodle or a Mahara site and to share some resources with the users of that Moodle. Users go from the first Moodle to the linked site via the [[Network servers block]].&lt;br /&gt;
&lt;br /&gt;
[[File:Networkserversexample.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The initial release of MNet is bundled with a Authentication Plugin, which makes single-sign-on between Moodles possible. A user with the username &amp;lt;em&amp;gt;jody&amp;lt;/em&amp;gt; logs in to her Moodle server as normal, and clicks on a link that takes her to a page on another Moodle server. Normally, she would have only the privileges of a guest on the remote Moodle, but behind the scenes, single-sign-on has established a fully authenticated session for Jody on the remote site.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING:&#039;&#039;&#039;  MNet requires the use of &#039;&#039;&#039;xmlrpc&#039;&#039;&#039;. Please go to your phpinfo page if you are interested in using this and search for --with-xmlrpc.  If your php has not been compiled with xmlrpc then you need to address that first! At present it appears that PEAR xmlrpc will not work.&lt;br /&gt;
[[Image:Administration Block Users Authentication MoodleNetwork.jpg|thumb|MNet setting in &#039;&#039;Admin &amp;gt; User &amp;gt; Authentication &amp;gt; Moodle Network]]&lt;br /&gt;
&lt;br /&gt;
==Security==&lt;br /&gt;
The MNet feature requires that your server has the &#039;&#039;&#039;Curl&#039;&#039;&#039; and &#039;&#039;&#039;OpenSSL&#039;&#039;&#039; extensions installed. Your system will generate a OpenSSL certificate for encrypted communication with other Moodles, and will rotate encryption keys on a monthly basis (approx).&lt;br /&gt;
&lt;br /&gt;
Communication takes place over an XML-RPC transport, and the XML-RPC documents are wrapped first in an XMLDSIG (XML digital signature) envelope, and then in an XMLENC (XML encryption) envelope. The encryption all happens within PHP, and does not require an https (Apache SSL) server.&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
*[http://www.w3.org/TR/xmldsig-core/ XML Digital Signatures]&lt;br /&gt;
*[http://www.w3.org/TR/xmlenc-core/ XML Encryption]&lt;br /&gt;
&lt;br /&gt;
A special mode can be enabled which would allow a machine with a specified IP address to make calls to the XML-RPC layer without using either encryption or signature envelopes. This mode is provided to enable Moodle to communicate with other software systems in which the integration of signatures and encryption might be prohibitively difficult. It is not envisioned that unencrypted inter-Moodle networking will ever be enabled.&lt;br /&gt;
&lt;br /&gt;
==Peer to Peer Network==&lt;br /&gt;
&lt;br /&gt;
This is the basic layout of the system. It can be very useful to run one Moodle per faculty or departments, each with its own user management, and yet permit users to roam across the Moodle installs... subject to permissions of course. &lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
&lt;br /&gt;
The instructions will cover 2 Moodle installations: MoodleA and MoodleB. Both are installed correctly and have never had a Moodle Network configuration.&lt;br /&gt;
&lt;br /&gt;
Note: If you experience problems, ensure debugging is turned on in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Debugging&#039;&#039;. Extra diagnostic messages may be displayed.&lt;br /&gt;
&lt;br /&gt;
You need to first enable Networking in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Advanced Features&#039;&#039;. This will add the &amp;quot;Networking&amp;quot; menu to the Site Administration menu.&lt;br /&gt;
&lt;br /&gt;
# Get them to talk to each other&lt;br /&gt;
## Ensure &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Environment&#039;&#039; indicates you have curl installed&lt;br /&gt;
## If MoodleA and MoodleB are hosted in the same domain, ensure they have a different cookie prefix. Note that changing the cookie prefix will log you out! You can change the cookie prefix via &#039;&#039;Admin &amp;gt; Server &amp;gt; Session Handling&#039;&#039;.&lt;br /&gt;
## On both, go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Network &amp;gt; Settings&#039;&#039; and turn Networking ON.&lt;br /&gt;
## On MoodleA go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Network &amp;gt; Manage peers&#039;&#039; - put the URL of MoodleB under &amp;quot;Add New Host&amp;quot; and click Add. The URL should include the directory where your Moodle code is located and may include the protocol as well, for example &#039;&#039;https://www.mymoodle.org/moodle&#039;&#039;.&lt;br /&gt;
## Do the equivalent on MoodleB.&lt;br /&gt;
# Get user roaming going&lt;br /&gt;
[http://moodle.org/mod/forum/discuss.php?d=141491] ). On both servers: &lt;br /&gt;
### Go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; Manage authentication&#039;&#039;. Enable &#039;&#039;MNet Authentication&#039;&#039; by clicking the &#039;enable&#039; icon.&lt;br /&gt;
## On MoodleA go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Networking &amp;gt; (Manage) Peers&#039;&#039;, click on &#039;MoodleB&#039;, and click on the &#039;Services&#039; tab. Enable SSO-IDP (SSO Identity Provider) publish and subscribe, and SSO-SP (SSO Service Provider) publish and subscribe.&lt;br /&gt;
## Do the equivalent on MoodleB. (By both publishing and subscribing you allow users to move freely between the two servers. By only publishing or subscribing between servers you create a one way traversal)&lt;br /&gt;
## On both, go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define Roles&#039;&#039;, only roles that have &amp;quot;Roam to a remote Moodle moodle/site:mnetlogintoremote&amp;quot; will be allowed to roam. Grant the privilege as appropriate.&lt;br /&gt;
### eg. enabling for &#039;&#039;Authenticated user&#039;&#039; allows any authenticated user to roam between servers.&lt;br /&gt;
## On both servers, go to the homepage, and add the &#039;Network Servers&#039; block.&lt;br /&gt;
## To test, it is recommended to use a different browser (even on a different machine) that is logged in to neither. Login to MoodleA with a non-administrator account that has the permissions to roam. You should see the Network Servers block, and clicking on it you should go to MoodleB with a newly autocreated account. &lt;br /&gt;
# Get remote enrolments going -- this is optional. It allows an administrator of MoodleB to enrol users that are &amp;quot;native&amp;quot; to MoodleB in remote courses in MoodleA, and viceversa.&lt;br /&gt;
## On both, go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Enrolments &amp;gt; Manage enrol plugins&#039;&#039; and enable Moodle Network enrolment plugin (click Save). Click on &#039;Edit&#039; and enable &#039;allow_allcourses&#039; or select some courses or categories to be remotely enrolled.&lt;br /&gt;
## On the server you want to receive enrolments:&lt;br /&gt;
### Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Enrolments &amp;gt; Manage enrol plugins&#039;&#039;. Enable &#039;&#039;MNet remote enrolments&#039;&#039; by clicking the &#039;enable&#039; icon. (For &#039;&#039;MNet remote enrolments&#039;&#039; settings info see [[MNet_remote_enrolments|MNet remote enrolments]])&lt;br /&gt;
## On MoodleA go to &#039;&#039;Admin &amp;gt; Network &amp;gt; Peers&#039;&#039;, click on &#039;MoodleB&#039;, and click on the &#039;Services&#039; tab. Enable Enrolment publish and/or subscribe.&lt;br /&gt;
## Do the equivalent on MoodleB.&lt;br /&gt;
## On every course you want to allow enrolments into:&lt;br /&gt;
### Enter course and go to &#039;&#039;Administration &amp;gt; Course administration &amp;gt; Users &amp;gt; Enrolment methods&#039;&#039;&lt;br /&gt;
### From &#039;&#039;Add method&#039;&#039; drop-down select &#039;&#039;MNet remote enrolments&#039;&#039;&lt;br /&gt;
### On the new screen select the &#039;&#039;Remote host&#039;&#039; you want to allow enrolments from, the Role for the enrolled users, and click save. (Note: you can only add a single &#039;&#039;MNet remote enrolments&#039;&#039; method per course.)&lt;br /&gt;
&lt;br /&gt;
===Using it===&lt;br /&gt;
&lt;br /&gt;
# In MoodleA go to &#039;&#039;Admin &amp;gt; Networking &amp;gt; Remote enrolments client&#039;&#039;. You will see MoodleB listed. Click on &#039;&#039;Edit enrolments&#039;&#039; button beside MoodleB and you will see a list of courses that MoodleB offers for remote enrolment. Click &#039;Edit enrolments&#039;&#039;, select the users you want to enroll, and then click Add to enroll them in the course.&lt;br /&gt;
&lt;br /&gt;
==Connecting to a Mnet hub==&lt;br /&gt;
A Mnet hub (do not confuse it with the [[Community hub]]) is a Moodle server that is configured to accept connections from other Moodle servers, and to provide a set of services to users of these other servers. This guideline will direct you to connect to a Mnet hub, assess the services it has to offer, and enable those services for your users.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
# Get talking to the Hub&lt;br /&gt;
## Ensure that the &#039;&#039;Admin &amp;gt; Server &amp;gt; Environment&#039;&#039; page indicates you have curl and openssl installed&lt;br /&gt;
## Go to &#039;&#039;Admin &amp;gt; Network &amp;gt; Settings&#039;&#039; and turn Networking on&lt;br /&gt;
## Go to &#039;&#039;Admin &amp;gt; Network &amp;gt; Peers&#039;&#039; and enter the URL of Mnet Hub under &amp;quot;Add New Host&amp;quot;. Click &amp;lt;em&amp;gt;Add&amp;lt;/em&amp;gt;&lt;br /&gt;
## The host details for the Mnet Hub should appear with the Site Name field already populated. Click &amp;lt;em&amp;gt;Save changes&amp;lt;/em&amp;gt;&lt;br /&gt;
## The details will be written to your database and two new tabs will appear in this window: &#039;Services&#039; and &#039;Logs&#039;. Click &amp;lt;em&amp;gt;Services&amp;lt;/em&amp;gt;&lt;br /&gt;
##A list of services will appear, each with a checkbox for &#039;publish&#039; and &#039;subscribe&#039;. Check the checkboxes for any services you want to publish or subscribe to&lt;br /&gt;
&lt;br /&gt;
===Using it===&lt;br /&gt;
If the Mnet Hub has already enabled a service for you, there will be a tick alongside the appropriate checkbox, for example: if the Hub is &amp;lt;em&amp;gt;publishing&amp;lt;/em&amp;gt; Moodle Networked Enrolment, then a tick will appear alongside the &amp;lt;em&amp;gt;subscribe&amp;lt;/em&amp;gt; checkbox for this service. Note that in order to enable some functionality, prominently &amp;lt;em&amp;gt;single-sign-on&amp;lt;/em&amp;gt;, you may have to &amp;lt;em&amp;gt;publish&amp;lt;/em&amp;gt; a service, e.g. the &amp;lt;em&amp;gt;Identity Provider&amp;lt;/em&amp;gt; service. The Mnet Hub will access this service on your Moodle, asking it to authenticate your users.&lt;br /&gt;
# Enable Roaming&lt;br /&gt;
## Subscribe to &amp;lt;em&amp;gt;SSO (Service Provider)&amp;lt;/em&amp;gt; by checking the box&lt;br /&gt;
## Publish &amp;lt;em&amp;gt;SSO (Identity Provider)&amp;lt;/em&amp;gt; by checking the box&lt;br /&gt;
## Click &amp;lt;em&amp;gt;Save changes&amp;lt;/em&amp;gt;&lt;br /&gt;
## Go to &#039;&#039;Admin &amp;gt; Users &amp;gt; Permissions &amp;gt; Define Roles&#039;&#039;, and grant the capability &amp;lt;em&amp;gt;Roam to a remote Moodle moodle/site:mnetlogintoremote&amp;lt;/em&amp;gt; to an appropriate role&lt;br /&gt;
## Go to &#039;&#039;Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; Manage authentication&#039;&#039; and enable the &amp;lt;em&amp;gt;Moodle Network authentication&amp;lt;/em&amp;gt; plugin&lt;br /&gt;
## Go to your homepage, turn on editing, and add the &#039;Network Servers&#039; block&lt;br /&gt;
## Using a different web-browser, log on as a non-admin user who inhabits the role you granted the roaming capability to&lt;br /&gt;
## Note that the Mnet Hub is listed in the Network Servers block on the homepage. Click on the link to that server&lt;br /&gt;
## Some of your user details will be transferred to the Mnet Hub server, and a browsing session will be started for you as if you had logged on there directly&lt;br /&gt;
# Enable Networked Enrolment&lt;br /&gt;
## Return to the web browser you&#039;ve been using as the site administrator&lt;br /&gt;
## Go to &#039;&#039;Admin &amp;gt; Network &amp;gt; Peers&#039;&#039; and click on the entry for the Mnet Hub.&lt;br /&gt;
## Click on the Services tab&lt;br /&gt;
## Subscribe to &amp;lt;em&amp;gt;Moodle Networked Enrolment&amp;lt;/em&amp;gt;&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Enrolments &amp;gt; Manage enrol plugins&#039;&#039; and enable the &amp;lt;em&amp;gt;Moodle Network enrolment&amp;lt;/em&amp;gt; plugin. Click &amp;lt;em&amp;gt;Save changes&amp;lt;/em&amp;gt;&lt;br /&gt;
## Click on &amp;lt;em&amp;gt;edit&amp;lt;/em&amp;gt; to view the details for networked enrolments.&lt;br /&gt;
## Go to &#039;&#039;Admin &amp;gt; Networking &amp;gt; Enrolments&#039;&#039; to see a list of Moodle servers that offer this service to you&lt;br /&gt;
## Click on a server name to view a list of courses that the server offers to your users&lt;br /&gt;
## Click on a course name, to view a list users that you can enrol in this course&lt;br /&gt;
## Enrol users&lt;br /&gt;
## Profit!&lt;br /&gt;
&lt;br /&gt;
==Running a Mnet hub==&lt;br /&gt;
A Mnet hub is a regular Moodle site that runs in a special mode. As a Moodle Administrator, when you add another Moodle site to your list of network peers, your Moodle will contact that site to find out what it is called, and to request its public key for encrypted communication. Normally, the remote server will simply provide this information without making any record of the transaction.&lt;br /&gt;
&lt;br /&gt;
A Mnet hub is different. As soon as you add an entry for a Mnet hub to your system, the Mnet hub will create an entry for your server in its list of hosts, and may immediately begin to offer services to the users of your site.&lt;br /&gt;
&lt;br /&gt;
This section will guide you to set up a Mnet hub, and select services to offer to all comers.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Enable Networking&lt;br /&gt;
# Ensure that the &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; Environment&#039;&#039; page indicates you have curl and openssl installed&lt;br /&gt;
# Go to &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Network &amp;gt; Settings&#039;&#039; and turn Networking on &lt;br /&gt;
# Go to &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Network &amp;gt; Peers&#039;&#039; and tick the checkbox for &amp;lt;em&amp;gt;Register all hosts&amp;lt;/em&amp;gt;. Click on &amp;lt;em&amp;gt;Save Changes&amp;lt;/em&amp;gt;&lt;br /&gt;
# On the same page, the first entry in your list of hosts should be &amp;lt;em&amp;gt;All hosts&amp;lt;/em&amp;gt;. Click this link&lt;br /&gt;
# Click on &amp;lt;em&amp;gt;Services&amp;lt;/em&amp;gt; and enable any services you want to offer to all comers&lt;br /&gt;
&lt;br /&gt;
==Assigning the role of admin==&lt;br /&gt;
&lt;br /&gt;
For security reasons, users cannot be assigned the role of admin via the Moodle interface. Instead, admin user IDs must be listed in config.php e.g. &lt;br /&gt;
 $CFG-&amp;gt;siteadmins = &#039;2,45,67&#039;;&lt;br /&gt;
&lt;br /&gt;
Note: This applies to local admins as well as remote admins as this overrides any local DB stored settings that assigns administrative permissions.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Moodle Network FAQ]]&lt;br /&gt;
* [[Upload users]] for csv upload using the &#039;&#039;mnethostid&#039;&#039; field.&lt;br /&gt;
* [[Development:Moodle Network|Moodle Network development notes]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=6976 MNet forum]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=92749 Examples of how people are using Moodle networks] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Enrolment]]&lt;br /&gt;
[[Category:MNet]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Réseau Moodle]]&lt;br /&gt;
[[ja:Moodleネットワーク]]&lt;br /&gt;
[[es:Red Moodle]]&lt;br /&gt;
[[cs:Síťové služby]]&lt;br /&gt;
[[de:Moodle-Netzwerk]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MNet&amp;diff=112743</id>
		<title>MNet</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MNet&amp;diff=112743"/>
		<updated>2014-05-22T08:12:13Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Assigning the role of admin */ added setting overrides DB ones&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Authentication}}&lt;br /&gt;
The Moodle network feature allows a Moodle administrator to establish a link with another Moodle or a Mahara site and to share some resources with the users of that Moodle. Users go from the first Moodle to the linked site via the [[Network servers block]].&lt;br /&gt;
&lt;br /&gt;
[[File:Networkserversexample.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The initial release of MNet is bundled with a Authentication Plugin, which makes single-sign-on between Moodles possible. A user with the username &amp;lt;em&amp;gt;jody&amp;lt;/em&amp;gt; logs in to her Moodle server as normal, and clicks on a link that takes her to a page on another Moodle server. Normally, she would have only the privileges of a guest on the remote Moodle, but behind the scenes, single-sign-on has established a fully authenticated session for Jody on the remote site.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING:&#039;&#039;&#039;  MNet requires the use of &#039;&#039;&#039;xmlrpc&#039;&#039;&#039;. Please go to your phpinfo page if you are interested in using this and search for --with-xmlrpc.  If your php has not been compiled with xmlrpc then you need to address that first! At present it appears that PEAR xmlrpc will not work.&lt;br /&gt;
[[Image:Administration Block Users Authentication MoodleNetwork.jpg|thumb|MNet setting in &#039;&#039;Admin &amp;gt; User &amp;gt; Authentication &amp;gt; Moodle Network]]&lt;br /&gt;
&lt;br /&gt;
==Security==&lt;br /&gt;
The MNet feature requires that your server has the &#039;&#039;&#039;Curl&#039;&#039;&#039; and &#039;&#039;&#039;OpenSSL&#039;&#039;&#039; extensions installed. Your system will generate a OpenSSL certificate for encrypted communication with other Moodles, and will rotate encryption keys on a monthly basis (approx).&lt;br /&gt;
&lt;br /&gt;
Communication takes place over an XML-RPC transport, and the XML-RPC documents are wrapped first in an XMLDSIG (XML digital signature) envelope, and then in an XMLENC (XML encryption) envelope. The encryption all happens within PHP, and does not require an https (Apache SSL) server.&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
*[http://www.w3.org/TR/xmldsig-core/ XML Digital Signatures]&lt;br /&gt;
*[http://www.w3.org/TR/xmlenc-core/ XML Encryption]&lt;br /&gt;
&lt;br /&gt;
A special mode can be enabled which would allow a machine with a specified IP address to make calls to the XML-RPC layer without using either encryption or signature envelopes. This mode is provided to enable Moodle to communicate with other software systems in which the integration of signatures and encryption might be prohibitively difficult. It is not envisioned that unencrypted inter-Moodle networking will ever be enabled.&lt;br /&gt;
&lt;br /&gt;
==Peer to Peer Network==&lt;br /&gt;
&lt;br /&gt;
This is the basic layout of the system. It can be very useful to run one Moodle per faculty or departments, each with its own user management, and yet permit users to roam across the Moodle installs... subject to permissions of course. &lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
&lt;br /&gt;
The instructions will cover 2 Moodle installations: MoodleA and MoodleB. Both are installed correctly and have never had a Moodle Network configuration.&lt;br /&gt;
&lt;br /&gt;
Note: If you experience problems, ensure debugging is turned on in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Debugging&#039;&#039;. Extra diagnostic messages may be displayed.&lt;br /&gt;
&lt;br /&gt;
You need to first enable Networking in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Advanced Features&#039;&#039;. This will add the &amp;quot;Networking&amp;quot; menu to the Site Administration menu.&lt;br /&gt;
&lt;br /&gt;
# Get them to talk to each other&lt;br /&gt;
## Ensure &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Environment&#039;&#039; indicates you have curl installed&lt;br /&gt;
## If MoodleA and MoodleB are hosted in the same domain, ensure they have a different cookie prefix. Note that changing the cookie prefix will log you out! You can change the cookie prefix via &#039;&#039;Admin &amp;gt; Server &amp;gt; Session Handling&#039;&#039;.&lt;br /&gt;
## On both, go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Network &amp;gt; Settings&#039;&#039; and turn Networking ON.&lt;br /&gt;
## On MoodleA go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Network &amp;gt; Manage peers&#039;&#039; - put the URL of MoodleB under &amp;quot;Add New Host&amp;quot; and click Add. The URL should include the directory where your Moodle code is located and may include the protocol as well, for example &#039;&#039;https://www.mymoodle.org/moodle&#039;&#039;.&lt;br /&gt;
## Do the equivalent on MoodleB.&lt;br /&gt;
# Get user roaming going&lt;br /&gt;
[http://moodle.org/mod/forum/discuss.php?d=141491] ). On both servers: &lt;br /&gt;
### Go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; Manage authentication&#039;&#039;. Enable &#039;&#039;MNet Authentication&#039;&#039; by clicking the &#039;enable&#039; icon.&lt;br /&gt;
## On MoodleA go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Networking &amp;gt; (Manage) Peers&#039;&#039;, click on &#039;MoodleB&#039;, and click on the &#039;Services&#039; tab. Enable SSO-IDP (SSO Identity Provider) publish and subscribe, and SSO-SP (SSO Service Provider) publish and subscribe.&lt;br /&gt;
## Do the equivalent on MoodleB. (By both publishing and subscribing you allow users to move freely between the two servers. By only publishing or subscribing between servers you create a one way traversal)&lt;br /&gt;
## On both, go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define Roles&#039;&#039;, only roles that have &amp;quot;Roam to a remote Moodle moodle/site:mnetlogintoremote&amp;quot; will be allowed to roam. Grant the privilege as appropriate.&lt;br /&gt;
### eg. enabling for &#039;&#039;Authenticated user&#039;&#039; allows any authenticated user to roam between servers.&lt;br /&gt;
## On both servers, go to the homepage, and add the &#039;Network Servers&#039; block.&lt;br /&gt;
## To test, it is recommended to use a different browser (even on a different machine) that is logged in to neither. Login to MoodleA with a non-administrator account that has the permissions to roam. You should see the Network Servers block, and clicking on it you should go to MoodleB with a newly autocreated account. &lt;br /&gt;
# Get remote enrolments going -- this is optional. It allows an administrator of MoodleB to enrol users that are &amp;quot;native&amp;quot; to MoodleB in remote courses in MoodleA, and viceversa.&lt;br /&gt;
## On both, go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Enrolments &amp;gt; Manage enrol plugins&#039;&#039; and enable Moodle Network enrolment plugin (click Save). Click on &#039;Edit&#039; and enable &#039;allow_allcourses&#039; or select some courses or categories to be remotely enrolled.&lt;br /&gt;
## On the server you want to receive enrolments:&lt;br /&gt;
### Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Enrolments &amp;gt; Manage enrol plugins&#039;&#039;. Enable &#039;&#039;MNet remote enrolments&#039;&#039; by clicking the &#039;enable&#039; icon. (For &#039;&#039;MNet remote enrolments&#039;&#039; settings info see [[MNet_remote_enrolments|MNet remote enrolments]])&lt;br /&gt;
## On MoodleA go to &#039;&#039;Admin &amp;gt; Network &amp;gt; Peers&#039;&#039;, click on &#039;MoodleB&#039;, and click on the &#039;Services&#039; tab. Enable Enrolment publish and/or subscribe.&lt;br /&gt;
## Do the equivalent on MoodleB.&lt;br /&gt;
## On every course you want to allow enrolments into:&lt;br /&gt;
### Enter course and go to &#039;&#039;Administration &amp;gt; Course administration &amp;gt; Users &amp;gt; Enrolment methods&#039;&#039;&lt;br /&gt;
### From &#039;&#039;Add method&#039;&#039; drop-down select &#039;&#039;MNet remote enrolments&#039;&#039;&lt;br /&gt;
### On the new screen select the &#039;&#039;Remote host&#039;&#039; you want to allow enrolments from, the Role for the enrolled users, and click save. (Note: you can only add a single &#039;&#039;MNet remote enrolments&#039;&#039; method per course.)&lt;br /&gt;
&lt;br /&gt;
===Using it===&lt;br /&gt;
&lt;br /&gt;
# In MoodleA go to &#039;&#039;Admin &amp;gt; Networking &amp;gt; Remote enrolments client&#039;&#039;. You will see MoodleB listed. Click on &#039;&#039;Edit enrolments&#039;&#039; button beside MoodleB and you will see a list of courses that MoodleB offers for remote enrolment. Click &#039;Edit enrolments&#039;&#039;, select the users you want to enroll, and then click Add to enroll them in the course.&lt;br /&gt;
&lt;br /&gt;
==Connecting to a Mnet hub==&lt;br /&gt;
A Mnet hub (do not confuse it with the [[Community hub]]) is a Moodle server that is configured to accept connections from other Moodle servers, and to provide a set of services to users of these other servers. This guideline will direct you to connect to a Mnet hub, assess the services it has to offer, and enable those services for your users.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
# Get talking to the Hub&lt;br /&gt;
## Ensure that the &#039;&#039;Admin &amp;gt; Server &amp;gt; Environment&#039;&#039; page indicates you have curl and openssl installed&lt;br /&gt;
## Go to &#039;&#039;Admin &amp;gt; Network &amp;gt; Settings&#039;&#039; and turn Networking on&lt;br /&gt;
## Go to &#039;&#039;Admin &amp;gt; Network &amp;gt; Peers&#039;&#039; and enter the URL of Mnet Hub under &amp;quot;Add New Host&amp;quot;. Click &amp;lt;em&amp;gt;Add&amp;lt;/em&amp;gt;&lt;br /&gt;
## The host details for the Mnet Hub should appear with the Site Name field already populated. Click &amp;lt;em&amp;gt;Save changes&amp;lt;/em&amp;gt;&lt;br /&gt;
## The details will be written to your database and two new tabs will appear in this window: &#039;Services&#039; and &#039;Logs&#039;. Click &amp;lt;em&amp;gt;Services&amp;lt;/em&amp;gt;&lt;br /&gt;
##A list of services will appear, each with a checkbox for &#039;publish&#039; and &#039;subscribe&#039;. Check the checkboxes for any services you want to publish or subscribe to&lt;br /&gt;
&lt;br /&gt;
===Using it===&lt;br /&gt;
If the Mnet Hub has already enabled a service for you, there will be a tick alongside the appropriate checkbox, for example: if the Hub is &amp;lt;em&amp;gt;publishing&amp;lt;/em&amp;gt; Moodle Networked Enrolment, then a tick will appear alongside the &amp;lt;em&amp;gt;subscribe&amp;lt;/em&amp;gt; checkbox for this service. Note that in order to enable some functionality, prominently &amp;lt;em&amp;gt;single-sign-on&amp;lt;/em&amp;gt;, you may have to &amp;lt;em&amp;gt;publish&amp;lt;/em&amp;gt; a service, e.g. the &amp;lt;em&amp;gt;Identity Provider&amp;lt;/em&amp;gt; service. The Mnet Hub will access this service on your Moodle, asking it to authenticate your users.&lt;br /&gt;
# Enable Roaming&lt;br /&gt;
## Subscribe to &amp;lt;em&amp;gt;SSO (Service Provider)&amp;lt;/em&amp;gt; by checking the box&lt;br /&gt;
## Publish &amp;lt;em&amp;gt;SSO (Identity Provider)&amp;lt;/em&amp;gt; by checking the box&lt;br /&gt;
## Click &amp;lt;em&amp;gt;Save changes&amp;lt;/em&amp;gt;&lt;br /&gt;
## Go to &#039;&#039;Admin &amp;gt; Users &amp;gt; Permissions &amp;gt; Define Roles&#039;&#039;, and grant the capability &amp;lt;em&amp;gt;Roam to a remote Moodle moodle/site:mnetlogintoremote&amp;lt;/em&amp;gt; to an appropriate role&lt;br /&gt;
## Go to &#039;&#039;Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; Manage authentication&#039;&#039; and enable the &amp;lt;em&amp;gt;Moodle Network authentication&amp;lt;/em&amp;gt; plugin&lt;br /&gt;
## Go to your homepage, turn on editing, and add the &#039;Network Servers&#039; block&lt;br /&gt;
## Using a different web-browser, log on as a non-admin user who inhabits the role you granted the roaming capability to&lt;br /&gt;
## Note that the Mnet Hub is listed in the Network Servers block on the homepage. Click on the link to that server&lt;br /&gt;
## Some of your user details will be transferred to the Mnet Hub server, and a browsing session will be started for you as if you had logged on there directly&lt;br /&gt;
# Enable Networked Enrolment&lt;br /&gt;
## Return to the web browser you&#039;ve been using as the site administrator&lt;br /&gt;
## Go to &#039;&#039;Admin &amp;gt; Network &amp;gt; Peers&#039;&#039; and click on the entry for the Mnet Hub.&lt;br /&gt;
## Click on the Services tab&lt;br /&gt;
## Subscribe to &amp;lt;em&amp;gt;Moodle Networked Enrolment&amp;lt;/em&amp;gt;&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Enrolments &amp;gt; Manage enrol plugins&#039;&#039; and enable the &amp;lt;em&amp;gt;Moodle Network enrolment&amp;lt;/em&amp;gt; plugin. Click &amp;lt;em&amp;gt;Save changes&amp;lt;/em&amp;gt;&lt;br /&gt;
## Click on &amp;lt;em&amp;gt;edit&amp;lt;/em&amp;gt; to view the details for networked enrolments.&lt;br /&gt;
## Go to &#039;&#039;Admin &amp;gt; Networking &amp;gt; Enrolments&#039;&#039; to see a list of Moodle servers that offer this service to you&lt;br /&gt;
## Click on a server name to view a list of courses that the server offers to your users&lt;br /&gt;
## Click on a course name, to view a list users that you can enrol in this course&lt;br /&gt;
## Enrol users&lt;br /&gt;
## Profit!&lt;br /&gt;
&lt;br /&gt;
==Running a Mnet hub==&lt;br /&gt;
A Mnet hub is a regular Moodle site that runs in a special mode. As a Moodle Administrator, when you add another Moodle site to your list of network peers, your Moodle will contact that site to find out what it is called, and to request its public key for encrypted communication. Normally, the remote server will simply provide this information without making any record of the transaction.&lt;br /&gt;
&lt;br /&gt;
A Mnet hub is different. As soon as you add an entry for a Mnet hub to your system, the Mnet hub will create an entry for your server in its list of hosts, and may immediately begin to offer services to the users of your site.&lt;br /&gt;
&lt;br /&gt;
This section will guide you to set up a Mnet hub, and select services to offer to all comers.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Enable Networking&lt;br /&gt;
# Ensure that the &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; Environment&#039;&#039; page indicates you have curl and openssl installed&lt;br /&gt;
# Go to &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Network &amp;gt; Settings&#039;&#039; and turn Networking on &lt;br /&gt;
# Go to &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Network &amp;gt; Peers&#039;&#039; and tick the checkbox for &amp;lt;em&amp;gt;Register all hosts&amp;lt;/em&amp;gt;. Click on &amp;lt;em&amp;gt;Save Changes&amp;lt;/em&amp;gt;&lt;br /&gt;
# On the same page, the first entry in your list of hosts should be &amp;lt;em&amp;gt;All hosts&amp;lt;/em&amp;gt;. Click this link&lt;br /&gt;
# Click on &amp;lt;em&amp;gt;Services&amp;lt;/em&amp;gt; and enable any services you want to offer to all comers&lt;br /&gt;
&lt;br /&gt;
==Assigning the role of admin==&lt;br /&gt;
&lt;br /&gt;
For security reasons, users cannot be assigned the role of admin via the Moodle interface. Instead, admin user IDs must be listed in config.php e.g. &lt;br /&gt;
 $CFG-&amp;gt;siteadmins = &#039;2,45,67&#039;;&lt;br /&gt;
&lt;br /&gt;
Note: This applies to local admins as well as remote admins as this overrides any DB stored settings that assigns administrative permissions.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Moodle Network FAQ]]&lt;br /&gt;
* [[Upload users]] for csv upload using the &#039;&#039;mnethostid&#039;&#039; field.&lt;br /&gt;
* [[Development:Moodle Network|Moodle Network development notes]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=6976 MNet forum]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=92749 Examples of how people are using Moodle networks] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Enrolment]]&lt;br /&gt;
[[Category:MNet]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Réseau Moodle]]&lt;br /&gt;
[[ja:Moodleネットワーク]]&lt;br /&gt;
[[es:Red Moodle]]&lt;br /&gt;
[[cs:Síťové služby]]&lt;br /&gt;
[[de:Moodle-Netzwerk]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_plugins&amp;diff=106183</id>
		<title>Installing plugins</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_plugins&amp;diff=106183"/>
		<updated>2013-07-26T03:32:54Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Considerations for production sites (skip is you&amp;#039;re just moodling) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
An add-on is an optional plugin for adding additional features and functionality to Moodle, such as new activities, new quiz question types, new reports, integrations with other systems and many more. &lt;br /&gt;
&lt;br /&gt;
==What is meant by the words &#039;plugin&#039; and &#039;add-on&#039;?==&lt;br /&gt;
&lt;br /&gt;
Moodle = core code + plugins&lt;br /&gt;
&lt;br /&gt;
Plugins may be either standard plugins (included in the Moodle download package) or add-ons.&lt;br /&gt;
&lt;br /&gt;
== Considerations for production sites (skip if you&#039;re just moodling) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VERY IMPORTANT&#039;&#039;&#039; Warning: Please be aware that some add-ons have not been reviewed, and the quality and/or suitability for your Moodle site has not been checked. Please be careful. It may not do what you expect, it may have serious security issues or it may even not work at all. This is however improving over time with the evolving new plugins directory system.&lt;br /&gt;
&lt;br /&gt;
* If you have a large site for production purposes consider if you &#039;&#039;&#039;really&#039;&#039;&#039; need the add-on? More functionality means more things to support, more things to (potentially) go wrong and more things to worry about at upgrade time. &lt;br /&gt;
* Is the add-on supported and maintained? If something goes wrong can you get support? Will bugs be fixed?&lt;br /&gt;
* If the add-on does not work in a future version of Moodle, what will you do about it?&lt;br /&gt;
* Beware of &#039;&#039;patches&#039;&#039; ([https://moodle.org/plugins/browse.php?list=category&amp;amp;id=38 Moodle Plugins Directory Other category]) ! If an add-on modifies or replaces core files then be very careful. It can only be guaranteed to work with the exact build (version) of Moodle it was created for and is highly unlikely to survive a Moodle upgrade.&lt;br /&gt;
&lt;br /&gt;
==Installing an add-on==&lt;br /&gt;
&lt;br /&gt;
To install an add-on, its source code must be put (deployed) into the appropriate location inside the Moodle installation directory and the main administration page &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Notifications&#039;&#039; must be visited. There are three ways how the add-on code can be deployed into Moodle.&lt;br /&gt;
&lt;br /&gt;
{{New features}}In Moodle 2.5 onwards, an add-on code may be deployed from within Moodle, either directly from the Moodle plugins directory or by uploading a ZIP file. The web server process has to have write access to the plugin type folder where the new add-on is to be installed in order to use either of these methods.&lt;br /&gt;
&lt;br /&gt;
Alternatively, an add-on code may be deployed manually at the server.&lt;br /&gt;
&lt;br /&gt;
===Installing directly from the Moodle plugins directory===&lt;br /&gt;
&lt;br /&gt;
# Login as an admin and go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Install add-ons&#039;&#039;.&lt;br /&gt;
# Click the button &#039;Install add-ons from Moodle plugins directory&#039;.&lt;br /&gt;
# Search for a plugin with an Install button (i.e. suitable for 2.5), click the Install button then click Continue.&lt;br /&gt;
# Check that you obtain a &#039;Validation passed!&#039; message, then click the button &#039;Install add-on&#039;.&lt;br /&gt;
&lt;br /&gt;
===Installing via uploaded ZIP file===&lt;br /&gt;
&lt;br /&gt;
# Go to the [https://moodle.org/plugins Moodle plugins directory], select Moodle 2.5 as version, then choose an add-on with a Download button and download the ZIP file.&lt;br /&gt;
# Login to your Moodle site as an admin and go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Install add-ons&#039;&#039;.&lt;br /&gt;
# Upload the ZIP file, select the appropriate plugin type, tick the acknowledgement checkbox, then click the button &#039;Install add-on from the ZIP file&#039;.&lt;br /&gt;
# Check that you obtain a &#039;Validation passed!&#039; message, then click the button &#039;Install add-on&#039;.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:install add-ons.png|thumb|Install add-ons]]&lt;br /&gt;
| [[File:add-on package validation.png|thumb|Add-on package validation]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the above methods, after clicking the button &#039;Install add-on&#039;, you will then be automatically redirected to &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Notifications&#039;&#039; and the installation process (i.e. creating required database tables etc) will happen.&lt;br /&gt;
&lt;br /&gt;
===Installing manually at the server===&lt;br /&gt;
&lt;br /&gt;
If you can&#039;t deploy the add-on code via the administration web interface, you have to copy it to the server file system manually (e.g. if the web server process does not have write access to the Moodle installation tree to do this for you).&lt;br /&gt;
&lt;br /&gt;
First, establish the correct place in the Moodle code tree for the add-on type. Common locations are:&lt;br /&gt;
&lt;br /&gt;
* /path/to/moodle/theme/ - themes&lt;br /&gt;
* /path/to/moodle/mod/ - activity modules and resources&lt;br /&gt;
* /path/to/moodle/blocks/ - sidebar blocks&lt;br /&gt;
* /path/to/moodle/question/type/ - question types&lt;br /&gt;
* /path/to/moodle/course/format/ - course formats&lt;br /&gt;
* /path/to/moodle/admin/report/ - admin reports&lt;br /&gt;
&lt;br /&gt;
See [[:dev:Plugins]] for the full list of all plugin types and their locations within the Moodle tree.&lt;br /&gt;
&lt;br /&gt;
# Go to the [https://moodle.org/plugins Moodle plugins directory], select Moodle 2.5 as version, then choose an add-on with a Download button and download the ZIP file.&lt;br /&gt;
# Upload or copy it to your Moodle server.&lt;br /&gt;
# Unzip it in the right place for the plugin type (or follow add-on instructions). &lt;br /&gt;
# In your Moodle site (as admin) go to &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Notifications&#039;&#039; (you should, for most plugin types, get a message saying the add-on is installed).&lt;br /&gt;
&lt;br /&gt;
Note: The add-on may contain language files.  They&#039;ll be found by your Moodle automatically. These language strings can be customized using the standard &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Language&#039;&#039; editing interface. If you get a &amp;quot;Database error&amp;quot; when you try to edit your language files, there is a strong chance that the language files included within the downloaded ZIP file of this add-on have a coding problem. If you delete the &#039;&#039;plugin_name/lang/other_language_different_to_English/&#039;&#039; folder with the new language strings and the database error disappears, this is indeed the case. Please notify the plugin maintainer, so that it can be fixed in future releases.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
===Errors===&lt;br /&gt;
&lt;br /&gt;
If you obtain an error, please [[Debugging|turn debugging on]] to obtain additional information about the cause of the error.&lt;br /&gt;
&lt;br /&gt;
;tool_installaddon/err_curl_exec - cURL error 60 : This suggests problems with the validation of the SSL certificate of the remote (moodle.org) site. This is also a known problem in Moodle Windows 7 servers running the Moodle package for Windows. See [[SSL certificate for moodle.org]] for more info and possible solutions.&lt;br /&gt;
&lt;br /&gt;
===When installing manually===&lt;br /&gt;
&lt;br /&gt;
* Check the file permissions. The web server needs to be able to read the plugin files. If the the rest of Moodle works then try to make the plugin permissions and ownership match. &lt;br /&gt;
* Did you &#039;&#039;&#039;definitely&#039;&#039;&#039; unzip or install the add-on in the correct place?&lt;br /&gt;
* Because Moodle scans plugin folders for new plugins you cannot have any other files or folders there. Make sure you deleted the zip file and don&#039;t try to rename (for example) an old version of the plugin to some other name - it will break.&lt;br /&gt;
* Make sure the directory name for the plugin is correct. All the names &#039;&#039;&#039;have&#039;&#039;&#039; to match. If you change the name then it won&#039;t work.&lt;br /&gt;
&lt;br /&gt;
===Obtaining help===&lt;br /&gt;
&lt;br /&gt;
Ask in the appropriate forum in [http://moodle.org/course/view.php?id=5 Using Moodle]. Make sure you describe your system (including versions of MySQL, PHP etc.), what you tried and what happened. Copy and paste error messages exactly. Provide the link to the version of the add-on you downloaded (some have very similar names).&lt;br /&gt;
&lt;br /&gt;
==Uninstalling an add-on==&lt;br /&gt;
&lt;br /&gt;
To uninstall an add-on&lt;br /&gt;
# Go to &#039;&#039;Administration&amp;gt; Site Administration &amp;gt; Plugins &amp;gt; Plugins overview&#039;&#039; and click the Uninstall link opposite the add-on you wish to remove&lt;br /&gt;
# Use a file manager to remove/delete the actual plugin directory as instructed, otherwise Moodle will reinstall it next time you access the site administration&lt;br /&gt;
&lt;br /&gt;
Note: Certain plugin types offer the removal from the disk as well, though not yet all.&lt;br /&gt;
&lt;br /&gt;
==Plugins overview==&lt;br /&gt;
&lt;br /&gt;
[[File:plugins overview.png|thumb|left|Plugins overview highlighting available update with install button]]The Plugins overview page in &#039;&#039;Administration &amp;gt; Site Administration &amp;gt; Plugins &amp;gt; Plugins overview&#039;&#039; lists all installed plugins, together with the version number, availability (enabled or disabled) and settings link (if applicable).&lt;br /&gt;
&lt;br /&gt;
A &#039;Check for available updates&#039; button enables admins to quickly check for any updates available to standard plugins or add-ons installed on the site (from the [http://moodle.org/plugins plugins directory]). Any updates available are highlighted, with further information and a download link in the notes column opposite the plugin.&lt;br /&gt;
&lt;br /&gt;
===Plugin updating from within Moodle===&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.4 onwards, an administrator can enable updates deployment in  &#039;&#039;Administration &amp;gt; Site Administration &amp;gt; Server &amp;gt; Update notifications&#039;&#039;. Then when updates are available, &#039;Install this update&#039; buttons are shown on the Plugins overview page. See [[Automatic updates deployment]] for more details.&lt;br /&gt;
&lt;br /&gt;
==Preventing installing add-ons from within Moodle==&lt;br /&gt;
&lt;br /&gt;
If required, installing and updating from within Moodle can be prevented by copying the following lines of code from config-dist.php and pasting them in config.php.&lt;br /&gt;
&lt;br /&gt;
 // Use the following flag to completely disable the On-click add-on installation&lt;br /&gt;
 // feature and hide it from the server administration UI.&lt;br /&gt;
 //&lt;br /&gt;
 //      $CFG-&amp;gt;disableonclickaddoninstall = true;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Notifications]] for further details of update notifications&lt;br /&gt;
* [[Add-on Review Criteria]]&lt;br /&gt;
* [[Add-on FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=44 General add-ons forum]&lt;br /&gt;
* [[Installing Moodle from Git repository#Installing a contributed extension from its Git repository|Installing a contributed extension from its Git repository]]&lt;br /&gt;
* [http://www.somerandomthoughts.com/blog/2013/05/07/managing-add-ons-in-moodle-2-5/ Managing add-ons in Moodle 2.5] blog post by Gavin Henrick&lt;br /&gt;
&lt;br /&gt;
For developers:&lt;br /&gt;
&lt;br /&gt;
*[[:dev:Category:Plugins|Plugins developer documentation]]&lt;br /&gt;
*[[:dev:Plugin validation]]&lt;br /&gt;
*[[:dev:On-click add-on installation]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributed code]]&lt;br /&gt;
&lt;br /&gt;
[[de:Plugins installieren]]&lt;br /&gt;
[[es:Instalando plugins]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_plugins&amp;diff=106182</id>
		<title>Installing plugins</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_plugins&amp;diff=106182"/>
		<updated>2013-07-26T03:32:25Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Before you do anything else... */  Renamed this to be targetted towards production sites - not everyone who just wants to give it a try.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
An add-on is an optional plugin for adding additional features and functionality to Moodle, such as new activities, new quiz question types, new reports, integrations with other systems and many more. &lt;br /&gt;
&lt;br /&gt;
==What is meant by the words &#039;plugin&#039; and &#039;add-on&#039;?==&lt;br /&gt;
&lt;br /&gt;
Moodle = core code + plugins&lt;br /&gt;
&lt;br /&gt;
Plugins may be either standard plugins (included in the Moodle download package) or add-ons.&lt;br /&gt;
&lt;br /&gt;
== Considerations for production sites (skip is you&#039;re just moodling) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VERY IMPORTANT&#039;&#039;&#039; Warning: Please be aware that some add-ons have not been reviewed, and the quality and/or suitability for your Moodle site has not been checked. Please be careful. It may not do what you expect, it may have serious security issues or it may even not work at all. This is however improving over time with the evolving new plugins directory system.&lt;br /&gt;
&lt;br /&gt;
* If you have a large site for production purposes consider if you &#039;&#039;&#039;really&#039;&#039;&#039; need the add-on? More functionality means more things to support, more things to (potentially) go wrong and more things to worry about at upgrade time. &lt;br /&gt;
* Is the add-on supported and maintained? If something goes wrong can you get support? Will bugs be fixed?&lt;br /&gt;
* If the add-on does not work in a future version of Moodle, what will you do about it?&lt;br /&gt;
* Beware of &#039;&#039;patches&#039;&#039; ([https://moodle.org/plugins/browse.php?list=category&amp;amp;id=38 Moodle Plugins Directory Other category]) ! If an add-on modifies or replaces core files then be very careful. It can only be guaranteed to work with the exact build (version) of Moodle it was created for and is highly unlikely to survive a Moodle upgrade.&lt;br /&gt;
&lt;br /&gt;
==Installing an add-on==&lt;br /&gt;
&lt;br /&gt;
To install an add-on, its source code must be put (deployed) into the appropriate location inside the Moodle installation directory and the main administration page &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Notifications&#039;&#039; must be visited. There are three ways how the add-on code can be deployed into Moodle.&lt;br /&gt;
&lt;br /&gt;
{{New features}}In Moodle 2.5 onwards, an add-on code may be deployed from within Moodle, either directly from the Moodle plugins directory or by uploading a ZIP file. The web server process has to have write access to the plugin type folder where the new add-on is to be installed in order to use either of these methods.&lt;br /&gt;
&lt;br /&gt;
Alternatively, an add-on code may be deployed manually at the server.&lt;br /&gt;
&lt;br /&gt;
===Installing directly from the Moodle plugins directory===&lt;br /&gt;
&lt;br /&gt;
# Login as an admin and go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Install add-ons&#039;&#039;.&lt;br /&gt;
# Click the button &#039;Install add-ons from Moodle plugins directory&#039;.&lt;br /&gt;
# Search for a plugin with an Install button (i.e. suitable for 2.5), click the Install button then click Continue.&lt;br /&gt;
# Check that you obtain a &#039;Validation passed!&#039; message, then click the button &#039;Install add-on&#039;.&lt;br /&gt;
&lt;br /&gt;
===Installing via uploaded ZIP file===&lt;br /&gt;
&lt;br /&gt;
# Go to the [https://moodle.org/plugins Moodle plugins directory], select Moodle 2.5 as version, then choose an add-on with a Download button and download the ZIP file.&lt;br /&gt;
# Login to your Moodle site as an admin and go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Install add-ons&#039;&#039;.&lt;br /&gt;
# Upload the ZIP file, select the appropriate plugin type, tick the acknowledgement checkbox, then click the button &#039;Install add-on from the ZIP file&#039;.&lt;br /&gt;
# Check that you obtain a &#039;Validation passed!&#039; message, then click the button &#039;Install add-on&#039;.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:install add-ons.png|thumb|Install add-ons]]&lt;br /&gt;
| [[File:add-on package validation.png|thumb|Add-on package validation]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the above methods, after clicking the button &#039;Install add-on&#039;, you will then be automatically redirected to &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Notifications&#039;&#039; and the installation process (i.e. creating required database tables etc) will happen.&lt;br /&gt;
&lt;br /&gt;
===Installing manually at the server===&lt;br /&gt;
&lt;br /&gt;
If you can&#039;t deploy the add-on code via the administration web interface, you have to copy it to the server file system manually (e.g. if the web server process does not have write access to the Moodle installation tree to do this for you).&lt;br /&gt;
&lt;br /&gt;
First, establish the correct place in the Moodle code tree for the add-on type. Common locations are:&lt;br /&gt;
&lt;br /&gt;
* /path/to/moodle/theme/ - themes&lt;br /&gt;
* /path/to/moodle/mod/ - activity modules and resources&lt;br /&gt;
* /path/to/moodle/blocks/ - sidebar blocks&lt;br /&gt;
* /path/to/moodle/question/type/ - question types&lt;br /&gt;
* /path/to/moodle/course/format/ - course formats&lt;br /&gt;
* /path/to/moodle/admin/report/ - admin reports&lt;br /&gt;
&lt;br /&gt;
See [[:dev:Plugins]] for the full list of all plugin types and their locations within the Moodle tree.&lt;br /&gt;
&lt;br /&gt;
# Go to the [https://moodle.org/plugins Moodle plugins directory], select Moodle 2.5 as version, then choose an add-on with a Download button and download the ZIP file.&lt;br /&gt;
# Upload or copy it to your Moodle server.&lt;br /&gt;
# Unzip it in the right place for the plugin type (or follow add-on instructions). &lt;br /&gt;
# In your Moodle site (as admin) go to &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Notifications&#039;&#039; (you should, for most plugin types, get a message saying the add-on is installed).&lt;br /&gt;
&lt;br /&gt;
Note: The add-on may contain language files.  They&#039;ll be found by your Moodle automatically. These language strings can be customized using the standard &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Language&#039;&#039; editing interface. If you get a &amp;quot;Database error&amp;quot; when you try to edit your language files, there is a strong chance that the language files included within the downloaded ZIP file of this add-on have a coding problem. If you delete the &#039;&#039;plugin_name/lang/other_language_different_to_English/&#039;&#039; folder with the new language strings and the database error disappears, this is indeed the case. Please notify the plugin maintainer, so that it can be fixed in future releases.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
===Errors===&lt;br /&gt;
&lt;br /&gt;
If you obtain an error, please [[Debugging|turn debugging on]] to obtain additional information about the cause of the error.&lt;br /&gt;
&lt;br /&gt;
;tool_installaddon/err_curl_exec - cURL error 60 : This suggests problems with the validation of the SSL certificate of the remote (moodle.org) site. This is also a known problem in Moodle Windows 7 servers running the Moodle package for Windows. See [[SSL certificate for moodle.org]] for more info and possible solutions.&lt;br /&gt;
&lt;br /&gt;
===When installing manually===&lt;br /&gt;
&lt;br /&gt;
* Check the file permissions. The web server needs to be able to read the plugin files. If the the rest of Moodle works then try to make the plugin permissions and ownership match. &lt;br /&gt;
* Did you &#039;&#039;&#039;definitely&#039;&#039;&#039; unzip or install the add-on in the correct place?&lt;br /&gt;
* Because Moodle scans plugin folders for new plugins you cannot have any other files or folders there. Make sure you deleted the zip file and don&#039;t try to rename (for example) an old version of the plugin to some other name - it will break.&lt;br /&gt;
* Make sure the directory name for the plugin is correct. All the names &#039;&#039;&#039;have&#039;&#039;&#039; to match. If you change the name then it won&#039;t work.&lt;br /&gt;
&lt;br /&gt;
===Obtaining help===&lt;br /&gt;
&lt;br /&gt;
Ask in the appropriate forum in [http://moodle.org/course/view.php?id=5 Using Moodle]. Make sure you describe your system (including versions of MySQL, PHP etc.), what you tried and what happened. Copy and paste error messages exactly. Provide the link to the version of the add-on you downloaded (some have very similar names).&lt;br /&gt;
&lt;br /&gt;
==Uninstalling an add-on==&lt;br /&gt;
&lt;br /&gt;
To uninstall an add-on&lt;br /&gt;
# Go to &#039;&#039;Administration&amp;gt; Site Administration &amp;gt; Plugins &amp;gt; Plugins overview&#039;&#039; and click the Uninstall link opposite the add-on you wish to remove&lt;br /&gt;
# Use a file manager to remove/delete the actual plugin directory as instructed, otherwise Moodle will reinstall it next time you access the site administration&lt;br /&gt;
&lt;br /&gt;
Note: Certain plugin types offer the removal from the disk as well, though not yet all.&lt;br /&gt;
&lt;br /&gt;
==Plugins overview==&lt;br /&gt;
&lt;br /&gt;
[[File:plugins overview.png|thumb|left|Plugins overview highlighting available update with install button]]The Plugins overview page in &#039;&#039;Administration &amp;gt; Site Administration &amp;gt; Plugins &amp;gt; Plugins overview&#039;&#039; lists all installed plugins, together with the version number, availability (enabled or disabled) and settings link (if applicable).&lt;br /&gt;
&lt;br /&gt;
A &#039;Check for available updates&#039; button enables admins to quickly check for any updates available to standard plugins or add-ons installed on the site (from the [http://moodle.org/plugins plugins directory]). Any updates available are highlighted, with further information and a download link in the notes column opposite the plugin.&lt;br /&gt;
&lt;br /&gt;
===Plugin updating from within Moodle===&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.4 onwards, an administrator can enable updates deployment in  &#039;&#039;Administration &amp;gt; Site Administration &amp;gt; Server &amp;gt; Update notifications&#039;&#039;. Then when updates are available, &#039;Install this update&#039; buttons are shown on the Plugins overview page. See [[Automatic updates deployment]] for more details.&lt;br /&gt;
&lt;br /&gt;
==Preventing installing add-ons from within Moodle==&lt;br /&gt;
&lt;br /&gt;
If required, installing and updating from within Moodle can be prevented by copying the following lines of code from config-dist.php and pasting them in config.php.&lt;br /&gt;
&lt;br /&gt;
 // Use the following flag to completely disable the On-click add-on installation&lt;br /&gt;
 // feature and hide it from the server administration UI.&lt;br /&gt;
 //&lt;br /&gt;
 //      $CFG-&amp;gt;disableonclickaddoninstall = true;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Notifications]] for further details of update notifications&lt;br /&gt;
* [[Add-on Review Criteria]]&lt;br /&gt;
* [[Add-on FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=44 General add-ons forum]&lt;br /&gt;
* [[Installing Moodle from Git repository#Installing a contributed extension from its Git repository|Installing a contributed extension from its Git repository]]&lt;br /&gt;
* [http://www.somerandomthoughts.com/blog/2013/05/07/managing-add-ons-in-moodle-2-5/ Managing add-ons in Moodle 2.5] blog post by Gavin Henrick&lt;br /&gt;
&lt;br /&gt;
For developers:&lt;br /&gt;
&lt;br /&gt;
*[[:dev:Category:Plugins|Plugins developer documentation]]&lt;br /&gt;
*[[:dev:Plugin validation]]&lt;br /&gt;
*[[:dev:On-click add-on installation]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributed code]]&lt;br /&gt;
&lt;br /&gt;
[[de:Plugins installieren]]&lt;br /&gt;
[[es:Instalando plugins]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Course_Publishing_block_(publishflow)&amp;diff=101146</id>
		<title>Course Publishing block (publishflow)</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Course_Publishing_block_(publishflow)&amp;diff=101146"/>
		<updated>2012-10-08T02:05:08Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Using the local file system */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Contributed code]]&lt;br /&gt;
&lt;br /&gt;
The Publishflow block implements a complete course tranport and publishing architecture over the Moodle Network. The block provides a mean to publish, deploy or retrofit course archives from inside the course space itself. Publishing, deploying or retrofitting a course to a working platform use the same course transport infrastructure that operates through the network or via the local filesystem.&lt;br /&gt;
&lt;br /&gt;
[[Image:course_life_cycle.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
==Moodle site types (regarding publishing concerns)==&lt;br /&gt;
&lt;br /&gt;
The course publishing architecture conceptually introduces three typical assignation to a Moodle application : &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;The Course Factory concept:&#039;&#039;&#039; A Course Factory is a Moodle instance where courses are designed and tested, but where non real training is performed. Courses can be set visible so promoting a cooperative work of the whole pedagogic operators. Courses can be exposed even if not complete or still in work, without depreciating the global e-Learing system apparent value.&lt;br /&gt;
* &#039;&#039;&#039;The Course Catalog concept:&#039;&#039;&#039; A Course Catalog is a Moodle instance that stores and exposes full features course volumes, as the result of a production process. A Course Catalog &#039;&#039;&#039;should not&#039;&#039;&#039; be the place where to perform real training, although nothing forbids really real use of courses there.&lt;br /&gt;
* &#039;&#039;&#039;The Training Instance concept:&#039;&#039;&#039; More commonly assignable to a &amp;quot;standard Moodle&amp;quot; concept, but being able to be fed with course volumes got from a Course Catalog. The Training Instances are targets for course deployment.&lt;br /&gt;
&lt;br /&gt;
Each of this general Moodle site role in the publishing network can be quickly setup by a site level preference of the Publishflow bloc. (See Global Settings)&lt;br /&gt;
&lt;br /&gt;
Assembling these three concepts may allow to constitute complex Moodle based architectures answering a publishing metaphoric model.&lt;br /&gt;
&lt;br /&gt;
[[Topology notes|Read more about topologic discussion and possibilities]]&lt;br /&gt;
&lt;br /&gt;
==Publication use cases==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Course publishing:&#039;&#039;&#039; Publishing a course is making the course volume available for use by the Traning Centers. &lt;br /&gt;
* &#039;&#039;&#039;Course deployment:&#039;&#039;&#039; Deploying a course is copying an instance of a course to get a workable course session with students. &lt;br /&gt;
* &#039;&#039;&#039;Course retrofitting:&#039;&#039;&#039; Retrofitting a course brings back a copy of an updated course volume to a factory for starting a new design and publishing process.&lt;br /&gt;
&lt;br /&gt;
==Course transportation principles==&lt;br /&gt;
&lt;br /&gt;
Course archives are being transported from a Moodle to another Moodle using the bublishflow simple publishing use cases. There are three transporting modes that a publishflow can operate:&lt;br /&gt;
===Using the local file system===&lt;br /&gt;
This is the fastest one. The course archive is picked up from one Moodle within the moodledata container of the source Moodle. This allows quite big size transportation in a very fast way, but of course needs the filesystem to be the same (or network mounted) between both Moodle instances. This is fully operable on a [[VMoodle|Virtualized Moodle]] installation. (also see https://docs.moodle.org/24/en/VMoodle_Block)&lt;br /&gt;
&lt;br /&gt;
===Using MNET back call===&lt;br /&gt;
Using MNET back call will transport the material through a Moodle MNET XMLRPC operation. This allows transporting Moodle archives between distinct physical servers an filesystems, but has a size limitation of about 40Mo due to XMLRPC encoding library breakdown.&lt;br /&gt;
===Using simple HTTP back call===&lt;br /&gt;
If the course archive does not need to be so protected during transport, the publishflow bloc envisages using a simple HTTP call to get the archive. &lt;br /&gt;
&lt;br /&gt;
this is still to be implemented.&lt;br /&gt;
&lt;br /&gt;
==Bloc Features==&lt;br /&gt;
&lt;br /&gt;
===Within a Course Factory Moodle===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Indexing:&#039;&#039; The course needs to be indexed (ie : having a non empty IDNumber to track published copies).&lt;br /&gt;
* &#039;&#039;Making a transportable archive:&#039;&#039; The course needs to be backup WITHOUT ANYTHING RELATIVE TO USERS to be tranportable. The bloc provides a control to make such an archive in &amp;quot;two clicks&amp;quot; process.&lt;br /&gt;
* &#039;&#039;Publish:&#039;&#039; Publishing a course to a remote Course Catalog chossing the target Moodle within the list of available targets.&lt;br /&gt;
* &#039;&#039;Deploy for test:&#039;&#039; As widely required by our peer teachers, the possibility to deploy directly from a Factory to a Training Center an unpublished, yet to validate, course content is possible.&lt;br /&gt;
&lt;br /&gt;
===Within a Course Catalog Moodle===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Deploy:&#039;&#039; The course can be deployed to any Training Center known in the MoodleNetwork neighborhood by people having capabilities to do it.&lt;br /&gt;
* &#039;&#039;Deploy with key:&#039;&#039; The course can be deployed to any Training Center known in the MoodleNetwork neighborhood by people having capabilities to do it AND having a preset deployment key.&lt;br /&gt;
&lt;br /&gt;
Deploying will make a remote copy of the course, landing in : &lt;br /&gt;
* a category choosen at deploy time&lt;br /&gt;
* a predefined category for incoming courses, setup in the remote Moodle Publishflow BLock configuration.&lt;br /&gt;
&lt;br /&gt;
===Within a Training Center Moodle===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Open/Reopen:&#039;&#039; The course is set available for use, or reopen if it is in a closed state.&lt;br /&gt;
* &#039;&#039;Close:&#039;&#039; The course is closed.&lt;br /&gt;
* &#039;&#039;Retrofit:&#039;&#039; The course can be retrofit to any Factory in the network neighbourhood.&lt;br /&gt;
&lt;br /&gt;
When a course is coming from deployment, it is set to a non visible state and can be attached to a predefined category.&lt;br /&gt;
&lt;br /&gt;
====Opening course options====&lt;br /&gt;
&lt;br /&gt;
When opening a course, the course may be moved to a predefined category (See Global Settings) and is set to &lt;br /&gt;
a visible state (enroll mode unchanged). &lt;br /&gt;
&lt;br /&gt;
* Opening with notification: All user that have role assigned within the course will be notified of opening.&lt;br /&gt;
* Opening without notification: No one will be notified. The course opens silently.&lt;br /&gt;
&lt;br /&gt;
====Closing course options====&lt;br /&gt;
&lt;br /&gt;
When closing a course, the course might be moved to a predefined category (See Global Settings). Closing a course might result in three distinct final states:&lt;br /&gt;
&lt;br /&gt;
* Private closing: the course is set to &#039;&#039;&#039;not visible&#039;&#039;&#039; state and no one else than teachers can go in.&lt;br /&gt;
* Protected closing: the course does&#039;nt changes its enroll settigns and student users are shifted to a &#039;&#039;Disabled Student&#039;&#039; additional custom role. Enrolled Students may thus continue to access to the course content and production whithout any interaction being possible any more. &lt;br /&gt;
* Public closing: the course is allowed to guest entry and open to guests. All users are shifted to a &#039;&#039;Disabled Student&#039;&#039; additional custom role so they get disabled.&lt;br /&gt;
&lt;br /&gt;
==Block Operations and implementation documentation==&lt;br /&gt;
&lt;br /&gt;
===Implementation Documentation===&lt;br /&gt;
* [[Publishflow Block : Requirements|Requirements]]&lt;br /&gt;
* [[Publishflow Block : Installation|Installation]]&lt;br /&gt;
* [[Publishflow Block : Initialization|Initialization : getting everyone to know about possible targets]]&lt;br /&gt;
* [[Publishflow Block : Global Settings|Global Settings]]&lt;br /&gt;
* [[Publishflow Block : Capabilities|Capabilities]]&lt;br /&gt;
* [[Publishflow Block : Additional Roles|Additional Roles]]&lt;br /&gt;
* [[Publishflow Block : MNET Services|MNET Services ( Developper)]]&lt;br /&gt;
* [[Publishflow Block : Cron]]&lt;br /&gt;
&lt;br /&gt;
===Screens===&lt;br /&gt;
&lt;br /&gt;
*[[Publishflow Block: Publishing view|Publishing view]]&lt;br /&gt;
*[[Publishflow Block: Deploy view|Deploy view]]&lt;br /&gt;
*[[Publishflow Block: Retrofit|Retrofit and course life-cycle management view]]&lt;br /&gt;
&lt;br /&gt;
===Operations===&lt;br /&gt;
&lt;br /&gt;
====Making a course publishable====&lt;br /&gt;
&lt;br /&gt;
A course is publishable if :&lt;br /&gt;
* MNET is activated.&lt;br /&gt;
* MNET Services for publishing architecture (Publishflow services) is enabled :&lt;br /&gt;
* The network has been scanned for publishing structure recognition (the current node knows what kind of Moodle peers he has in the environment and a suitable peer for the operation is available).&lt;br /&gt;
* A publishflow block is added to the course&lt;br /&gt;
* The course has been indexed (has an IDNumber) (using the publishflow block in a Factory node)&lt;br /&gt;
* The course has got a transportable backup stored in the &#039;&#039;publishflow&#039;&#039; filearea.&lt;br /&gt;
* The current user has block/publishflow:publish capability enabled on this course.&lt;br /&gt;
&lt;br /&gt;
==Credits==&lt;br /&gt;
&lt;br /&gt;
This module is developped and maintained by valery.fremaux@gmail.com&lt;br /&gt;
&lt;br /&gt;
[[fr:Publication de cours]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=error/moodle/wrong_setting_level_moodle_backup_xml_file&amp;diff=99437</id>
		<title>error/moodle/wrong setting level moodle backup xml file</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=error/moodle/wrong_setting_level_moodle_backup_xml_file&amp;diff=99437"/>
		<updated>2012-07-25T03:43:00Z</updated>

		<summary type="html">&lt;p&gt;Aparup: Created page with &amp;quot;== Unsupported setting level(s) ==   The only supported setting levels currently within the moodle_backup.xml (moodle_backup/information/settings/setting/level) file (found withi...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Unsupported setting level(s) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The only supported setting levels currently within the moodle_backup.xml (moodle_backup/information/settings/setting/level) file (found within the mbz file) are :&lt;br /&gt;
 &#039;root&#039;, &#039;course&#039;, &#039;section&#039;, &#039;activity&#039;. &lt;br /&gt;
&lt;br /&gt;
Anything else is unsupported and cannot be shared easily.&lt;br /&gt;
&lt;br /&gt;
If your backup file is facing a &#039;error/wrong_setting_level_moodle_backup_xml_file&#039; error upon others or yourself attempting to restore it, the system that generated the backup file might have a mod or plugin that is adding these unsupported setting levels into the backup. You need to make sure your backup file is compliant with what is currently supported in moodle for it to complete the restoring process. However, note that any unsupported settings and related mod or plugin data won&#039;t be reliably restored.&lt;br /&gt;
&lt;br /&gt;
To clean that up, unzip the .mbz backup file. The .mbz file is a zip file and opens up with any zip program. &lt;br /&gt;
 &lt;br /&gt;
Edit moodle_backup.xml found within your extracted directory.&lt;br /&gt;
 &lt;br /&gt;
Remove any &amp;lt;setting&amp;gt;...&amp;lt;/setting&amp;gt; which contains a &amp;lt;level&amp;gt;unsupported_level&amp;lt;/level&amp;gt; block under :-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;moodle_backup&amp;gt;&lt;br /&gt;
  &amp;lt;information&amp;gt;&lt;br /&gt;
    &amp;lt;settings&amp;gt;...remove any unsupported setting/level within the below!&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;setting&amp;gt;&lt;br /&gt;
        &amp;lt;level&amp;gt;*local*&amp;lt;/level&amp;gt;&lt;br /&gt;
          ...&lt;br /&gt;
      &amp;lt;setting&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/settings&amp;gt;&lt;br /&gt;
  &amp;lt;/information&amp;gt;&lt;br /&gt;
&amp;lt;/moodle_backup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Save your changes and zip up the directory again as the original mbz file name. &lt;br /&gt;
&lt;br /&gt;
Thats it, anyone should be able to use your backup now. Go ahead and share it :-).&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Git_for_Administrators&amp;diff=96787</id>
		<title>Git for Administrators</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Git_for_Administrators&amp;diff=96787"/>
		<updated>2012-04-06T14:47:48Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Getting hold of Git */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
The recommended way (now all Moodle development has moved to this versioning system) is Git. 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_22_STABLE origin/MOODLE_22_STABLE      (3)&lt;br /&gt;
$ git checkout MOODLE_22_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_22_STABLE and set it to track the remote branch MOODLE_22_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 proprietary protocol and it 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_22_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 [[Book module]] form its Git repository into our Moodle 2.2.&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 git://github.com/skodak/moodle-mod_book.git book      (2)&lt;br /&gt;
$ cd book&lt;br /&gt;
$ git checkout -b MOODLE_22_STABLE origin/MOODLE_22_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;book&#039;&#039; and makes a local clone of Petr Škoda&#039;s vanilla Book repository. The command (3) creates a new local branch that will track the remote branch with a Book version for Moodle 2.1. 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;
Now it is wise to put the new directory mod/book/ 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/book/ &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/book&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;
* [[CVS for Administrators]]&lt;br /&gt;
* [[Moodle versions]]&lt;br /&gt;
* For some screenshots see [[User:Frank_Ralf/Git]] (still work in progress)&lt;br /&gt;
&lt;br /&gt;
; Moodle forum discussions&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;
&lt;br /&gt;
; External resources &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;
[[Category:Git]]&lt;br /&gt;
&lt;br /&gt;
[[ja:管理者用Git]]&lt;br /&gt;
[[fr:Git_pour_administrateurs]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=89249</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=89249"/>
		<updated>2011-09-06T15:40:04Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 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), although it &#039;&#039;&#039;might work with MSSQL 2000 (v.8) or newer&#039;&#039;&#039;. All the development process has been performed using MSSQL 2005 and there could be some &#039;&#039;&#039;unknown problems&#039;&#039;&#039; with previous releases.&lt;br /&gt;
&lt;br /&gt;
While PHP comes with one, more or less, standard extension (mssql) that provides access to MSSQL databases, early we found some hard limits on it. Basically such default extension has some limits that prevent us to use it at all (you can find more info about these problems [[Development:XMLDB problems#MSSQL, PHP, UTF-8 and UCS-2|here]]).&lt;br /&gt;
&lt;br /&gt;
So, in order to allow PHP (i.e. Moodle) to access to MSSQL DBs properly we have to install a &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; to save us from the problems related above. See the sections below for details about the various options.&lt;br /&gt;
&lt;br /&gt;
== Installation overview ==&lt;br /&gt;
&lt;br /&gt;
1. Get MSSQL Server installed and running. ([http://www.microsoft.com/sql/editions/express/default.mspx A free limited version, SQL Server Express Edition] is available for testing.)&lt;br /&gt;
:Make sure that you choose mixed authentication (Windows and local accounts) to keep things simpler later.  You&#039;ll be asked to define the  &amp;quot;sa&amp;quot; account password (it&#039;s the default System Administrator account which has full access to all databases by default).&lt;br /&gt;
&lt;br /&gt;
2. Make sure MS SQL Server can accept incoming TCP/IP connections on port 1433 (the standard one).&lt;br /&gt;
:You might need to explicitly allow this in your Windows firewall (see the Control Panel).  You may also need to edit options in the :&#039;&#039;&#039;SQL Server Configuration Manager&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Network Configuration&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Protocols&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;TCP/IP enabled&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Open the &amp;quot;SQL Server Management Studio&amp;quot; and create a new empty database.  If you are using the &amp;quot;sa&amp;quot; account then you don&#039;t need to do anything else here.&lt;br /&gt;
&lt;br /&gt;
4. Configure these settings in your created (and still empty) database:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:* Quoted Identifiers Enabled = true (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:* Moodle 2.0 only: Row Versioning Enabled (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON) - To set READ_COMMITTED_SNAPSHOT ON (or OFF), there must be no active connections to the database except for the connection executing the ALTER DATABASE command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx&lt;br /&gt;
&lt;br /&gt;
5. Get PHP installed with a web server.   Unless you want to do it under IIS or some other way, the packages on the [http://download.moodle.org Moodle download page] are a good solution.&lt;br /&gt;
&lt;br /&gt;
6. Choose one of the following specific sections for your server to install the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; installed and running properly on your PHP box.&lt;br /&gt;
&lt;br /&gt;
7. Set the following settings in your php.ini file&lt;br /&gt;
:* mssql.textlimit = 20971520&lt;br /&gt;
:* mssql.textsize = 20971520&lt;br /&gt;
:Also, don&#039;t forget to set one of the following &#039;&#039;&#039;alternatives&#039;&#039;&#039;, in order to get all the data properly &amp;quot;slashed&amp;quot;:&lt;br /&gt;
:* magic_quotes_gpc = Off  &#039;&#039;&#039;or&#039;&#039;&#039;&lt;br /&gt;
:* magic_quotes_gpc = On &#039;&#039;&#039;and&#039;&#039;&#039; magic_quotes_sybase = On &lt;br /&gt;
&lt;br /&gt;
8. With all this properly configured, you can continue with a [[Installing Moodle|standard Moodle installation]].&lt;br /&gt;
&lt;br /&gt;
== Using the SQL Server 2005 Driver for PHP from Microsoft on Windows ==&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 2005 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;
This Microsoft driver is the standard database layer for running Moodle 2 under Microsoft SQL Server databases. See [[Using the Microsoft SQL Server Driver for PHP]] the installation and configuration details.&lt;br /&gt;
&lt;br /&gt;
This driver is only supported in Moodle 2.0 and up. You should use [https://docs.moodle.org/en/Installing_MSSQL_for_PHP#Using_FreeTDS_on_Windows FreeTDS] if you are installing an older version of Moodle.&lt;br /&gt;
&lt;br /&gt;
See MDL-16497 and MDL-15093 for more background information.&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;
| 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 Alastair Hole by providing the PHP 5.3 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_n&#039;;        // Required&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // assuming MS SQL is on the same server, otherwise use an IP&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // or whatever you called the database you created&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but 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;
*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;
== 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;
== Using ODBTP on Unix or Windows ==&lt;br /&gt;
&lt;br /&gt;
You can download ODBTP from http://odbtp.sourceforge.net/. Also you will access to the documentation from the same page.&lt;br /&gt;
&lt;br /&gt;
The downloaded package includes both the source code and some binaries to be installed in the server and some ready-to-use &#039;&#039;&#039;mssql extension alternatives&#039;&#039;&#039; for some platforms/PHP versions (so you won&#039;t need to compile it if your PHP server/version binary package is present).&lt;br /&gt;
&lt;br /&gt;
First of all, we have to install the Win32 service that comes with the package. Let&#039;s assume that it&#039;s going to run in the same Win32 machine where your MSSQL server is running (although it can run in any other Win32 server in your network).&lt;br /&gt;
&lt;br /&gt;
To do do, following the instructions present in http://odbtp.sourceforge.net/install.html, you must:&lt;br /&gt;
&lt;br /&gt;
Do the following on the MSSQL server:&lt;br /&gt;
# Create a directory on the Windows host where the service program files will reside, i.e., md odbtp.&lt;br /&gt;
# Copy the files odbtpctl.exe, odbtpsrv.exe and odbtpsrv.ini files from the winservice directory into the directory created in step 1.&lt;br /&gt;
# Edit the file odbtpsrv.ini of the previous step and this line: &amp;lt;pre&amp;gt;MaxRequestSize=20971520&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Open a command prompt (cmd) window on the Windows host.&lt;br /&gt;
# Change to the directory to which the service program files were copied, i.e., cd odbtp.&lt;br /&gt;
# Run the following commands to install and start the service:&lt;br /&gt;
#*   odbtpctl install&lt;br /&gt;
#*   odbtpctl start&lt;br /&gt;
# With these steps you should have one new service running in your host called &amp;quot;odbtp&amp;quot;. Verify it&#039;s present and running in the &amp;quot;Services&amp;quot; control panel.&lt;br /&gt;
# Don&#039;t forget to enable TCP/IP incoming connections to port 2799 in the host you have installed the service!&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s time to build the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039;. First of all, verify if, in the downloaded package, under the &amp;quot;php&amp;quot; dir, there is one extension suitable for your PHP server/version. If it&#039;s present, you can simply copy it to the php/extensions dir in your PHP server and skip next points about compiling it from source. It&#039;s important to point that, inside each directory, you&#039;ll find &#039;&#039;&#039;two different&#039;&#039;&#039; libraries/dll files. The one that must be copied to the extensions dir is the one called &#039;&#039;&#039;&amp;quot;php_odbtp_mssql.xxx&amp;quot;&#039;&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
If in the downloaded package isn&#039;t present the extension matching your PHP platform/version, you should build if from source files. To do that, just &#039;&#039;&#039;&amp;quot;configure, make, make install&amp;quot;&#039;&#039;&#039;. That will create some stuff under &amp;quot;/usr/local&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve successfully built ODBTP is time to create the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; that will provide us with the capacity of handling MSSQL DBs from within Moodle. To do so, just configure your PHP server adding this new option to the usual ones:&lt;br /&gt;
&lt;br /&gt;
  --with-odbtp-mssql&lt;br /&gt;
&lt;br /&gt;
then, after the standard &amp;quot;make and make install&amp;quot; steps, your PHP server will be built with MSSQL support provided by ODBTP.&lt;br /&gt;
&lt;br /&gt;
Do the following on the moodle webserver:&lt;br /&gt;
Finally, independently if we are using the binary extension provided in the download or if you have built it from source files, it&#039;s time to configure the extension. &lt;br /&gt;
1. To do so, add this lines, if no present, to your php.ini file:&lt;br /&gt;
&lt;br /&gt;
  extension=php_odbtp_mssql.dll&lt;br /&gt;
&lt;br /&gt;
(only for Win32 PHP servers!)&lt;br /&gt;
&lt;br /&gt;
2. And, for all the server platforms: &lt;br /&gt;
&lt;br /&gt;
  [odbtp]&lt;br /&gt;
  odbtp.interface_file = &amp;quot;/path/to/your/odbtp.conf&amp;quot;&lt;br /&gt;
  odbtp.datetime_format = mdyhmsf&lt;br /&gt;
  odbtp.detach_default_queries = yes&lt;br /&gt;
&lt;br /&gt;
(where &#039;&#039;&amp;quot;/path/to/your/odbtp.conf&amp;quot;&#039;&#039; is usually &#039;&#039;&#039;&amp;quot;/usr/local/etc/odbtp.conf&amp;quot;&#039;&#039;&#039; for Unix systems and &#039;&#039;&#039;&amp;quot;C:\odbtp\odbtp.conf&amp;quot;&#039;&#039;&#039; for Windows systems)&lt;br /&gt;
&lt;br /&gt;
Then, edit such &amp;quot;odbtp.conf&amp;quot; file and put there these contents:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
  odbtp host = xxx.xxx.xxx (ip or hostname of the Win32 box running the ODBTP service i.e MSSQL server)&lt;br /&gt;
  type = mssql&lt;br /&gt;
  unicode sql = yes&lt;br /&gt;
  use row cache = yes&lt;br /&gt;
  right trim text = yes&lt;br /&gt;
  var data size = 20971520&lt;br /&gt;
&lt;br /&gt;
With this, your PHP server will be able to connect with the MSSQL DB server using ODBTP. From here, just continue with the installation.&lt;br /&gt;
&lt;br /&gt;
Finally, if you find the ODBTP executables and &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; in binary formats, it only will be necessary to install them in your server (binary packages...) without the need to recompile anything (just the php.ini and odbtp.conf edition steps above will be necessary). Of course, it will be really welcome to have all those binary alternatives documented here.&lt;br /&gt;
&lt;br /&gt;
Once ODBTP is working, Moodle config.php 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_n&#039;;        // Required&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // assuming MS SQL is on the same server, otherwise use an IP&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // or whatever you called the database you created&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but 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.&lt;br /&gt;
&lt;br /&gt;
== Using ODBC on Windows ==&lt;br /&gt;
[[ODBC]] allows communication with an SQL database.&lt;br /&gt;
{{Not for production sites}}&lt;br /&gt;
&lt;br /&gt;
1. Go to the &#039;&#039;&#039;Administrative Tools&#039;&#039;&#039;  control panel, then the &#039;&#039;&#039;Data Sources (ODBC)&#039;&#039;&#039; panel.&lt;br /&gt;
&lt;br /&gt;
2. Configure one new System/User DSN (call it, for example &amp;quot;moodle&amp;quot;). Dont forget to enable these options if the driver asks for them:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true&lt;br /&gt;
:* Quoted Identifiers Enabled = true&lt;br /&gt;
&lt;br /&gt;
3. Your Moodle config.php should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;odbc_mssql&#039;;     // Note this is different to all the other configs on this page!&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;moodle&#039;;         // Where this matches the Data source name you chose above&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;&#039;;               // Keep it blank!!&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Installing Moodle]]&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* [[Beginning Administration FAQ]]&lt;br /&gt;
* [[Installing Oracle for PHP]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=89248</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=89248"/>
		<updated>2011-09-06T15:29:13Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 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), although it &#039;&#039;&#039;might work with MSSQL 2000 (v.8) or newer&#039;&#039;&#039;. All the development process has been performed using MSSQL 2005 and there could be some &#039;&#039;&#039;unknown problems&#039;&#039;&#039; with previous releases.&lt;br /&gt;
&lt;br /&gt;
While PHP comes with one, more or less, standard extension (mssql) that provides access to MSSQL databases, early we found some hard limits on it. Basically such default extension has some limits that prevent us to use it at all (you can find more info about these problems [[Development:XMLDB problems#MSSQL, PHP, UTF-8 and UCS-2|here]]).&lt;br /&gt;
&lt;br /&gt;
So, in order to allow PHP (i.e. Moodle) to access to MSSQL DBs properly we have to install a &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; to save us from the problems related above. See the sections below for details about the various options.&lt;br /&gt;
&lt;br /&gt;
== Installation overview ==&lt;br /&gt;
&lt;br /&gt;
1. Get MSSQL Server installed and running. ([http://www.microsoft.com/sql/editions/express/default.mspx A free limited version, SQL Server Express Edition] is available for testing.)&lt;br /&gt;
:Make sure that you choose mixed authentication (Windows and local accounts) to keep things simpler later.  You&#039;ll be asked to define the  &amp;quot;sa&amp;quot; account password (it&#039;s the default System Administrator account which has full access to all databases by default).&lt;br /&gt;
&lt;br /&gt;
2. Make sure MS SQL Server can accept incoming TCP/IP connections on port 1433 (the standard one).&lt;br /&gt;
:You might need to explicitly allow this in your Windows firewall (see the Control Panel).  You may also need to edit options in the :&#039;&#039;&#039;SQL Server Configuration Manager&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Network Configuration&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Protocols&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;TCP/IP enabled&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Open the &amp;quot;SQL Server Management Studio&amp;quot; and create a new empty database.  If you are using the &amp;quot;sa&amp;quot; account then you don&#039;t need to do anything else here.&lt;br /&gt;
&lt;br /&gt;
4. Configure these settings in your created (and still empty) database:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:* Quoted Identifiers Enabled = true (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:* Moodle 2.0 only: Row Versioning Enabled (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON) - To set READ_COMMITTED_SNAPSHOT ON (or OFF), there must be no active connections to the database except for the connection executing the ALTER DATABASE command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx&lt;br /&gt;
&lt;br /&gt;
5. Get PHP installed with a web server.   Unless you want to do it under IIS or some other way, the packages on the [http://download.moodle.org Moodle download page] are a good solution.&lt;br /&gt;
&lt;br /&gt;
6. Choose one of the following specific sections for your server to install the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; installed and running properly on your PHP box.&lt;br /&gt;
&lt;br /&gt;
7. Set the following settings in your php.ini file&lt;br /&gt;
:* mssql.textlimit = 20971520&lt;br /&gt;
:* mssql.textsize = 20971520&lt;br /&gt;
:Also, don&#039;t forget to set one of the following &#039;&#039;&#039;alternatives&#039;&#039;&#039;, in order to get all the data properly &amp;quot;slashed&amp;quot;:&lt;br /&gt;
:* magic_quotes_gpc = Off  &#039;&#039;&#039;or&#039;&#039;&#039;&lt;br /&gt;
:* magic_quotes_gpc = On &#039;&#039;&#039;and&#039;&#039;&#039; magic_quotes_sybase = On &lt;br /&gt;
&lt;br /&gt;
8. With all this properly configured, you can continue with a [[Installing Moodle|standard Moodle installation]].&lt;br /&gt;
&lt;br /&gt;
== Using the SQL Server 2005 Driver for PHP from Microsoft on Windows ==&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 2005 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;
This Microsoft driver is the standard database layer for running Moodle 2 under Microsoft SQL Server databases. See [[Using the Microsoft SQL Server Driver for PHP]] the installation and configuration details.&lt;br /&gt;
&lt;br /&gt;
This driver is only supported in Moodle 2.0 and up. You should use [https://docs.moodle.org/en/Installing_MSSQL_for_PHP#Using_FreeTDS_on_Windows FreeTDS] if you are installing an older version of Moodle.&lt;br /&gt;
&lt;br /&gt;
See MDL-16497 and MDL-15093 for more background information.&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;
| 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 Alastair Hole by providing the PHP 5.3 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_n&#039;;        // Required&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // assuming MS SQL is on the same server, otherwise use an IP&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // or whatever you called the database you created&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but 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;
*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 use that version instead. &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;
== 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;
== Using ODBTP on Unix or Windows ==&lt;br /&gt;
&lt;br /&gt;
You can download ODBTP from http://odbtp.sourceforge.net/. Also you will access to the documentation from the same page.&lt;br /&gt;
&lt;br /&gt;
The downloaded package includes both the source code and some binaries to be installed in the server and some ready-to-use &#039;&#039;&#039;mssql extension alternatives&#039;&#039;&#039; for some platforms/PHP versions (so you won&#039;t need to compile it if your PHP server/version binary package is present).&lt;br /&gt;
&lt;br /&gt;
First of all, we have to install the Win32 service that comes with the package. Let&#039;s assume that it&#039;s going to run in the same Win32 machine where your MSSQL server is running (although it can run in any other Win32 server in your network).&lt;br /&gt;
&lt;br /&gt;
To do do, following the instructions present in http://odbtp.sourceforge.net/install.html, you must:&lt;br /&gt;
&lt;br /&gt;
Do the following on the MSSQL server:&lt;br /&gt;
# Create a directory on the Windows host where the service program files will reside, i.e., md odbtp.&lt;br /&gt;
# Copy the files odbtpctl.exe, odbtpsrv.exe and odbtpsrv.ini files from the winservice directory into the directory created in step 1.&lt;br /&gt;
# Edit the file odbtpsrv.ini of the previous step and this line: &amp;lt;pre&amp;gt;MaxRequestSize=20971520&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Open a command prompt (cmd) window on the Windows host.&lt;br /&gt;
# Change to the directory to which the service program files were copied, i.e., cd odbtp.&lt;br /&gt;
# Run the following commands to install and start the service:&lt;br /&gt;
#*   odbtpctl install&lt;br /&gt;
#*   odbtpctl start&lt;br /&gt;
# With these steps you should have one new service running in your host called &amp;quot;odbtp&amp;quot;. Verify it&#039;s present and running in the &amp;quot;Services&amp;quot; control panel.&lt;br /&gt;
# Don&#039;t forget to enable TCP/IP incoming connections to port 2799 in the host you have installed the service!&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s time to build the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039;. First of all, verify if, in the downloaded package, under the &amp;quot;php&amp;quot; dir, there is one extension suitable for your PHP server/version. If it&#039;s present, you can simply copy it to the php/extensions dir in your PHP server and skip next points about compiling it from source. It&#039;s important to point that, inside each directory, you&#039;ll find &#039;&#039;&#039;two different&#039;&#039;&#039; libraries/dll files. The one that must be copied to the extensions dir is the one called &#039;&#039;&#039;&amp;quot;php_odbtp_mssql.xxx&amp;quot;&#039;&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
If in the downloaded package isn&#039;t present the extension matching your PHP platform/version, you should build if from source files. To do that, just &#039;&#039;&#039;&amp;quot;configure, make, make install&amp;quot;&#039;&#039;&#039;. That will create some stuff under &amp;quot;/usr/local&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve successfully built ODBTP is time to create the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; that will provide us with the capacity of handling MSSQL DBs from within Moodle. To do so, just configure your PHP server adding this new option to the usual ones:&lt;br /&gt;
&lt;br /&gt;
  --with-odbtp-mssql&lt;br /&gt;
&lt;br /&gt;
then, after the standard &amp;quot;make and make install&amp;quot; steps, your PHP server will be built with MSSQL support provided by ODBTP.&lt;br /&gt;
&lt;br /&gt;
Do the following on the moodle webserver:&lt;br /&gt;
Finally, independently if we are using the binary extension provided in the download or if you have built it from source files, it&#039;s time to configure the extension. &lt;br /&gt;
1. To do so, add this lines, if no present, to your php.ini file:&lt;br /&gt;
&lt;br /&gt;
  extension=php_odbtp_mssql.dll&lt;br /&gt;
&lt;br /&gt;
(only for Win32 PHP servers!)&lt;br /&gt;
&lt;br /&gt;
2. And, for all the server platforms: &lt;br /&gt;
&lt;br /&gt;
  [odbtp]&lt;br /&gt;
  odbtp.interface_file = &amp;quot;/path/to/your/odbtp.conf&amp;quot;&lt;br /&gt;
  odbtp.datetime_format = mdyhmsf&lt;br /&gt;
  odbtp.detach_default_queries = yes&lt;br /&gt;
&lt;br /&gt;
(where &#039;&#039;&amp;quot;/path/to/your/odbtp.conf&amp;quot;&#039;&#039; is usually &#039;&#039;&#039;&amp;quot;/usr/local/etc/odbtp.conf&amp;quot;&#039;&#039;&#039; for Unix systems and &#039;&#039;&#039;&amp;quot;C:\odbtp\odbtp.conf&amp;quot;&#039;&#039;&#039; for Windows systems)&lt;br /&gt;
&lt;br /&gt;
Then, edit such &amp;quot;odbtp.conf&amp;quot; file and put there these contents:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
  odbtp host = xxx.xxx.xxx (ip or hostname of the Win32 box running the ODBTP service i.e MSSQL server)&lt;br /&gt;
  type = mssql&lt;br /&gt;
  unicode sql = yes&lt;br /&gt;
  use row cache = yes&lt;br /&gt;
  right trim text = yes&lt;br /&gt;
  var data size = 20971520&lt;br /&gt;
&lt;br /&gt;
With this, your PHP server will be able to connect with the MSSQL DB server using ODBTP. From here, just continue with the installation.&lt;br /&gt;
&lt;br /&gt;
Finally, if you find the ODBTP executables and &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; in binary formats, it only will be necessary to install them in your server (binary packages...) without the need to recompile anything (just the php.ini and odbtp.conf edition steps above will be necessary). Of course, it will be really welcome to have all those binary alternatives documented here.&lt;br /&gt;
&lt;br /&gt;
Once ODBTP is working, Moodle config.php 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_n&#039;;        // Required&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // assuming MS SQL is on the same server, otherwise use an IP&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // or whatever you called the database you created&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but 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.&lt;br /&gt;
&lt;br /&gt;
== Using ODBC on Windows ==&lt;br /&gt;
[[ODBC]] allows communication with an SQL database.&lt;br /&gt;
{{Not for production sites}}&lt;br /&gt;
&lt;br /&gt;
1. Go to the &#039;&#039;&#039;Administrative Tools&#039;&#039;&#039;  control panel, then the &#039;&#039;&#039;Data Sources (ODBC)&#039;&#039;&#039; panel.&lt;br /&gt;
&lt;br /&gt;
2. Configure one new System/User DSN (call it, for example &amp;quot;moodle&amp;quot;). Dont forget to enable these options if the driver asks for them:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true&lt;br /&gt;
:* Quoted Identifiers Enabled = true&lt;br /&gt;
&lt;br /&gt;
3. Your Moodle config.php should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;odbc_mssql&#039;;     // Note this is different to all the other configs on this page!&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;moodle&#039;;         // Where this matches the Data source name you chose above&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;&#039;;               // Keep it blank!!&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Installing Moodle]]&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* [[Beginning Administration FAQ]]&lt;br /&gt;
* [[Installing Oracle for PHP]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MySQL&amp;diff=87467</id>
		<title>MySQL</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MySQL&amp;diff=87467"/>
		<updated>2011-08-11T06:43:29Z</updated>

		<summary type="html">&lt;p&gt;Aparup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MySQL is one of the supported databases that underpins a Moodle installation. &lt;br /&gt;
&lt;br /&gt;
MySQL describes itself as &amp;quot;the most popular Open Source SQL database management system, is developed, distributed, and supported by MySQL AB. MySQL AB is a commercial company, founded by the MySQL developers. It is a second generation Open Source company that unites Open Source values and methodology with a successful business model.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
MySQL comes with an array of [http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html storage engines]. The popular ones being MyISAM and InnoDB. Since MySQL 5.5.5, MyISAM was dropped as default and InnoDB was made the [http://dev.mysql.com/doc/refman/5.5/en/innodb-default-se.html default storage engine] of choice. InnoDB is more well supportable than MyISAM due to known issues with MyISAM.  MyISAM and non-ACID master-master setups can have issues which sometimes prove difficult to support.&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.mysql.com/ The MySQL homepage]&lt;br /&gt;
* [http://moodle.org/mod/forum/view.php?id=45 Using Moodle databases forum]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/MySQL Wikipedia article about &#039;&#039;MySQL&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Developer]]&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>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MySQL&amp;diff=87466</id>
		<title>MySQL</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MySQL&amp;diff=87466"/>
		<updated>2011-08-11T06:42:21Z</updated>

		<summary type="html">&lt;p&gt;Aparup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MySQL is one of the supported databases that underpins a Moodle installation. &lt;br /&gt;
&lt;br /&gt;
MySQL describes itself as &amp;quot;the most popular Open Source SQL database management system, is developed, distributed, and supported by MySQL AB. MySQL AB is a commercial company, founded by the MySQL developers. It is a second generation Open Source company that unites Open Source values and methodology with a successful business model.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
MySQL comes with an array of [http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html storage engines]. The popular ones being MyISAM and InnoDB. Since MySQL 5.5.5, MyISAM was dropped as default and InnoDB was made the [http://dev.mysql.com/doc/refman/5.5/en/innodb-default-se.html default storage engine] of choice. InnoDB is more well supportable than MyISAM due to known issues with MyISAM.  MyISAM and non-ACID master-master setups can have issues which can sometimes prove difficult to support.&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.mysql.com/ The MySQL homepage]&lt;br /&gt;
* [http://moodle.org/mod/forum/view.php?id=45 Using Moodle databases forum]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/MySQL Wikipedia article about &#039;&#039;MySQL&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Developer]]&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>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MySQL&amp;diff=87457</id>
		<title>MySQL</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MySQL&amp;diff=87457"/>
		<updated>2011-08-11T05:13:42Z</updated>

		<summary type="html">&lt;p&gt;Aparup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MySQL is one of the supported databases that underpins a Moodle installation. &lt;br /&gt;
&lt;br /&gt;
MySQL describes itself as &amp;quot;the most popular Open Source SQL database management system, is developed, distributed, and supported by MySQL AB. MySQL AB is a commercial company, founded by the MySQL developers. It is a second generation Open Source company that unites Open Source values and methodology with a successful business model.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
MySQL comes with an array of [http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html storage engines]. The popular ones being MyISAM and InnoDB. Since MySQL 5.5.5, MyISAM was dropped as default and InnoDB was made the [http://dev.mysql.com/doc/refman/5.5/en/innodb-default-se.html default storage engine] of choice. InnoDB is more well supportable than MyISAM due to known issues with MyISAM.&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.mysql.com/ The MySQL homepage]&lt;br /&gt;
* [http://moodle.org/mod/forum/view.php?id=45 Using Moodle databases forum]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/MySQL Wikipedia article about &#039;&#039;MySQL&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Developer]]&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>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MySQL&amp;diff=87456</id>
		<title>MySQL</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MySQL&amp;diff=87456"/>
		<updated>2011-08-11T04:16:25Z</updated>

		<summary type="html">&lt;p&gt;Aparup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MySQL is one of the supported databases that underpins a Moodle installation. &lt;br /&gt;
&lt;br /&gt;
MySQL describes itself as &amp;quot;the most popular Open Source SQL database management system, is developed, distributed, and supported by MySQL AB. MySQL AB is a commercial company, founded by the MySQL developers. It is a second generation Open Source company that unites Open Source values and methodology with a successful business model.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
MySQL comes with an array of [http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html storage engines]. The popular ones being MyISAM and InnoDB. Since MySQL 5.5.5, InnoDB is the [http://dev.mysql.com/doc/refman/5.5/en/innodb-default-se.html default storage engine] of choice. InnoDB is more well supportable than MyISAM due to known issues with MyISAM.&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.mysql.com/ The MySQL homepage]&lt;br /&gt;
* [http://moodle.org/mod/forum/view.php?id=45 Using Moodle databases forum]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/MySQL Wikipedia article about &#039;&#039;MySQL&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Developer]]&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>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_AMP&amp;diff=87455</id>
		<title>Installing AMP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_AMP&amp;diff=87455"/>
		<updated>2011-08-11T03:57:02Z</updated>

		<summary type="html">&lt;p&gt;Aparup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMP, stands for &#039;&#039;&#039;A&#039;&#039;&#039;pache, &#039;&#039;&#039;M&#039;&#039;&#039;ySQL &amp;amp; &#039;&#039;&#039;P&#039;&#039;&#039;HP. Moodle is written in a scripting language called [[PHP]] and stores most of its data in a database. The recommended setup using [[MySQL]] is with InnoDB engine. The InnoDB engine is the default engine since MySQL 5.5.5. Before installing Moodle you must have a working PHP installation and a working database to turn your computer into a functional web server platform. As individual applications, [[Apache]], MySQL and PHP can be tricky to set up for average computer users. Moodle uses one of the AMP programs to make the process easier. When you install a Moodle AMP package it installs both the server, database, PHP and Moodle itself with their basic interconnections already made. &lt;br /&gt;
&lt;br /&gt;
In 2008, Moodle is rolled into XAMPP (which includes Perl) in the [http://download.moodle.org/windows Windows complete package] and into MAMP for the [http://download.moodle.org/macosx Mac OS complete package]. Of course, the [http://download.moodle.org Standard install packages] contains just the Moodle program. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;TIP:&#039;&#039;&#039;Installing Moodle &#039;&#039;&#039;for the first time&#039;&#039;&#039; on a [[Localhost|localhost]] (a stand alone computer) is easy and can be a very useful tool even if a web based production Moodle Server is available for use. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mac OS X - MAMP==&lt;br /&gt;
[[Complete Install Packages for Mac OS X]] are named Moodle4Mac. These do not have sufficient security for public, production servers--only use for private, local testing purposes. &lt;br /&gt;
&lt;br /&gt;
These packages allow Moodle to be installed, along with the prerequisites that includes a web server, database and scripting language (Apache, MySQL and PHP in this case). Several versions of the complete install package are available. You will find versions for Intel based Macs and for older PPC based Macs. Please use the correct version for your processor. &lt;br /&gt;
&lt;br /&gt;
[[Installing_AMP#Mac_OS_without_the_complete_install|See below]] if you want a secure, public server with OS X. This will use the web server that comes preinstalled with every Mac Computer.&lt;br /&gt;
&lt;br /&gt;
See also [[Step-by-step Guide for Installing Moodle on Mac OS X 10.4 Client]].&lt;br /&gt;
&lt;br /&gt;
== Red Hat Linux ==&lt;br /&gt;
You should install all available RPM packages for Apache, PHP and MySQL. One package that people frequently forget is the php-mysql package which is necessary for PHP to talk to MySQL.&lt;br /&gt;
&lt;br /&gt;
Once these are installed the standard [[Installing Moodle|Installation guide]] should be fairly straightforward.&lt;br /&gt;
&lt;br /&gt;
A more detailed walkthrough is here: [[RedHat Linux installation]]&lt;br /&gt;
&lt;br /&gt;
== Windows - XAMPP ==&lt;br /&gt;
For a complete description of installing an XAMPP webserver and then adding your own standard windows Moodle install package see [[Windows installation using XAMPP]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; There is a difference between the XAMPP Installer used in the Moodle/Windows/XAMPP installation package and the XAMPP webserver. &lt;br /&gt;
[[Complete install packages for Windows|The complete install package page]] has detailed instructions for a Windows installation using XAMPP and there is the [https://docs.moodle.org/en/Xampp_Installer_FAQ XAMPP Installer FAQ]. &lt;br /&gt;
&lt;br /&gt;
=== Tips and Tricks for Windows XAMPP ===&lt;br /&gt;
There are lots of ways to start a Moodle after an install. Most Moodlers will have one or more &amp;quot;localhost&amp;quot; links on their computer installed in &amp;quot;Favorites&amp;quot; or even as a browser&#039;s default opening screen. But first a web server has to be started. Here are two ways to start them.&lt;br /&gt;
&lt;br /&gt;
==== Automatic Windows services startup ====&lt;br /&gt;
In order to make starting Moodle more convenient in the future you could install the web and database servers as Windows services that are started automatically. To do this go to Start -&amp;gt; Run... and type the command &amp;quot;c:/moodle/server/service.exe -install&amp;quot; into Open box. Then click OK.&lt;br /&gt;
&lt;br /&gt;
Start Moodle by typing localhost in the web browser and/or adding localhost as a favorite site.&lt;br /&gt;
&lt;br /&gt;
==== Single button service startups ====&lt;br /&gt;
Use the &amp;quot;xampp_start&amp;quot; or &amp;quot;xampp_restart&amp;quot; to start your webserver. You can install multiple localhost webservers on a computer. Each will have it&#039;s own start and restart programs.&lt;br /&gt;
* Create a shortcut on the start menu, favorites or desktop that points to each specific file like &amp;lt;nowiki&amp;gt;c:\Moodle19\restart_xampp.bat&amp;lt;/nowiki&amp;gt; . Label each shortcut to a localhost differently, for example C_Moodle19, or Moodle16 or MoodleSchool.&lt;br /&gt;
&lt;br /&gt;
Start Moodle by placing localhost in the web browser or adding it as a favorite site. Whichever localhost you restarted, that is the Moodle your web browser will find.&lt;br /&gt;
* Use the xampp_restart program. It will automatically close any running webserver on your computer before it starts the version of Moodle you want to run. &lt;br /&gt;
* Use any xampp_stop to close any running webserver on your computer.&lt;br /&gt;
&lt;br /&gt;
=== EasyPHP - similar to XAMPP ===&lt;br /&gt;
As an alternative to the above package you could use a package like EasyPHP that bundles all the software you need into a single Windows application. Note that the EasyPHP 1.8 uses older versions of the software that are too old for Moodle 1.6. Also many menus for EasyPHP are still in French. EasyPHP may be a good option again once its version 2.0 is released.&lt;br /&gt;
&lt;br /&gt;
=== Mac OS without the complete install ===&lt;br /&gt;
It is possible to use the [[Apache]] server that Apple provides, and add PHP and MySQL using Marc Liyanage&#039;s packages. Both of the pages below come with good instructions that we won&#039;t duplicate here:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;PHP&#039;&#039;&#039;: Download from here: http://www.entropy.ch/software/macosx/php/&lt;br /&gt;
* &#039;&#039;&#039;MySQL&#039;&#039;&#039;: Download here: http://www.entropy.ch/software/macosx/mysql/&lt;br /&gt;
&lt;br /&gt;
Once these are installed the standard [[Installing Moodle|Installation guide]] should be fairly straightforward.&lt;br /&gt;
&lt;br /&gt;
Go here for a [[Step-by-step Guide for Installing Moodle on Mac OS X 10.4 Client]] (not server).&lt;br /&gt;
&lt;br /&gt;
=== IIS for Windows ===&lt;br /&gt;
Here you can find steps for an [[IIS]]: [[Windows installation]] for XAMPP or Windows 2003.&lt;br /&gt;
&lt;br /&gt;
=== Hosting Service ===&lt;br /&gt;
Hosting services vary quite a lot in the way they work. Some will install Moodle for you. Others may have &amp;quot;scripts&amp;quot; that you can choose that can add Moodle to your site.&lt;br /&gt;
&lt;br /&gt;
Most will offer a web-based control panel to control your site, create databases and set up cron. Some may also offer terminal access via ssh, so that you can use the command shell to do things.&lt;br /&gt;
&lt;br /&gt;
You should work your way through the [[Installing Moodle|Installation guide]] and take each step at a time. Ask your hosting provider if you get stuck. Remember, you will not use a Complete install package from Moodle, but rather one of the Generic packages if you already have a webserver.&lt;br /&gt;
&lt;br /&gt;
== Testing PHP ==&lt;br /&gt;
Once you have installed your web server and PHP you should be able to create a file (for example phpinfo.php in the document root) with the following in it:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;?php phpinfo()?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be able to open this file in a web browser by going to to the URL &#039;&#039;&#039;localhost/phpinfo&#039;&#039;&#039; and see a web page that has PHP status information in it such as [[phpinfo|this]].&lt;br /&gt;
&lt;br /&gt;
==Vista and Windows 7==&lt;br /&gt;
&lt;br /&gt;
Many people have trouble installing the stand alone local [http://download.moodle.org/windows/ Moodle for Windows] on Vista and Windows 7.&lt;br /&gt;
&lt;br /&gt;
There are several solutions:&lt;br /&gt;
&lt;br /&gt;
- A simple one is to use http://bitnami.org/stack/moodle&lt;br /&gt;
&lt;br /&gt;
- Another solution is to look at these videos at [http://www.sebastiansulinski.co.uk/web_design_tutorials/tutorial/7/install_apache_php_and_mysql_on_windows_vista Sebastian Sulinski Design] for Windows Vista. &lt;br /&gt;
&lt;br /&gt;
- Also, the page at [http://www.webdevelopersnotes.com/how-do-i/install-apache-windows-7.php Web Developer&#039;s Notes] outlines how you can install an AMP on windows 7. &lt;br /&gt;
Installing Moodle from there should be considerably easier.&lt;br /&gt;
&lt;br /&gt;
- It&#039;s also easy to install a [http://www.apachefriends.org/en/xampp.html Xampp server] and then a [http://download.moodle.org/ Standard Moodle Package] Note: &#039;&#039;&#039;&#039;&#039;not&#039;&#039;&#039;&#039;&#039; Moodle for Windows.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Installing Moodle]]&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
* [[Xampp Installer FAQ]]&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* [[Debian GNU/Linux installation]]&lt;br /&gt;
* [[Complete install packages]], also includes instructions for creating a stand alone (localhost) installation on a single computer.&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Instalación AMP]]&lt;br /&gt;
[[fr:Installation de AMP]]&lt;br /&gt;
[[ja:AMPのインストール]]&lt;br /&gt;
[[ru:Установка AMP]]&lt;br /&gt;
[[pl:Instalacja AMP]]&lt;br /&gt;
[[de:Installation von Apache, MySQL und PHP]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_AMP&amp;diff=87454</id>
		<title>Installing AMP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_AMP&amp;diff=87454"/>
		<updated>2011-08-11T03:56:12Z</updated>

		<summary type="html">&lt;p&gt;Aparup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMP, stands for &#039;&#039;&#039;A&#039;&#039;&#039;pache, &#039;&#039;&#039;M&#039;&#039;&#039;ySQL &amp;amp; &#039;&#039;&#039;P&#039;&#039;&#039;HP. Moodle is written in a scripting language called [[PHP]] and stores most of its data in a database. The recommended database is [[MySQL]] with InnoDB engine. The InnoDB engine is the default engine since MySQL 5.5.5. Before installing Moodle you must have a working PHP installation and a working database to turn your computer into a functional web server platform. As individual applications, [[Apache]], MySQL and PHP can be tricky to set up for average computer users. Moodle uses one of the AMP programs to make the process easier. When you install a Moodle AMP package it installs both the server, database, PHP and Moodle itself with their basic interconnections already made. &lt;br /&gt;
&lt;br /&gt;
In 2008, Moodle is rolled into XAMPP (which includes Perl) in the [http://download.moodle.org/windows Windows complete package] and into MAMP for the [http://download.moodle.org/macosx Mac OS complete package]. Of course, the [http://download.moodle.org Standard install packages] contains just the Moodle program. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;TIP:&#039;&#039;&#039;Installing Moodle &#039;&#039;&#039;for the first time&#039;&#039;&#039; on a [[Localhost|localhost]] (a stand alone computer) is easy and can be a very useful tool even if a web based production Moodle Server is available for use. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mac OS X - MAMP==&lt;br /&gt;
[[Complete Install Packages for Mac OS X]] are named Moodle4Mac. These do not have sufficient security for public, production servers--only use for private, local testing purposes. &lt;br /&gt;
&lt;br /&gt;
These packages allow Moodle to be installed, along with the prerequisites that includes a web server, database and scripting language (Apache, MySQL and PHP in this case). Several versions of the complete install package are available. You will find versions for Intel based Macs and for older PPC based Macs. Please use the correct version for your processor. &lt;br /&gt;
&lt;br /&gt;
[[Installing_AMP#Mac_OS_without_the_complete_install|See below]] if you want a secure, public server with OS X. This will use the web server that comes preinstalled with every Mac Computer.&lt;br /&gt;
&lt;br /&gt;
See also [[Step-by-step Guide for Installing Moodle on Mac OS X 10.4 Client]].&lt;br /&gt;
&lt;br /&gt;
== Red Hat Linux ==&lt;br /&gt;
You should install all available RPM packages for Apache, PHP and MySQL. One package that people frequently forget is the php-mysql package which is necessary for PHP to talk to MySQL.&lt;br /&gt;
&lt;br /&gt;
Once these are installed the standard [[Installing Moodle|Installation guide]] should be fairly straightforward.&lt;br /&gt;
&lt;br /&gt;
A more detailed walkthrough is here: [[RedHat Linux installation]]&lt;br /&gt;
&lt;br /&gt;
== Windows - XAMPP ==&lt;br /&gt;
For a complete description of installing an XAMPP webserver and then adding your own standard windows Moodle install package see [[Windows installation using XAMPP]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; There is a difference between the XAMPP Installer used in the Moodle/Windows/XAMPP installation package and the XAMPP webserver. &lt;br /&gt;
[[Complete install packages for Windows|The complete install package page]] has detailed instructions for a Windows installation using XAMPP and there is the [https://docs.moodle.org/en/Xampp_Installer_FAQ XAMPP Installer FAQ]. &lt;br /&gt;
&lt;br /&gt;
=== Tips and Tricks for Windows XAMPP ===&lt;br /&gt;
There are lots of ways to start a Moodle after an install. Most Moodlers will have one or more &amp;quot;localhost&amp;quot; links on their computer installed in &amp;quot;Favorites&amp;quot; or even as a browser&#039;s default opening screen. But first a web server has to be started. Here are two ways to start them.&lt;br /&gt;
&lt;br /&gt;
==== Automatic Windows services startup ====&lt;br /&gt;
In order to make starting Moodle more convenient in the future you could install the web and database servers as Windows services that are started automatically. To do this go to Start -&amp;gt; Run... and type the command &amp;quot;c:/moodle/server/service.exe -install&amp;quot; into Open box. Then click OK.&lt;br /&gt;
&lt;br /&gt;
Start Moodle by typing localhost in the web browser and/or adding localhost as a favorite site.&lt;br /&gt;
&lt;br /&gt;
==== Single button service startups ====&lt;br /&gt;
Use the &amp;quot;xampp_start&amp;quot; or &amp;quot;xampp_restart&amp;quot; to start your webserver. You can install multiple localhost webservers on a computer. Each will have it&#039;s own start and restart programs.&lt;br /&gt;
* Create a shortcut on the start menu, favorites or desktop that points to each specific file like &amp;lt;nowiki&amp;gt;c:\Moodle19\restart_xampp.bat&amp;lt;/nowiki&amp;gt; . Label each shortcut to a localhost differently, for example C_Moodle19, or Moodle16 or MoodleSchool.&lt;br /&gt;
&lt;br /&gt;
Start Moodle by placing localhost in the web browser or adding it as a favorite site. Whichever localhost you restarted, that is the Moodle your web browser will find.&lt;br /&gt;
* Use the xampp_restart program. It will automatically close any running webserver on your computer before it starts the version of Moodle you want to run. &lt;br /&gt;
* Use any xampp_stop to close any running webserver on your computer.&lt;br /&gt;
&lt;br /&gt;
=== EasyPHP - similar to XAMPP ===&lt;br /&gt;
As an alternative to the above package you could use a package like EasyPHP that bundles all the software you need into a single Windows application. Note that the EasyPHP 1.8 uses older versions of the software that are too old for Moodle 1.6. Also many menus for EasyPHP are still in French. EasyPHP may be a good option again once its version 2.0 is released.&lt;br /&gt;
&lt;br /&gt;
=== Mac OS without the complete install ===&lt;br /&gt;
It is possible to use the [[Apache]] server that Apple provides, and add PHP and MySQL using Marc Liyanage&#039;s packages. Both of the pages below come with good instructions that we won&#039;t duplicate here:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;PHP&#039;&#039;&#039;: Download from here: http://www.entropy.ch/software/macosx/php/&lt;br /&gt;
* &#039;&#039;&#039;MySQL&#039;&#039;&#039;: Download here: http://www.entropy.ch/software/macosx/mysql/&lt;br /&gt;
&lt;br /&gt;
Once these are installed the standard [[Installing Moodle|Installation guide]] should be fairly straightforward.&lt;br /&gt;
&lt;br /&gt;
Go here for a [[Step-by-step Guide for Installing Moodle on Mac OS X 10.4 Client]] (not server).&lt;br /&gt;
&lt;br /&gt;
=== IIS for Windows ===&lt;br /&gt;
Here you can find steps for an [[IIS]]: [[Windows installation]] for XAMPP or Windows 2003.&lt;br /&gt;
&lt;br /&gt;
=== Hosting Service ===&lt;br /&gt;
Hosting services vary quite a lot in the way they work. Some will install Moodle for you. Others may have &amp;quot;scripts&amp;quot; that you can choose that can add Moodle to your site.&lt;br /&gt;
&lt;br /&gt;
Most will offer a web-based control panel to control your site, create databases and set up cron. Some may also offer terminal access via ssh, so that you can use the command shell to do things.&lt;br /&gt;
&lt;br /&gt;
You should work your way through the [[Installing Moodle|Installation guide]] and take each step at a time. Ask your hosting provider if you get stuck. Remember, you will not use a Complete install package from Moodle, but rather one of the Generic packages if you already have a webserver.&lt;br /&gt;
&lt;br /&gt;
== Testing PHP ==&lt;br /&gt;
Once you have installed your web server and PHP you should be able to create a file (for example phpinfo.php in the document root) with the following in it:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;?php phpinfo()?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be able to open this file in a web browser by going to to the URL &#039;&#039;&#039;localhost/phpinfo&#039;&#039;&#039; and see a web page that has PHP status information in it such as [[phpinfo|this]].&lt;br /&gt;
&lt;br /&gt;
==Vista and Windows 7==&lt;br /&gt;
&lt;br /&gt;
Many people have trouble installing the stand alone local [http://download.moodle.org/windows/ Moodle for Windows] on Vista and Windows 7.&lt;br /&gt;
&lt;br /&gt;
There are several solutions:&lt;br /&gt;
&lt;br /&gt;
- A simple one is to use http://bitnami.org/stack/moodle&lt;br /&gt;
&lt;br /&gt;
- Another solution is to look at these videos at [http://www.sebastiansulinski.co.uk/web_design_tutorials/tutorial/7/install_apache_php_and_mysql_on_windows_vista Sebastian Sulinski Design] for Windows Vista. &lt;br /&gt;
&lt;br /&gt;
- Also, the page at [http://www.webdevelopersnotes.com/how-do-i/install-apache-windows-7.php Web Developer&#039;s Notes] outlines how you can install an AMP on windows 7. &lt;br /&gt;
Installing Moodle from there should be considerably easier.&lt;br /&gt;
&lt;br /&gt;
- It&#039;s also easy to install a [http://www.apachefriends.org/en/xampp.html Xampp server] and then a [http://download.moodle.org/ Standard Moodle Package] Note: &#039;&#039;&#039;&#039;&#039;not&#039;&#039;&#039;&#039;&#039; Moodle for Windows.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Installing Moodle]]&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
* [[Xampp Installer FAQ]]&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* [[Debian GNU/Linux installation]]&lt;br /&gt;
* [[Complete install packages]], also includes instructions for creating a stand alone (localhost) installation on a single computer.&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Instalación AMP]]&lt;br /&gt;
[[fr:Installation de AMP]]&lt;br /&gt;
[[ja:AMPのインストール]]&lt;br /&gt;
[[ru:Установка AMP]]&lt;br /&gt;
[[pl:Instalacja AMP]]&lt;br /&gt;
[[de:Installation von Apache, MySQL und PHP]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Automated_course_backup&amp;diff=86464</id>
		<title>Automated course backup</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Automated_course_backup&amp;diff=86464"/>
		<updated>2011-07-27T03:10:54Z</updated>

		<summary type="html">&lt;p&gt;Aparup: removed cross version links - docs are now versioned&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Location: &#039;&#039;Administration &amp;gt; Courses &amp;gt; Backups&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The backups page enables administrators to configure automated course backups and a backup schedule. &lt;br /&gt;
Automated course backups runs the same functions as individual [[Course backup|course backups]]. It&#039;s a good idea to schedule backups for when your server isn&#039;t usually busy. Running the backup tool over all the courses can be processor-intensive, so you shouldn&#039;t run it when there are a lot of students trying to access the server. You should always alert users with an announcement on the first page that if they log on during the backup hours they may notice a decrease in performance.  &lt;br /&gt;
&lt;br /&gt;
In order to make scheduled backups, you have to set up CRON to run periodically. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
==Setting a backup schedule==&lt;br /&gt;
&lt;br /&gt;
To set the backup schedule:&lt;br /&gt;
#Click the Active checkbox. This turns on the automated backup system.&lt;br /&gt;
#Click the days of the week to run the backup.&lt;br /&gt;
#Set the execution time for the backup process. For most servers, early morning will be the best time.  Keep in mind the time zone your server is using.&lt;br /&gt;
#Set the &amp;quot;Save to...&amp;quot; path. If you can, choose a backup path on another machine or on a different drive than the one Moodle is on. You don’t want to lose your backups at the same time you lose your Moodle site if the drive fails. If you leave the field blank, then backup zip files will be saved in the backup folder of each course files folder. On a Linux server the path might look like: /home/(your user or domain)/public_html/archive/ or if it&#039;s below the publicly accessible folders: /home/(your user or domain)/archive/ if the path is not recognized a red X is shown after saving, otherwise a green check.&lt;br /&gt;
#Click the &amp;quot;Save changes&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve set up your backup schedule, Moodle will automatically create archives of all the courses on the server at the time you specified. Once the backup is complete, Moodle will send you an email describing the status of the backup.&lt;br /&gt;
&lt;br /&gt;
Note: From 1.6 onwards, course backups automatically skip courses which are unavailable to students and have not been changed in the last month.&lt;br /&gt;
&lt;br /&gt;
==Course versus site backups==&lt;br /&gt;
&lt;br /&gt;
*Automated course backups are more expensive in terms of time and CPU usage. The recovery time to have your site running again is longer. &lt;br /&gt;
*Course backups are useful for obtaining &amp;quot;fresh&amp;quot; copies of courses to be re-used or distributed individually, however they should never be used as a primary backup system (unless your hosting doesn&#039;t allow the preferred [[Site backup|site backups]]). &lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Backup and restore FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Backup]]&lt;br /&gt;
&lt;br /&gt;
[[eu:Ikastaroen_segurtasun-kopia_automatikoa]]&lt;br /&gt;
[[fr:Sauvegarde (administrateur)]]&lt;br /&gt;
[[ja:自動コースバックアップ]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=How_Moodle_outputs_HTML&amp;diff=85613</id>
		<title>How Moodle outputs HTML</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=How_Moodle_outputs_HTML&amp;diff=85613"/>
		<updated>2011-07-04T08:15:45Z</updated>

		<summary type="html">&lt;p&gt;Aparup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;It might be useful if Obsolete:How_Moodle_ouputs_HTML or this discussion page had clues about how the page is now obsolete and some, albeit vague, plan for the replacement for Development:How_Moodle_outputs_HTML.&lt;br /&gt;
&lt;br /&gt;
If it isn&#039;t a stupid question, where is the current documentation? I&#039;ve been in 1.9 land for so long I need to catch up on where everything is at in 2.0&lt;br /&gt;
[[User:Jonathan Harker|Jonathan Harker]] 10:29, 5 January 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page has been moved to https://docs.moodle.org/20/en/Obsolete:How_Moodle_outputs_HTML&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Parent_role&amp;diff=82696</id>
		<title>Parent role</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Parent_role&amp;diff=82696"/>
		<updated>2011-04-11T09:22:14Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Role assignment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The role of &#039;&#039;&#039;Parent&#039;&#039;&#039; may be used to provide parents/mentors/tutors with permission to view certain information, such as activity reports, grades, blog entries and forum posts, about their children/mentees/tutees.&lt;br /&gt;
&lt;br /&gt;
==Role set-up==&lt;br /&gt;
&lt;br /&gt;
#Access &#039;&#039;Administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039;&lt;br /&gt;
#Click the button &amp;quot;Add a new role&amp;quot;&lt;br /&gt;
#Give the role a name e.g. Parent, short name and description&lt;br /&gt;
#From 2.0 onwards, We need to check the &#039;User&#039; checkbox in &#039;Context types where this role may be assigned&#039;&lt;br /&gt;
#Change [[Capabilities/moodle/user:viewdetails|moodle/user:viewdetails]] to &#039;&#039;allow&#039;&#039; - this item is listed within the &#039;Course&#039; section in 1.9&lt;br /&gt;
#Change any/all of the following capabilities to &#039;&#039;allow&#039;&#039;&lt;br /&gt;
#*[[Capabilities/moodle/user:readuserblogs|moodle/user:readuserblogs]] - to read the child&#039;s blog entries&lt;br /&gt;
#*[[Capabilities/moodle/user:readuserposts|moodle/user:readuserposts]] - to read the child&#039;s forum posts&lt;br /&gt;
#*[[Capabilities/moodle/user:viewuseractivitiesreport|moodle/user:viewuseractivitiesreport]] - to view the child&#039;s activity reports and grades&lt;br /&gt;
#*[[Capabilities/moodle/user:editprofile|moodle/user:editprofile]] - to edit the child&#039;s profile&lt;br /&gt;
#Click the button &amp;quot;Add a new role&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Role assignment==&lt;br /&gt;
&lt;br /&gt;
#Access the child&#039;s profile page and click on the Roles tab i.e. assign the role in the user context , &#039;Profile settings for [username]&#039; &amp;gt; &#039;Roles&#039; &amp;gt;&#039;Assign roles relative to this user&#039;&lt;br /&gt;
#Choose the role to assign i.e. Parent&lt;br /&gt;
#Select the parent in the potential users list, and use the left-facing arrow button to add it to the existing users list&lt;br /&gt;
The same parent may be assigned to several children.&lt;br /&gt;
===Adding multiple role assignments at once===&lt;br /&gt;
(if you are interested in assigning several parent roles &#039;&#039;en masse&#039;&#039; read the discussion at http://moodle.org/mod/forum/discuss.php?d=70539#p345127)&lt;br /&gt;
&lt;br /&gt;
==Mentees block==&lt;br /&gt;
{{Moodle 1.8}}&lt;br /&gt;
The [[Mentees block]] provides a parent with quick access to their child&#039;s profile page via a link on the site front page.&lt;br /&gt;
#On the site front page click &amp;quot;Turn editing on&amp;quot;&lt;br /&gt;
#Choose Mentees from the Add a block drop-down menu&lt;br /&gt;
#If required, give the Mentees block a title by following the block configuration/edit link&lt;br /&gt;
&lt;br /&gt;
==Viewing activity reports==&lt;br /&gt;
&lt;br /&gt;
If the capability [[Capabilities/moodle/user:viewuseractivitiesreport|moodle/user:viewuseractivitiesreport]] is set to &#039;&#039;allow&#039;&#039; then a parent/mentee may view their student&#039;s activity reports and grades via the student&#039;s Profile.   &lt;br /&gt;
&lt;br /&gt;
On the main Profile page, there will be a list of courses.  Clicking on a course title will select that course.  Then, under the Activities tab, the various report and grades sub-tabs will display information relevant to the selected course.   You can easily change which course you are reviewing by selecting another one on the main Profile tab.&lt;br /&gt;
&lt;br /&gt;
One small hack that can make the course list a bit more readable, especially for long course lists, is to change the format to a vertical list:&lt;br /&gt;
&lt;br /&gt;
* Edit the moodle/user/view.php file and look for these lines (around line 349 in my 1.9.9 installation):&lt;br /&gt;
&amp;lt;code php&amp;gt;. format_string($mycourse-&amp;gt;fullname) . &amp;quot;&amp;lt;/a&amp;gt;, &amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
$courselisting .= format_string($mycourse-&amp;gt;fullname) . &amp;quot;, &amp;quot;;&amp;lt;/code&amp;gt;&lt;br /&gt;
* and change that to :&lt;br /&gt;
&amp;lt;code php&amp;gt;. format_string($mycourse-&amp;gt;fullname) . &amp;quot;&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
$courselisting .= format_string($mycourse-&amp;gt;fullname) . &amp;quot;&amp;lt;br&amp;gt;&amp;quot;;;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Then save&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Manage roles]] - including testing a new role&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=57812 Create a Parent of a student role] forum discussion &lt;br /&gt;
*[http://www.youtube.com/watch?v=-49YrtjMTTo Setting up a Parent Role video]&lt;br /&gt;
*[http://www.youtube.com/watch?v=P23GT2peLZI Parent Signing in on Moodle video]&lt;br /&gt;
&lt;br /&gt;
[[Category:Roles]]&lt;br /&gt;
&lt;br /&gt;
[[eu:Guraso_rola]]&lt;br /&gt;
[[fr:Rôle Parent]]&lt;br /&gt;
[[ja:親ロール]]&lt;br /&gt;
[[de:Eltern-Rolle]]&lt;br /&gt;
[[nl:Ouder Rol]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Parent_role&amp;diff=82695</id>
		<title>Parent role</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Parent_role&amp;diff=82695"/>
		<updated>2011-04-11T09:09:58Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Role set-up */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The role of &#039;&#039;&#039;Parent&#039;&#039;&#039; may be used to provide parents/mentors/tutors with permission to view certain information, such as activity reports, grades, blog entries and forum posts, about their children/mentees/tutees.&lt;br /&gt;
&lt;br /&gt;
==Role set-up==&lt;br /&gt;
&lt;br /&gt;
#Access &#039;&#039;Administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039;&lt;br /&gt;
#Click the button &amp;quot;Add a new role&amp;quot;&lt;br /&gt;
#Give the role a name e.g. Parent, short name and description&lt;br /&gt;
#From 2.0 onwards, We need to check the &#039;User&#039; checkbox in &#039;Context types where this role may be assigned&#039;&lt;br /&gt;
#Change [[Capabilities/moodle/user:viewdetails|moodle/user:viewdetails]] to &#039;&#039;allow&#039;&#039; - this item is listed within the &#039;Course&#039; section in 1.9&lt;br /&gt;
#Change any/all of the following capabilities to &#039;&#039;allow&#039;&#039;&lt;br /&gt;
#*[[Capabilities/moodle/user:readuserblogs|moodle/user:readuserblogs]] - to read the child&#039;s blog entries&lt;br /&gt;
#*[[Capabilities/moodle/user:readuserposts|moodle/user:readuserposts]] - to read the child&#039;s forum posts&lt;br /&gt;
#*[[Capabilities/moodle/user:viewuseractivitiesreport|moodle/user:viewuseractivitiesreport]] - to view the child&#039;s activity reports and grades&lt;br /&gt;
#*[[Capabilities/moodle/user:editprofile|moodle/user:editprofile]] - to edit the child&#039;s profile&lt;br /&gt;
#Click the button &amp;quot;Add a new role&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Role assignment==&lt;br /&gt;
&lt;br /&gt;
#Access the child&#039;s profile page and click on the Roles tab i.e. assign the role in the user context&lt;br /&gt;
#Choose the role to assign i.e. Parent&lt;br /&gt;
#Select the parent in the potential users list, and use the left-facing arrow button to add it to the existing users list&lt;br /&gt;
The same parent may be assigned to several children.&lt;br /&gt;
===Adding multiple role assignments at once===&lt;br /&gt;
(if you are interested in assigning several parent roles &#039;&#039;en masse&#039;&#039; read the discussion at http://moodle.org/mod/forum/discuss.php?d=70539#p345127)&lt;br /&gt;
&lt;br /&gt;
==Mentees block==&lt;br /&gt;
{{Moodle 1.8}}&lt;br /&gt;
The [[Mentees block]] provides a parent with quick access to their child&#039;s profile page via a link on the site front page.&lt;br /&gt;
#On the site front page click &amp;quot;Turn editing on&amp;quot;&lt;br /&gt;
#Choose Mentees from the Add a block drop-down menu&lt;br /&gt;
#If required, give the Mentees block a title by following the block configuration/edit link&lt;br /&gt;
&lt;br /&gt;
==Viewing activity reports==&lt;br /&gt;
&lt;br /&gt;
If the capability [[Capabilities/moodle/user:viewuseractivitiesreport|moodle/user:viewuseractivitiesreport]] is set to &#039;&#039;allow&#039;&#039; then a parent/mentee may view their student&#039;s activity reports and grades via the student&#039;s Profile.   &lt;br /&gt;
&lt;br /&gt;
On the main Profile page, there will be a list of courses.  Clicking on a course title will select that course.  Then, under the Activities tab, the various report and grades sub-tabs will display information relevant to the selected course.   You can easily change which course you are reviewing by selecting another one on the main Profile tab.&lt;br /&gt;
&lt;br /&gt;
One small hack that can make the course list a bit more readable, especially for long course lists, is to change the format to a vertical list:&lt;br /&gt;
&lt;br /&gt;
* Edit the moodle/user/view.php file and look for these lines (around line 349 in my 1.9.9 installation):&lt;br /&gt;
&amp;lt;code php&amp;gt;. format_string($mycourse-&amp;gt;fullname) . &amp;quot;&amp;lt;/a&amp;gt;, &amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
$courselisting .= format_string($mycourse-&amp;gt;fullname) . &amp;quot;, &amp;quot;;&amp;lt;/code&amp;gt;&lt;br /&gt;
* and change that to :&lt;br /&gt;
&amp;lt;code php&amp;gt;. format_string($mycourse-&amp;gt;fullname) . &amp;quot;&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
$courselisting .= format_string($mycourse-&amp;gt;fullname) . &amp;quot;&amp;lt;br&amp;gt;&amp;quot;;;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Then save&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Manage roles]] - including testing a new role&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=57812 Create a Parent of a student role] forum discussion &lt;br /&gt;
*[http://www.youtube.com/watch?v=-49YrtjMTTo Setting up a Parent Role video]&lt;br /&gt;
*[http://www.youtube.com/watch?v=P23GT2peLZI Parent Signing in on Moodle video]&lt;br /&gt;
&lt;br /&gt;
[[Category:Roles]]&lt;br /&gt;
&lt;br /&gt;
[[eu:Guraso_rola]]&lt;br /&gt;
[[fr:Rôle Parent]]&lt;br /&gt;
[[ja:親ロール]]&lt;br /&gt;
[[de:Eltern-Rolle]]&lt;br /&gt;
[[nl:Ouder Rol]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Groupings&amp;diff=82134</id>
		<title>Groupings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Groupings&amp;diff=82134"/>
		<updated>2011-03-21T10:00:24Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Assigning an activity to a grouping */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Groups}}&lt;br /&gt;
In Moodle 1.9 onwards, [[Groups|groups]] may be organised into groupings. In a nutshell, &#039;&#039;&#039;groupings&#039;&#039;&#039; are &#039;&#039;&#039;clusters of groups&#039;&#039;&#039;. Membership to the grouping depends upon being a member of a group associated with that grouping. The teacher can use a grouping as they would a group.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Enabling the use of groupings==&lt;br /&gt;
&lt;br /&gt;
In Moodle 1.9, groupings are an experimental feature, and so need enabling in order to use them. To do so, check the enablegroupings box in &#039;&#039;Administration &amp;gt; Miscellaneous &amp;gt; [[Experimental]]&#039;&#039;. A groupings tab will appear on the [[Groups]] page.&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.0 onwards, groupings are always enabled. However, assigning an activity to group members in a particular grouping only is an experimental feature. If required, it may be enabled for the site by an administrator by checking the enablegroupmembersonly box in &#039;&#039;Administration &amp;gt; Development &amp;gt; Experimental&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Adding groups to a grouping==&lt;br /&gt;
[[Image:Groupings.png|thumb|Groupings]]&lt;br /&gt;
To add groups to a grouping: &lt;br /&gt;
#Follow the groups icon [[Image:Group.gif]] in the course administration block.&lt;br /&gt;
#Click the groupings tab on the groups page.&lt;br /&gt;
#If necessary, create a new grouping by clicking the &amp;quot;[[Create grouping]]&amp;quot; button on the groupings page.&lt;br /&gt;
#Click the &amp;quot;Show groups in grouping&amp;quot; people icon in the edit column opposite the grouping which groups are to be added to.&lt;br /&gt;
#On the add/remove groups page, select the group(s) you want to add to the grouping from the &amp;quot;Potential members&amp;quot; list.&lt;br /&gt;
#Click the arrow button that points towards the &amp;quot;Existing members&amp;quot; list.&lt;br /&gt;
#Click the &amp;quot;Back to groupings&amp;quot; button. The group(s) you added to the grouping will now be listed in the table on the groupings page.&lt;br /&gt;
&lt;br /&gt;
Existing groupings can be edited and/or deleted using the appropriate icons in the edit column of the table on the groupings page.&lt;br /&gt;
&lt;br /&gt;
==Setting the default grouping==&lt;br /&gt;
&lt;br /&gt;
Once some groupings have been created, a default grouping for course activities and resources may be set.&lt;br /&gt;
&lt;br /&gt;
#Follow the settings link in the course administration block.&lt;br /&gt;
#In the groups section in the [[Course settings|course settings]], select the default grouping.&lt;br /&gt;
&lt;br /&gt;
==Assigning an activity to a grouping==&lt;br /&gt;
[[Image:Restricting an activity to a grouping.png|thumb|Assigning an activity to a particular grouping only]]&lt;br /&gt;
To assign an activity to a particular grouping:&lt;br /&gt;
#On the edit activity page, click the &amp;quot;Show advanced&amp;quot; button in the common module settings section.&lt;br /&gt;
#Ensure that the group mode is set to separate or visible groups.&lt;br /&gt;
#Select the grouping from the grouping dropdown menu.&lt;br /&gt;
#Click the &amp;quot;Save changes&amp;quot; button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
The name of the grouping will then appear in brackets after the activity name on the course page.&lt;br /&gt;
&lt;br /&gt;
A count of activities assigned to each grouping is kept on the groupings page.&lt;br /&gt;
&lt;br /&gt;
To assign an activity to group members in a particular grouping ONLY, in addition to the above, before clicking the the &amp;quot;Save changes&amp;quot; button, check the &amp;quot;Available for group members only&amp;quot; checkbox. You must also enable &#039;Enable group members only&#039; as this is an experimental setting in 2.0. This will result in only users assigned to the groups within the grouping being able to see the activity (or resource) on the course page.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Note&#039;&#039;: If a graded activity is assigned to a particular grouping only, it will still appear in the [[Grades|gradebook]] for all users unless gradebook categories are set up in a certain way. See MDL-13868 for further details.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Note&#039;&#039;: You cannot make an activity visible to only one group of students without first placing them into a Grouping. (See [[What is the difference between groups and groupings?]] for further details.)&lt;br /&gt;
&lt;br /&gt;
==Examples of groupings==&lt;br /&gt;
#Classroom teachers in different departments might tell some students to enroll in a refresher course. Each department has their own tutor.  Each student in the refresher course might be assigned to a group associated with their classroom teacher. The groups are put into department groupings.  For example, a University has Anthropology, Engineering and Computing departments with 3 or 4 teachers in each department that have their students take a refresher statistics class. While all students in the statistics class may receive some of the same material, groupings will allow a department focus, while still tracking students by their classroom teacher. If a student is not in a classroom group, they will not be in a department grouping.  And a student who is both in a Computing classroom group and an Engineering classroom group, will belong to more than one grouping.  &lt;br /&gt;
#In a class, you&#039;ve divided your students into 4 groups, each with their own author to research. Groups A and B, while they have different authors, are both assigned to write in a forum; groups C and D, though writing on different authors, are supposed to make a wiki. You might create a Forum Group&#039;&#039;ing&#039;&#039;, containing groups A and B, and a Wiki Group&#039;&#039;ing&#039;&#039;, containing groups C and D. Then, you can make the Wiki activity available to only the Wiki grouping, but you still have your two Wiki sub-groups, as well - C and D - for an added layer of distinction between the work going on about two different authors.&lt;br /&gt;
#Olympic metaphor: at the Olympics, there are different sports (gymnastics, swimming, track) and many countries. There are two ways to think of an Olympian athlete: by the sport they compete in, and by their nationality. To be part of the United States Olympic Team, you must first be a swimmer, a gymnast, or a runner. You cannot be in the US Team without first being an athlete in a specific sport. The sport is your group. Your country is your grouping. You must belong to a group before joining a grouping.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Groupings FAQ]]&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=131905 Moodle Groups vs. Groupings] forum discussion including youtube video showing how to set up groupings&lt;br /&gt;
*[http://issuu.com/mariamoodle/docs/groupsandgroupings Moodle 1.9 Understanding Groups and Groupings] PDF 1.9 MB&lt;br /&gt;
*Curious about where &#039;groupings&#039; came from?  There is some discussion here: [[Development:Groupings OU]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Groups]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Groupements]]&lt;br /&gt;
[[ja:グルーピング]]&lt;br /&gt;
[[de:Gruppierungen]]&lt;br /&gt;
[[ca:Agrupaments]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=81855</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=81855"/>
		<updated>2011-03-11T04:37:57Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 1.7}}{{Moodle 1.9}}{{Moodle 2.0}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 1.7 (and upwards) using the SQL*Server (MSSQL) RDBMS. Steps detailed below must be performed &#039;&#039;&#039;before&#039;&#039;&#039; installing Moodle itself.&lt;br /&gt;
&lt;br /&gt;
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), although it &#039;&#039;&#039;might work with MSSQL 2000 (v.8) or newer&#039;&#039;&#039;. All the development process has been performed using MSSQL 2005 and there could be some &#039;&#039;&#039;unknown problems&#039;&#039;&#039; with previous releases.&lt;br /&gt;
&lt;br /&gt;
While PHP comes with one, more or less, standard extension (mssql) that provides access to MSSQL databases, early we found some hard limits on it. Basically such default extension has some limits that prevent us to use it at all (you can find more info about these problems [[Development:XMLDB problems#MSSQL, PHP, UTF-8 and UCS-2|here]]).&lt;br /&gt;
&lt;br /&gt;
So, in order to allow PHP (i.e. Moodle) to access to MSSQL DBs properly we have to install a &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; to save us from the problems related above. See the sections below for details about the various options.&lt;br /&gt;
&lt;br /&gt;
== Installation overview ==&lt;br /&gt;
&lt;br /&gt;
1. Get MSSQL Server installed and running. ([http://www.microsoft.com/sql/editions/express/default.mspx A free limited version, SQL Server Express Edition] is available for testing.)&lt;br /&gt;
:Make sure that you choose mixed authentication (Windows and local accounts) to keep things simpler later.  You&#039;ll be asked to define the  &amp;quot;sa&amp;quot; account password (it&#039;s the default System Administrator account which has full access to all databases by default).&lt;br /&gt;
&lt;br /&gt;
2. Make sure MS SQL Server can accept incoming TCP/IP connections on port 1433 (the standard one).&lt;br /&gt;
:You might need to explicitly allow this in your Windows firewall (see the Control Panel).  You may also need to edit options in the :&#039;&#039;&#039;SQL Server Configuration Manager&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Network Configuration&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Protocols&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;TCP/IP enabled&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Open the &amp;quot;SQL Server Management Studio&amp;quot; and create a new empty database.  If you are using the &amp;quot;sa&amp;quot; account then you don&#039;t need to do anything else here.&lt;br /&gt;
&lt;br /&gt;
4. Configure these settings in your created (and still empty) database:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:* Quoted Identifiers Enabled = true (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:* Moodle 2.0 only: Row Versioning Enabled (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON) - this one must be run from the server context menu (master database?) and not from the Moodle database&#039;s context&lt;br /&gt;
&lt;br /&gt;
5. Get PHP installed with a web server.   Unless you want to do it under IIS or some other way, the packages on the [http://download.moodle.org Moodle download page] are a good solution.&lt;br /&gt;
&lt;br /&gt;
6. Choose one of the following specific sections for your server to install the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; installed and running properly on your PHP box.&lt;br /&gt;
&lt;br /&gt;
7. Set the following settings in your php.ini file&lt;br /&gt;
:* mssql.textlimit = 20971520&lt;br /&gt;
:* mssql.textsize = 20971520&lt;br /&gt;
:Also, don&#039;t forget to set one of the following &#039;&#039;&#039;alternatives&#039;&#039;&#039;, in order to get all the data properly &amp;quot;slashed&amp;quot;:&lt;br /&gt;
:* magic_quotes_gpc = Off  &#039;&#039;&#039;or&#039;&#039;&#039;&lt;br /&gt;
:* magic_quotes_gpc = On &#039;&#039;&#039;and&#039;&#039;&#039; magic_quotes_sybase = On &lt;br /&gt;
&lt;br /&gt;
8. With all this properly configured, you can continue with a [[Installing Moodle|standard Moodle installation]].&lt;br /&gt;
&lt;br /&gt;
== Using the SQL Server 2005 Driver for PHP from Microsoft on Windows ==&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 2005 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;
This Microsoft driver is the standard database layer for running Moodle 2 under Microsoft SQL Server databases. See [[Using the Microsoft SQL Server Driver for PHP]] the installation and configuration details.&lt;br /&gt;
&lt;br /&gt;
This driver is only supported in Moodle 2.0 and up. You should use [https://docs.moodle.org/en/Installing_MSSQL_for_PHP#Using_FreeTDS_on_Windows FreeTDS] if you are installing an older version of Moodle.&lt;br /&gt;
&lt;br /&gt;
See MDL-16497 and MDL-15093 for more background information.&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;
| 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 Alastair Hole by providing the PHP 5.3 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_n&#039;;        // Required&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // assuming MS SQL is on the same server, otherwise use an IP&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // or whatever you called the database you created&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but 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;
*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].&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;
== 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;
== Using ODBTP on Unix or Windows ==&lt;br /&gt;
&lt;br /&gt;
You can download ODBTP from http://odbtp.sourceforge.net/. Also you will access to the documentation from the same page.&lt;br /&gt;
&lt;br /&gt;
The downloaded package includes both the source code and some binaries to be installed in the server and some ready-to-use &#039;&#039;&#039;mssql extension alternatives&#039;&#039;&#039; for some platforms/PHP versions (so you won&#039;t need to compile it if your PHP server/version binary package is present).&lt;br /&gt;
&lt;br /&gt;
First of all, we have to install the Win32 service that comes with the package. Let&#039;s assume that it&#039;s going to run in the same Win32 machine where your MSSQL server is running (although it can run in any other Win32 server in your network).&lt;br /&gt;
&lt;br /&gt;
To do do, following the instructions present in http://odbtp.sourceforge.net/install.html, you must:&lt;br /&gt;
&lt;br /&gt;
Do the following on the MSSQL server:&lt;br /&gt;
# Create a directory on the Windows host where the service program files will reside, i.e., md odbtp.&lt;br /&gt;
# Copy the files odbtpctl.exe, odbtpsrv.exe and odbtpsrv.ini files from the winservice directory into the directory created in step 1.&lt;br /&gt;
# Edit the file odbtpsrv.ini of the previous step and this line: &amp;lt;pre&amp;gt;MaxRequestSize=20971520&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Open a command prompt (cmd) window on the Windows host.&lt;br /&gt;
# Change to the directory to which the service program files were copied, i.e., cd odbtp.&lt;br /&gt;
# Run the following commands to install and start the service:&lt;br /&gt;
#*   odbtpctl install&lt;br /&gt;
#*   odbtpctl start&lt;br /&gt;
# With these steps you should have one new service running in your host called &amp;quot;odbtp&amp;quot;. Verify it&#039;s present and running in the &amp;quot;Services&amp;quot; control panel.&lt;br /&gt;
# Don&#039;t forget to enable TCP/IP incoming connections to port 2799 in the host you have installed the service!&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s time to build the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039;. First of all, verify if, in the downloaded package, under the &amp;quot;php&amp;quot; dir, there is one extension suitable for your PHP server/version. If it&#039;s present, you can simply copy it to the php/extensions dir in your PHP server and skip next points about compiling it from source. It&#039;s important to point that, inside each directory, you&#039;ll find &#039;&#039;&#039;two different&#039;&#039;&#039; libraries/dll files. The one that must be copied to the extensions dir is the one called &#039;&#039;&#039;&amp;quot;php_odbtp_mssql.xxx&amp;quot;&#039;&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
If in the downloaded package isn&#039;t present the extension matching your PHP platform/version, you should build if from source files. To do that, just &#039;&#039;&#039;&amp;quot;configure, make, make install&amp;quot;&#039;&#039;&#039;. That will create some stuff under &amp;quot;/usr/local&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve successfully built ODBTP is time to create the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; that will provide us with the capacity of handling MSSQL DBs from within Moodle. To do so, just configure your PHP server adding this new option to the usual ones:&lt;br /&gt;
&lt;br /&gt;
  --with-odbtp-mssql&lt;br /&gt;
&lt;br /&gt;
then, after the standard &amp;quot;make and make install&amp;quot; steps, your PHP server will be built with MSSQL support provided by ODBTP.&lt;br /&gt;
&lt;br /&gt;
Do the following on the moodle webserver:&lt;br /&gt;
Finally, independently if we are using the binary extension provided in the download or if you have built it from source files, it&#039;s time to configure the extension. &lt;br /&gt;
1. To do so, add this lines, if no present, to your php.ini file:&lt;br /&gt;
&lt;br /&gt;
  extension=php_odbtp_mssql.dll&lt;br /&gt;
&lt;br /&gt;
(only for Win32 PHP servers!)&lt;br /&gt;
&lt;br /&gt;
2. And, for all the server platforms: &lt;br /&gt;
&lt;br /&gt;
  [odbtp]&lt;br /&gt;
  odbtp.interface_file = &amp;quot;/path/to/your/odbtp.conf&amp;quot;&lt;br /&gt;
  odbtp.datetime_format = mdyhmsf&lt;br /&gt;
  odbtp.detach_default_queries = yes&lt;br /&gt;
&lt;br /&gt;
(where &#039;&#039;&amp;quot;/path/to/your/odbtp.conf&amp;quot;&#039;&#039; is usually &#039;&#039;&#039;&amp;quot;/usr/local/etc/odbtp.conf&amp;quot;&#039;&#039;&#039; for Unix systems and &#039;&#039;&#039;&amp;quot;C:\odbtp\odbtp.conf&amp;quot;&#039;&#039;&#039; for Windows systems)&lt;br /&gt;
&lt;br /&gt;
Then, edit such &amp;quot;odbtp.conf&amp;quot; file and put there these contents:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
  odbtp host = xxx.xxx.xxx (ip or hostname of the Win32 box running the ODBTP service i.e MSSQL server)&lt;br /&gt;
  type = mssql&lt;br /&gt;
  unicode sql = yes&lt;br /&gt;
  use row cache = yes&lt;br /&gt;
  right trim text = yes&lt;br /&gt;
  var data size = 20971520&lt;br /&gt;
&lt;br /&gt;
With this, your PHP server will be able to connect with the MSSQL DB server using ODBTP. From here, just continue with the installation.&lt;br /&gt;
&lt;br /&gt;
Finally, if you find the ODBTP executables and &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; in binary formats, it only will be necessary to install them in your server (binary packages...) without the need to recompile anything (just the php.ini and odbtp.conf edition steps above will be necessary). Of course, it will be really welcome to have all those binary alternatives documented here.&lt;br /&gt;
&lt;br /&gt;
Once ODBTP is working, Moodle config.php 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_n&#039;;        // Required&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // assuming MS SQL is on the same server, otherwise use an IP&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // or whatever you called the database you created&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but 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.&lt;br /&gt;
&lt;br /&gt;
== Using ODBC on Windows ==&lt;br /&gt;
[[ODBC]] allows communication with an SQL database.&lt;br /&gt;
{{Not for production sites}}&lt;br /&gt;
&lt;br /&gt;
1. Go to the &#039;&#039;&#039;Administrative Tools&#039;&#039;&#039;  control panel, then the &#039;&#039;&#039;Data Sources (ODBC)&#039;&#039;&#039; panel.&lt;br /&gt;
&lt;br /&gt;
2. Configure one new System/User DSN (call it, for example &amp;quot;moodle&amp;quot;). Dont forget to enable these options if the driver asks for them:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true&lt;br /&gt;
:* Quoted Identifiers Enabled = true&lt;br /&gt;
&lt;br /&gt;
3. Your Moodle config.php should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;odbc_mssql&#039;;     // Note this is different to all the other configs on this page!&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;moodle&#039;;         // Where this matches the Data source name you chose above&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;&#039;;               // Keep it blank!!&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Installing Moodle]]&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* [[Beginning Administration FAQ]]&lt;br /&gt;
* [[Installing Oracle for PHP]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=81854</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=81854"/>
		<updated>2011-03-11T04:34:45Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* FreeTDS on Linux (on Ubuntu by compiling an mssql.so extension) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 1.7}}{{Moodle 1.9}}{{Moodle 2.0}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 1.7 (and upwards) using the SQL*Server (MSSQL) RDBMS. Steps detailed below must be performed &#039;&#039;&#039;before&#039;&#039;&#039; installing Moodle itself.&lt;br /&gt;
&lt;br /&gt;
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), although it &#039;&#039;&#039;might work with MSSQL 2000 (v.8) or newer&#039;&#039;&#039;. All the development process has been performed using MSSQL 2005 and there could be some &#039;&#039;&#039;unknown problems&#039;&#039;&#039; with previous releases.&lt;br /&gt;
&lt;br /&gt;
While PHP comes with one, more or less, standard extension (mssql) that provides access to MSSQL databases, early we found some hard limits on it. Basically such default extension has some limits that prevent us to use it at all (you can find more info about these problems [[Development:XMLDB problems#MSSQL, PHP, UTF-8 and UCS-2|here]]).&lt;br /&gt;
&lt;br /&gt;
So, in order to allow PHP (i.e. Moodle) to access to MSSQL DBs properly we have to install a &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; to save us from the problems related above. See the sections below for details about the various options.&lt;br /&gt;
&lt;br /&gt;
== Installation overview ==&lt;br /&gt;
&lt;br /&gt;
1. Get MSSQL Server installed and running. ([http://www.microsoft.com/sql/editions/express/default.mspx A free limited version, SQL Server Express Edition] is available for testing.)&lt;br /&gt;
:Make sure that you choose mixed authentication (Windows and local accounts) to keep things simpler later.  You&#039;ll be asked to define the  &amp;quot;sa&amp;quot; account password (it&#039;s the default System Administrator account which has full access to all databases by default).&lt;br /&gt;
&lt;br /&gt;
2. Make sure MS SQL Server can accept incoming TCP/IP connections on port 1433 (the standard one).&lt;br /&gt;
:You might need to explicitly allow this in your Windows firewall (see the Control Panel).  You may also need to edit options in the :&#039;&#039;&#039;SQL Server Configuration Manager&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Network Configuration&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Protocols&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;TCP/IP enabled&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Open the &amp;quot;SQL Server Management Studio&amp;quot; and create a new empty database.  If you are using the &amp;quot;sa&amp;quot; account then you don&#039;t need to do anything else here.&lt;br /&gt;
&lt;br /&gt;
4. Configure these settings in your created (and still empty) database:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:* Quoted Identifiers Enabled = true (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:* Moodle 2.0 only: Row Versioning Enabled (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON) - this one must be run from the server context menu (master database?) and not from the Moodle database&#039;s context&lt;br /&gt;
&lt;br /&gt;
5. Get PHP installed with a web server.   Unless you want to do it under IIS or some other way, the packages on the [http://download.moodle.org Moodle download page] are a good solution.&lt;br /&gt;
&lt;br /&gt;
6. Choose one of the following specific sections for your server to install the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; installed and running properly on your PHP box.&lt;br /&gt;
&lt;br /&gt;
7. Set the following settings in your php.ini file&lt;br /&gt;
:* mssql.textlimit = 20971520&lt;br /&gt;
:* mssql.textsize = 20971520&lt;br /&gt;
:Also, don&#039;t forget to set one of the following &#039;&#039;&#039;alternatives&#039;&#039;&#039;, in order to get all the data properly &amp;quot;slashed&amp;quot;:&lt;br /&gt;
:* magic_quotes_gpc = Off  &#039;&#039;&#039;or&#039;&#039;&#039;&lt;br /&gt;
:* magic_quotes_gpc = On &#039;&#039;&#039;and&#039;&#039;&#039; magic_quotes_sybase = On &lt;br /&gt;
&lt;br /&gt;
8. With all this properly configured, you can continue with a [[Installing Moodle|standard Moodle installation]].&lt;br /&gt;
&lt;br /&gt;
== Using the SQL Server 2005 Driver for PHP from Microsoft on Windows ==&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 2005 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;
This Microsoft driver is the standard database layer for running Moodle 2 under Microsoft SQL Server databases. See [[Using the Microsoft SQL Server Driver for PHP]] the installation and configuration details.&lt;br /&gt;
&lt;br /&gt;
This driver is only supported in Moodle 2.0 and up. You should use [https://docs.moodle.org/en/Installing_MSSQL_for_PHP#Using_FreeTDS_on_Windows FreeTDS] if you are installing an older version of Moodle.&lt;br /&gt;
&lt;br /&gt;
See MDL-16497 and MDL-15093 for more background information.&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;
| 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 Alastair Hole by providing the PHP 5.3 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_n&#039;;        // Required&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // assuming MS SQL is on the same server, otherwise use an IP&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // or whatever you called the database you created&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but 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;
*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].&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.&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;
== Using ODBTP on Unix or Windows ==&lt;br /&gt;
&lt;br /&gt;
You can download ODBTP from http://odbtp.sourceforge.net/. Also you will access to the documentation from the same page.&lt;br /&gt;
&lt;br /&gt;
The downloaded package includes both the source code and some binaries to be installed in the server and some ready-to-use &#039;&#039;&#039;mssql extension alternatives&#039;&#039;&#039; for some platforms/PHP versions (so you won&#039;t need to compile it if your PHP server/version binary package is present).&lt;br /&gt;
&lt;br /&gt;
First of all, we have to install the Win32 service that comes with the package. Let&#039;s assume that it&#039;s going to run in the same Win32 machine where your MSSQL server is running (although it can run in any other Win32 server in your network).&lt;br /&gt;
&lt;br /&gt;
To do do, following the instructions present in http://odbtp.sourceforge.net/install.html, you must:&lt;br /&gt;
&lt;br /&gt;
Do the following on the MSSQL server:&lt;br /&gt;
# Create a directory on the Windows host where the service program files will reside, i.e., md odbtp.&lt;br /&gt;
# Copy the files odbtpctl.exe, odbtpsrv.exe and odbtpsrv.ini files from the winservice directory into the directory created in step 1.&lt;br /&gt;
# Edit the file odbtpsrv.ini of the previous step and this line: &amp;lt;pre&amp;gt;MaxRequestSize=20971520&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Open a command prompt (cmd) window on the Windows host.&lt;br /&gt;
# Change to the directory to which the service program files were copied, i.e., cd odbtp.&lt;br /&gt;
# Run the following commands to install and start the service:&lt;br /&gt;
#*   odbtpctl install&lt;br /&gt;
#*   odbtpctl start&lt;br /&gt;
# With these steps you should have one new service running in your host called &amp;quot;odbtp&amp;quot;. Verify it&#039;s present and running in the &amp;quot;Services&amp;quot; control panel.&lt;br /&gt;
# Don&#039;t forget to enable TCP/IP incoming connections to port 2799 in the host you have installed the service!&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s time to build the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039;. First of all, verify if, in the downloaded package, under the &amp;quot;php&amp;quot; dir, there is one extension suitable for your PHP server/version. If it&#039;s present, you can simply copy it to the php/extensions dir in your PHP server and skip next points about compiling it from source. It&#039;s important to point that, inside each directory, you&#039;ll find &#039;&#039;&#039;two different&#039;&#039;&#039; libraries/dll files. The one that must be copied to the extensions dir is the one called &#039;&#039;&#039;&amp;quot;php_odbtp_mssql.xxx&amp;quot;&#039;&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
If in the downloaded package isn&#039;t present the extension matching your PHP platform/version, you should build if from source files. To do that, just &#039;&#039;&#039;&amp;quot;configure, make, make install&amp;quot;&#039;&#039;&#039;. That will create some stuff under &amp;quot;/usr/local&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve successfully built ODBTP is time to create the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; that will provide us with the capacity of handling MSSQL DBs from within Moodle. To do so, just configure your PHP server adding this new option to the usual ones:&lt;br /&gt;
&lt;br /&gt;
  --with-odbtp-mssql&lt;br /&gt;
&lt;br /&gt;
then, after the standard &amp;quot;make and make install&amp;quot; steps, your PHP server will be built with MSSQL support provided by ODBTP.&lt;br /&gt;
&lt;br /&gt;
Do the following on the moodle webserver:&lt;br /&gt;
Finally, independently if we are using the binary extension provided in the download or if you have built it from source files, it&#039;s time to configure the extension. &lt;br /&gt;
1. To do so, add this lines, if no present, to your php.ini file:&lt;br /&gt;
&lt;br /&gt;
  extension=php_odbtp_mssql.dll&lt;br /&gt;
&lt;br /&gt;
(only for Win32 PHP servers!)&lt;br /&gt;
&lt;br /&gt;
2. And, for all the server platforms: &lt;br /&gt;
&lt;br /&gt;
  [odbtp]&lt;br /&gt;
  odbtp.interface_file = &amp;quot;/path/to/your/odbtp.conf&amp;quot;&lt;br /&gt;
  odbtp.datetime_format = mdyhmsf&lt;br /&gt;
  odbtp.detach_default_queries = yes&lt;br /&gt;
&lt;br /&gt;
(where &#039;&#039;&amp;quot;/path/to/your/odbtp.conf&amp;quot;&#039;&#039; is usually &#039;&#039;&#039;&amp;quot;/usr/local/etc/odbtp.conf&amp;quot;&#039;&#039;&#039; for Unix systems and &#039;&#039;&#039;&amp;quot;C:\odbtp\odbtp.conf&amp;quot;&#039;&#039;&#039; for Windows systems)&lt;br /&gt;
&lt;br /&gt;
Then, edit such &amp;quot;odbtp.conf&amp;quot; file and put there these contents:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
  odbtp host = xxx.xxx.xxx (ip or hostname of the Win32 box running the ODBTP service i.e MSSQL server)&lt;br /&gt;
  type = mssql&lt;br /&gt;
  unicode sql = yes&lt;br /&gt;
  use row cache = yes&lt;br /&gt;
  right trim text = yes&lt;br /&gt;
  var data size = 20971520&lt;br /&gt;
&lt;br /&gt;
With this, your PHP server will be able to connect with the MSSQL DB server using ODBTP. From here, just continue with the installation.&lt;br /&gt;
&lt;br /&gt;
Finally, if you find the ODBTP executables and &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; in binary formats, it only will be necessary to install them in your server (binary packages...) without the need to recompile anything (just the php.ini and odbtp.conf edition steps above will be necessary). Of course, it will be really welcome to have all those binary alternatives documented here.&lt;br /&gt;
&lt;br /&gt;
Once ODBTP is working, Moodle config.php 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_n&#039;;        // Required&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // assuming MS SQL is on the same server, otherwise use an IP&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // or whatever you called the database you created&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but 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.&lt;br /&gt;
&lt;br /&gt;
== Using ODBC on Windows ==&lt;br /&gt;
[[ODBC]] allows communication with an SQL database.&lt;br /&gt;
{{Not for production sites}}&lt;br /&gt;
&lt;br /&gt;
1. Go to the &#039;&#039;&#039;Administrative Tools&#039;&#039;&#039;  control panel, then the &#039;&#039;&#039;Data Sources (ODBC)&#039;&#039;&#039; panel.&lt;br /&gt;
&lt;br /&gt;
2. Configure one new System/User DSN (call it, for example &amp;quot;moodle&amp;quot;). Dont forget to enable these options if the driver asks for them:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true&lt;br /&gt;
:* Quoted Identifiers Enabled = true&lt;br /&gt;
&lt;br /&gt;
3. Your Moodle config.php should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;odbc_mssql&#039;;     // Note this is different to all the other configs on this page!&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;moodle&#039;;         // Where this matches the Data source name you chose above&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;&#039;;               // Keep it blank!!&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Installing Moodle]]&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* [[Beginning Administration FAQ]]&lt;br /&gt;
* [[Installing Oracle for PHP]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=81853</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=81853"/>
		<updated>2011-03-11T04:28:11Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Using FreeTDS on Ubuntu by compiling an mssql.so extension */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 1.7}}{{Moodle 1.9}}{{Moodle 2.0}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 1.7 (and upwards) using the SQL*Server (MSSQL) RDBMS. Steps detailed below must be performed &#039;&#039;&#039;before&#039;&#039;&#039; installing Moodle itself.&lt;br /&gt;
&lt;br /&gt;
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), although it &#039;&#039;&#039;might work with MSSQL 2000 (v.8) or newer&#039;&#039;&#039;. All the development process has been performed using MSSQL 2005 and there could be some &#039;&#039;&#039;unknown problems&#039;&#039;&#039; with previous releases.&lt;br /&gt;
&lt;br /&gt;
While PHP comes with one, more or less, standard extension (mssql) that provides access to MSSQL databases, early we found some hard limits on it. Basically such default extension has some limits that prevent us to use it at all (you can find more info about these problems [[Development:XMLDB problems#MSSQL, PHP, UTF-8 and UCS-2|here]]).&lt;br /&gt;
&lt;br /&gt;
So, in order to allow PHP (i.e. Moodle) to access to MSSQL DBs properly we have to install a &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; to save us from the problems related above. See the sections below for details about the various options.&lt;br /&gt;
&lt;br /&gt;
== Installation overview ==&lt;br /&gt;
&lt;br /&gt;
1. Get MSSQL Server installed and running. ([http://www.microsoft.com/sql/editions/express/default.mspx A free limited version, SQL Server Express Edition] is available for testing.)&lt;br /&gt;
:Make sure that you choose mixed authentication (Windows and local accounts) to keep things simpler later.  You&#039;ll be asked to define the  &amp;quot;sa&amp;quot; account password (it&#039;s the default System Administrator account which has full access to all databases by default).&lt;br /&gt;
&lt;br /&gt;
2. Make sure MS SQL Server can accept incoming TCP/IP connections on port 1433 (the standard one).&lt;br /&gt;
:You might need to explicitly allow this in your Windows firewall (see the Control Panel).  You may also need to edit options in the :&#039;&#039;&#039;SQL Server Configuration Manager&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Network Configuration&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Protocols&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;TCP/IP enabled&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Open the &amp;quot;SQL Server Management Studio&amp;quot; and create a new empty database.  If you are using the &amp;quot;sa&amp;quot; account then you don&#039;t need to do anything else here.&lt;br /&gt;
&lt;br /&gt;
4. Configure these settings in your created (and still empty) database:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:* Quoted Identifiers Enabled = true (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:* Moodle 2.0 only: Row Versioning Enabled (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON) - this one must be run from the server context menu (master database?) and not from the Moodle database&#039;s context&lt;br /&gt;
&lt;br /&gt;
5. Get PHP installed with a web server.   Unless you want to do it under IIS or some other way, the packages on the [http://download.moodle.org Moodle download page] are a good solution.&lt;br /&gt;
&lt;br /&gt;
6. Choose one of the following specific sections for your server to install the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; installed and running properly on your PHP box.&lt;br /&gt;
&lt;br /&gt;
7. Set the following settings in your php.ini file&lt;br /&gt;
:* mssql.textlimit = 20971520&lt;br /&gt;
:* mssql.textsize = 20971520&lt;br /&gt;
:Also, don&#039;t forget to set one of the following &#039;&#039;&#039;alternatives&#039;&#039;&#039;, in order to get all the data properly &amp;quot;slashed&amp;quot;:&lt;br /&gt;
:* magic_quotes_gpc = Off  &#039;&#039;&#039;or&#039;&#039;&#039;&lt;br /&gt;
:* magic_quotes_gpc = On &#039;&#039;&#039;and&#039;&#039;&#039; magic_quotes_sybase = On &lt;br /&gt;
&lt;br /&gt;
8. With all this properly configured, you can continue with a [[Installing Moodle|standard Moodle installation]].&lt;br /&gt;
&lt;br /&gt;
== Using the SQL Server 2005 Driver for PHP from Microsoft on Windows ==&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 2005 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;
This Microsoft driver is the standard database layer for running Moodle 2 under Microsoft SQL Server databases. See [[Using the Microsoft SQL Server Driver for PHP]] the installation and configuration details.&lt;br /&gt;
&lt;br /&gt;
This driver is only supported in Moodle 2.0 and up. You should use [https://docs.moodle.org/en/Installing_MSSQL_for_PHP#Using_FreeTDS_on_Windows FreeTDS] if you are installing an older version of Moodle.&lt;br /&gt;
&lt;br /&gt;
See MDL-16497 and MDL-15093 for more background information.&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;
| 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 Alastair Hole by providing the PHP 5.3 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_n&#039;;        // Required&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // assuming MS SQL is on the same server, otherwise use an IP&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // or whatever you called the database you created&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but 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;
*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].&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;
== Using ODBTP on Unix or Windows ==&lt;br /&gt;
&lt;br /&gt;
You can download ODBTP from http://odbtp.sourceforge.net/. Also you will access to the documentation from the same page.&lt;br /&gt;
&lt;br /&gt;
The downloaded package includes both the source code and some binaries to be installed in the server and some ready-to-use &#039;&#039;&#039;mssql extension alternatives&#039;&#039;&#039; for some platforms/PHP versions (so you won&#039;t need to compile it if your PHP server/version binary package is present).&lt;br /&gt;
&lt;br /&gt;
First of all, we have to install the Win32 service that comes with the package. Let&#039;s assume that it&#039;s going to run in the same Win32 machine where your MSSQL server is running (although it can run in any other Win32 server in your network).&lt;br /&gt;
&lt;br /&gt;
To do do, following the instructions present in http://odbtp.sourceforge.net/install.html, you must:&lt;br /&gt;
&lt;br /&gt;
Do the following on the MSSQL server:&lt;br /&gt;
# Create a directory on the Windows host where the service program files will reside, i.e., md odbtp.&lt;br /&gt;
# Copy the files odbtpctl.exe, odbtpsrv.exe and odbtpsrv.ini files from the winservice directory into the directory created in step 1.&lt;br /&gt;
# Edit the file odbtpsrv.ini of the previous step and this line: &amp;lt;pre&amp;gt;MaxRequestSize=20971520&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Open a command prompt (cmd) window on the Windows host.&lt;br /&gt;
# Change to the directory to which the service program files were copied, i.e., cd odbtp.&lt;br /&gt;
# Run the following commands to install and start the service:&lt;br /&gt;
#*   odbtpctl install&lt;br /&gt;
#*   odbtpctl start&lt;br /&gt;
# With these steps you should have one new service running in your host called &amp;quot;odbtp&amp;quot;. Verify it&#039;s present and running in the &amp;quot;Services&amp;quot; control panel.&lt;br /&gt;
# Don&#039;t forget to enable TCP/IP incoming connections to port 2799 in the host you have installed the service!&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s time to build the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039;. First of all, verify if, in the downloaded package, under the &amp;quot;php&amp;quot; dir, there is one extension suitable for your PHP server/version. If it&#039;s present, you can simply copy it to the php/extensions dir in your PHP server and skip next points about compiling it from source. It&#039;s important to point that, inside each directory, you&#039;ll find &#039;&#039;&#039;two different&#039;&#039;&#039; libraries/dll files. The one that must be copied to the extensions dir is the one called &#039;&#039;&#039;&amp;quot;php_odbtp_mssql.xxx&amp;quot;&#039;&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
If in the downloaded package isn&#039;t present the extension matching your PHP platform/version, you should build if from source files. To do that, just &#039;&#039;&#039;&amp;quot;configure, make, make install&amp;quot;&#039;&#039;&#039;. That will create some stuff under &amp;quot;/usr/local&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve successfully built ODBTP is time to create the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; that will provide us with the capacity of handling MSSQL DBs from within Moodle. To do so, just configure your PHP server adding this new option to the usual ones:&lt;br /&gt;
&lt;br /&gt;
  --with-odbtp-mssql&lt;br /&gt;
&lt;br /&gt;
then, after the standard &amp;quot;make and make install&amp;quot; steps, your PHP server will be built with MSSQL support provided by ODBTP.&lt;br /&gt;
&lt;br /&gt;
Do the following on the moodle webserver:&lt;br /&gt;
Finally, independently if we are using the binary extension provided in the download or if you have built it from source files, it&#039;s time to configure the extension. &lt;br /&gt;
1. To do so, add this lines, if no present, to your php.ini file:&lt;br /&gt;
&lt;br /&gt;
  extension=php_odbtp_mssql.dll&lt;br /&gt;
&lt;br /&gt;
(only for Win32 PHP servers!)&lt;br /&gt;
&lt;br /&gt;
2. And, for all the server platforms: &lt;br /&gt;
&lt;br /&gt;
  [odbtp]&lt;br /&gt;
  odbtp.interface_file = &amp;quot;/path/to/your/odbtp.conf&amp;quot;&lt;br /&gt;
  odbtp.datetime_format = mdyhmsf&lt;br /&gt;
  odbtp.detach_default_queries = yes&lt;br /&gt;
&lt;br /&gt;
(where &#039;&#039;&amp;quot;/path/to/your/odbtp.conf&amp;quot;&#039;&#039; is usually &#039;&#039;&#039;&amp;quot;/usr/local/etc/odbtp.conf&amp;quot;&#039;&#039;&#039; for Unix systems and &#039;&#039;&#039;&amp;quot;C:\odbtp\odbtp.conf&amp;quot;&#039;&#039;&#039; for Windows systems)&lt;br /&gt;
&lt;br /&gt;
Then, edit such &amp;quot;odbtp.conf&amp;quot; file and put there these contents:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
  odbtp host = xxx.xxx.xxx (ip or hostname of the Win32 box running the ODBTP service i.e MSSQL server)&lt;br /&gt;
  type = mssql&lt;br /&gt;
  unicode sql = yes&lt;br /&gt;
  use row cache = yes&lt;br /&gt;
  right trim text = yes&lt;br /&gt;
  var data size = 20971520&lt;br /&gt;
&lt;br /&gt;
With this, your PHP server will be able to connect with the MSSQL DB server using ODBTP. From here, just continue with the installation.&lt;br /&gt;
&lt;br /&gt;
Finally, if you find the ODBTP executables and &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; in binary formats, it only will be necessary to install them in your server (binary packages...) without the need to recompile anything (just the php.ini and odbtp.conf edition steps above will be necessary). Of course, it will be really welcome to have all those binary alternatives documented here.&lt;br /&gt;
&lt;br /&gt;
Once ODBTP is working, Moodle config.php 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_n&#039;;        // Required&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // assuming MS SQL is on the same server, otherwise use an IP&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // or whatever you called the database you created&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but 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.&lt;br /&gt;
&lt;br /&gt;
== Using ODBC on Windows ==&lt;br /&gt;
[[ODBC]] allows communication with an SQL database.&lt;br /&gt;
{{Not for production sites}}&lt;br /&gt;
&lt;br /&gt;
1. Go to the &#039;&#039;&#039;Administrative Tools&#039;&#039;&#039;  control panel, then the &#039;&#039;&#039;Data Sources (ODBC)&#039;&#039;&#039; panel.&lt;br /&gt;
&lt;br /&gt;
2. Configure one new System/User DSN (call it, for example &amp;quot;moodle&amp;quot;). Dont forget to enable these options if the driver asks for them:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true&lt;br /&gt;
:* Quoted Identifiers Enabled = true&lt;br /&gt;
&lt;br /&gt;
3. Your Moodle config.php should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;odbc_mssql&#039;;     // Note this is different to all the other configs on this page!&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;moodle&#039;;         // Where this matches the Data source name you chose above&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;&#039;;               // Keep it blank!!&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Installing Moodle]]&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* [[Beginning Administration FAQ]]&lt;br /&gt;
* [[Installing Oracle for PHP]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Using_the_Microsoft_SQL_Server_Driver_for_PHP&amp;diff=81695</id>
		<title>Using the Microsoft SQL Server Driver for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Using_the_Microsoft_SQL_Server_Driver_for_PHP&amp;diff=81695"/>
		<updated>2011-03-03T03:03:56Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Installation overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.0}}&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/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9 SQL Server Driver for PHP] (minimum version required is v1.1) 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;
* [[Installing Moodle]]&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* [[Beginning Administration FAQ]]&lt;br /&gt;
* [[Installing Oracle for PHP]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Using_the_Microsoft_SQL_Server_Driver_for_PHP&amp;diff=81694</id>
		<title>Using the Microsoft SQL Server Driver for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Using_the_Microsoft_SQL_Server_Driver_for_PHP&amp;diff=81694"/>
		<updated>2011-03-03T03:03:32Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Installation overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.0}}&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/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9 SQL Server Driver for PHP] (minimum version rquired is v1.1) 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;
* [[Installing Moodle]]&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* [[Beginning Administration FAQ]]&lt;br /&gt;
* [[Installing Oracle for PHP]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_Oracle_for_PHP&amp;diff=81012</id>
		<title>Installing Oracle for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_Oracle_for_PHP&amp;diff=81012"/>
		<updated>2011-02-02T08:58:03Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Install Moodle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* http://www.oracle.com/technology/pub/notes/technote_php_instant.html&lt;br /&gt;
* http://moodle.org/mod/forum/discuss.php?d=65488#p308002 (with attached html document)&lt;br /&gt;
* http://es.php.net/oci8&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; Don&#039;t forget to enable this variable in your php.ini (or .htaccess)  file:&lt;br /&gt;
&lt;br /&gt;
(else, all your data will be escaped following MySQL rules, that are incorrect for Oracle)&lt;br /&gt;
&lt;br /&gt;
    magic_quotes_sybase = On&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Broken versions of OCI8 driver ==&lt;br /&gt;
&lt;br /&gt;
PHP v5.2.4 (and perhaps v5.2.3 as well) have shipped with a bug in the OCI8 driver that leaks statement handles. The version of the OCI8 driver with the bug is v1.2.4. Possible workarounds:&lt;br /&gt;
&lt;br /&gt;
* Upgrade to PHP v5.2.5 or later&lt;br /&gt;
* Downgrade to PHP v5.2.1 (reported to work)&lt;br /&gt;
* Downgrade only the oci8 driver to the one included in PHP 5.2.1 (it worked for us -- iarenaza)&lt;br /&gt;
* If you are on linux and/or can compile PECL extensions, install an older OCI8 driver (v1.2.3 seems to work) from the PECL repository http://pecl.php.net/package/oci8&lt;br /&gt;
&lt;br /&gt;
More information at&lt;br /&gt;
* http://bugs.php.net/bug.php?id=42496 -- tracking the PHP OCI8 bug&lt;br /&gt;
* http://tracker.moodle.org/browse/MDL-11429 -- diagnostics on the Moodle side&lt;br /&gt;
&lt;br /&gt;
== Installing Moodle on Windows with Oracle Express Edition ==&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
This section explains how to install Moodle with Oracle Express Edition on Windows. I&#039;m using it for &#039;&#039;&#039;debugging&#039;&#039;&#039; purpose. It&#039;s definitively not a production environment. The goal is to setup easily and quickly a Moodle/Windows/Oracle environment.&lt;br /&gt;
&lt;br /&gt;
=== Install Oracle ===&lt;br /&gt;
Download Oracle Express Edition on [http://www.oracle.com/technology/products/database/xe/index.html Oracle web site].&amp;lt;br /&amp;gt;&lt;br /&gt;
You will also need the Instant client [http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html from here] (free account sign up needed). Copy everything from the unzipped folder into apache/bin. &amp;lt;br /&amp;gt;&lt;br /&gt;
Install both.&amp;lt;br /&amp;gt;&lt;br /&gt;
Access to the oracle console (http://127.0.0.1:8080/apex). Login: SYS Password: the_one_you_entered_during_the_installation&amp;lt;br /&amp;gt;&lt;br /&gt;
Create a new user and give it all rights (including DBA).&amp;lt;br /&amp;gt;&lt;br /&gt;
Note: Oracle Express Edition 10g is limited at one database called &#039;XE&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Set up your oracle extension ===&lt;br /&gt;
This document does not explain how to setup apache/php for Oracle. You can have more information on [http://www.oracle.com/technology/tech/php/htdocs/php-oracle-tutorial.html Oracle Documentation]. On my own machine I used my WAMP installation ([http://www.en.wampserver.com/ Wampserver 2.0]) which allowed me to activate all oracle extensions in few clicks (php_oci8, php_oracle, php_pdo_oci, php_pdo_oci8).&lt;br /&gt;
&lt;br /&gt;
=== Install Moodle ===&lt;br /&gt;
On the database setup page:&amp;lt;br /&amp;gt;&lt;br /&gt;
Driver: Oracle oci8 (in the config file it should read &amp;quot;oci8po&amp;quot; for a 1.9.x install and &amp;quot;oci&amp;quot; for a 2.0.x install)&amp;lt;br /&amp;gt;&lt;br /&gt;
Host: empty the field&amp;lt;br /&amp;gt;&lt;br /&gt;
Database: //localhost:1521/XE&amp;lt;br /&amp;gt;&lt;br /&gt;
User: the user that you created&amp;lt;br /&amp;gt;&lt;br /&gt;
Password: the password you gave to the user&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache ===&lt;br /&gt;
If you&#039;re running Moodle on Oracle with Apache on Linux, you might have issues with PHP being able to see the system environment variables.  To resolve this, you can edit /etc/sysconfig/apache2 and add the following lines to the bottom:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
LD_LIBRARY_PATH=/opt/oracle/instantclient_11_2# Set LANG Variables for UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
NLS_LANG=AMERICAN_AMERICA.AL32UTF8&amp;lt;br /&amp;gt;&lt;br /&gt;
LANG=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_ALL=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_COLLATE=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_CTYPE=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_MESSAGES=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_MONETARY=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_NUMERIC=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_TIME=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
export LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIM NLS_LANG LD_LIBRARY_PATH&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Also need to add those two lines to ~/.bashrc so that the PHP command-line client can see it too. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
* [http://lewiscarr.co.uk/node/4 Installing ORACLE drivers with PHP]&lt;br /&gt;
*[[Installing MSSQL for PHP]]&lt;br /&gt;
*[[PHP]]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=134729#p588963 Can i install Moodle with Oracle database]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=65488 Who uses Oracle]&lt;br /&gt;
*[https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Solaris_10_with_Oracle_10 Step by step Install Guide for Solaris 10 with Oracle 10]&lt;br /&gt;
*[http://learningischange.com/2009/05/29/install-moodle-on-an-oracle-database-in-25-minutes-or-less/ Install Moodle on an Oracle Database (in 25 minutes or less)]. The related Using Moodle forum discussion is [http://moodle.org/mod/forum/discuss.php?d=124629 here].&lt;br /&gt;
*[http://www.mguhlin.org/2009/05/moodle-on-oracle-database.html Moodle on Oracle Database] discussion on Miguel Guhlin&#039;s blog &lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_Oracle_for_PHP&amp;diff=81011</id>
		<title>Installing Oracle for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_Oracle_for_PHP&amp;diff=81011"/>
		<updated>2011-02-02T08:57:37Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Install Moodle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* http://www.oracle.com/technology/pub/notes/technote_php_instant.html&lt;br /&gt;
* http://moodle.org/mod/forum/discuss.php?d=65488#p308002 (with attached html document)&lt;br /&gt;
* http://es.php.net/oci8&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; Don&#039;t forget to enable this variable in your php.ini (or .htaccess)  file:&lt;br /&gt;
&lt;br /&gt;
(else, all your data will be escaped following MySQL rules, that are incorrect for Oracle)&lt;br /&gt;
&lt;br /&gt;
    magic_quotes_sybase = On&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Broken versions of OCI8 driver ==&lt;br /&gt;
&lt;br /&gt;
PHP v5.2.4 (and perhaps v5.2.3 as well) have shipped with a bug in the OCI8 driver that leaks statement handles. The version of the OCI8 driver with the bug is v1.2.4. Possible workarounds:&lt;br /&gt;
&lt;br /&gt;
* Upgrade to PHP v5.2.5 or later&lt;br /&gt;
* Downgrade to PHP v5.2.1 (reported to work)&lt;br /&gt;
* Downgrade only the oci8 driver to the one included in PHP 5.2.1 (it worked for us -- iarenaza)&lt;br /&gt;
* If you are on linux and/or can compile PECL extensions, install an older OCI8 driver (v1.2.3 seems to work) from the PECL repository http://pecl.php.net/package/oci8&lt;br /&gt;
&lt;br /&gt;
More information at&lt;br /&gt;
* http://bugs.php.net/bug.php?id=42496 -- tracking the PHP OCI8 bug&lt;br /&gt;
* http://tracker.moodle.org/browse/MDL-11429 -- diagnostics on the Moodle side&lt;br /&gt;
&lt;br /&gt;
== Installing Moodle on Windows with Oracle Express Edition ==&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
This section explains how to install Moodle with Oracle Express Edition on Windows. I&#039;m using it for &#039;&#039;&#039;debugging&#039;&#039;&#039; purpose. It&#039;s definitively not a production environment. The goal is to setup easily and quickly a Moodle/Windows/Oracle environment.&lt;br /&gt;
&lt;br /&gt;
=== Install Oracle ===&lt;br /&gt;
Download Oracle Express Edition on [http://www.oracle.com/technology/products/database/xe/index.html Oracle web site].&amp;lt;br /&amp;gt;&lt;br /&gt;
You will also need the Instant client [http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html from here] (free account sign up needed). Copy everything from the unzipped folder into apache/bin. &amp;lt;br /&amp;gt;&lt;br /&gt;
Install both.&amp;lt;br /&amp;gt;&lt;br /&gt;
Access to the oracle console (http://127.0.0.1:8080/apex). Login: SYS Password: the_one_you_entered_during_the_installation&amp;lt;br /&amp;gt;&lt;br /&gt;
Create a new user and give it all rights (including DBA).&amp;lt;br /&amp;gt;&lt;br /&gt;
Note: Oracle Express Edition 10g is limited at one database called &#039;XE&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Set up your oracle extension ===&lt;br /&gt;
This document does not explain how to setup apache/php for Oracle. You can have more information on [http://www.oracle.com/technology/tech/php/htdocs/php-oracle-tutorial.html Oracle Documentation]. On my own machine I used my WAMP installation ([http://www.en.wampserver.com/ Wampserver 2.0]) which allowed me to activate all oracle extensions in few clicks (php_oci8, php_oracle, php_pdo_oci, php_pdo_oci8).&lt;br /&gt;
&lt;br /&gt;
=== Install Moodle ===&lt;br /&gt;
On the database setup page:&amp;lt;br /&amp;gt;&lt;br /&gt;
Driver: Oracle oci8 (&amp;quot;oci8po&amp;quot; for a 1.9.x install and &amp;quot;oci&amp;quot; for a 2.0.x install)&amp;lt;br /&amp;gt;&lt;br /&gt;
Host: empty the field&amp;lt;br /&amp;gt;&lt;br /&gt;
Database: //localhost:1521/XE&amp;lt;br /&amp;gt;&lt;br /&gt;
User: the user that you created&amp;lt;br /&amp;gt;&lt;br /&gt;
Password: the password you gave to the user&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache ===&lt;br /&gt;
If you&#039;re running Moodle on Oracle with Apache on Linux, you might have issues with PHP being able to see the system environment variables.  To resolve this, you can edit /etc/sysconfig/apache2 and add the following lines to the bottom:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
LD_LIBRARY_PATH=/opt/oracle/instantclient_11_2# Set LANG Variables for UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
NLS_LANG=AMERICAN_AMERICA.AL32UTF8&amp;lt;br /&amp;gt;&lt;br /&gt;
LANG=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_ALL=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_COLLATE=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_CTYPE=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_MESSAGES=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_MONETARY=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_NUMERIC=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_TIME=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
export LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIM NLS_LANG LD_LIBRARY_PATH&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Also need to add those two lines to ~/.bashrc so that the PHP command-line client can see it too. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
* [http://lewiscarr.co.uk/node/4 Installing ORACLE drivers with PHP]&lt;br /&gt;
*[[Installing MSSQL for PHP]]&lt;br /&gt;
*[[PHP]]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=134729#p588963 Can i install Moodle with Oracle database]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=65488 Who uses Oracle]&lt;br /&gt;
*[https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Solaris_10_with_Oracle_10 Step by step Install Guide for Solaris 10 with Oracle 10]&lt;br /&gt;
*[http://learningischange.com/2009/05/29/install-moodle-on-an-oracle-database-in-25-minutes-or-less/ Install Moodle on an Oracle Database (in 25 minutes or less)]. The related Using Moodle forum discussion is [http://moodle.org/mod/forum/discuss.php?d=124629 here].&lt;br /&gt;
*[http://www.mguhlin.org/2009/05/moodle-on-oracle-database.html Moodle on Oracle Database] discussion on Miguel Guhlin&#039;s blog &lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_Oracle_for_PHP&amp;diff=81010</id>
		<title>Installing Oracle for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_Oracle_for_PHP&amp;diff=81010"/>
		<updated>2011-02-02T08:47:10Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Install Moodle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* http://www.oracle.com/technology/pub/notes/technote_php_instant.html&lt;br /&gt;
* http://moodle.org/mod/forum/discuss.php?d=65488#p308002 (with attached html document)&lt;br /&gt;
* http://es.php.net/oci8&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; Don&#039;t forget to enable this variable in your php.ini (or .htaccess)  file:&lt;br /&gt;
&lt;br /&gt;
(else, all your data will be escaped following MySQL rules, that are incorrect for Oracle)&lt;br /&gt;
&lt;br /&gt;
    magic_quotes_sybase = On&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Broken versions of OCI8 driver ==&lt;br /&gt;
&lt;br /&gt;
PHP v5.2.4 (and perhaps v5.2.3 as well) have shipped with a bug in the OCI8 driver that leaks statement handles. The version of the OCI8 driver with the bug is v1.2.4. Possible workarounds:&lt;br /&gt;
&lt;br /&gt;
* Upgrade to PHP v5.2.5 or later&lt;br /&gt;
* Downgrade to PHP v5.2.1 (reported to work)&lt;br /&gt;
* Downgrade only the oci8 driver to the one included in PHP 5.2.1 (it worked for us -- iarenaza)&lt;br /&gt;
* If you are on linux and/or can compile PECL extensions, install an older OCI8 driver (v1.2.3 seems to work) from the PECL repository http://pecl.php.net/package/oci8&lt;br /&gt;
&lt;br /&gt;
More information at&lt;br /&gt;
* http://bugs.php.net/bug.php?id=42496 -- tracking the PHP OCI8 bug&lt;br /&gt;
* http://tracker.moodle.org/browse/MDL-11429 -- diagnostics on the Moodle side&lt;br /&gt;
&lt;br /&gt;
== Installing Moodle on Windows with Oracle Express Edition ==&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
This section explains how to install Moodle with Oracle Express Edition on Windows. I&#039;m using it for &#039;&#039;&#039;debugging&#039;&#039;&#039; purpose. It&#039;s definitively not a production environment. The goal is to setup easily and quickly a Moodle/Windows/Oracle environment.&lt;br /&gt;
&lt;br /&gt;
=== Install Oracle ===&lt;br /&gt;
Download Oracle Express Edition on [http://www.oracle.com/technology/products/database/xe/index.html Oracle web site].&amp;lt;br /&amp;gt;&lt;br /&gt;
You will also need the Instant client [http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html from here] (free account sign up needed). Copy everything from the unzipped folder into apache/bin. &amp;lt;br /&amp;gt;&lt;br /&gt;
Install both.&amp;lt;br /&amp;gt;&lt;br /&gt;
Access to the oracle console (http://127.0.0.1:8080/apex). Login: SYS Password: the_one_you_entered_during_the_installation&amp;lt;br /&amp;gt;&lt;br /&gt;
Create a new user and give it all rights (including DBA).&amp;lt;br /&amp;gt;&lt;br /&gt;
Note: Oracle Express Edition 10g is limited at one database called &#039;XE&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Set up your oracle extension ===&lt;br /&gt;
This document does not explain how to setup apache/php for Oracle. You can have more information on [http://www.oracle.com/technology/tech/php/htdocs/php-oracle-tutorial.html Oracle Documentation]. On my own machine I used my WAMP installation ([http://www.en.wampserver.com/ Wampserver 2.0]) which allowed me to activate all oracle extensions in few clicks (php_oci8, php_oracle, php_pdo_oci, php_pdo_oci8).&lt;br /&gt;
&lt;br /&gt;
=== Install Moodle ===&lt;br /&gt;
On the database setup page:&amp;lt;br /&amp;gt;&lt;br /&gt;
Driver: Oracle oci8 (oci8po for a 1.9.x install)&amp;lt;br /&amp;gt;&lt;br /&gt;
Host: empty the field&amp;lt;br /&amp;gt;&lt;br /&gt;
Database: //localhost:1521/XE&amp;lt;br /&amp;gt;&lt;br /&gt;
User: the user that you created&amp;lt;br /&amp;gt;&lt;br /&gt;
Password: the password you gave to the user&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache ===&lt;br /&gt;
If you&#039;re running Moodle on Oracle with Apache on Linux, you might have issues with PHP being able to see the system environment variables.  To resolve this, you can edit /etc/sysconfig/apache2 and add the following lines to the bottom:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
LD_LIBRARY_PATH=/opt/oracle/instantclient_11_2# Set LANG Variables for UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
NLS_LANG=AMERICAN_AMERICA.AL32UTF8&amp;lt;br /&amp;gt;&lt;br /&gt;
LANG=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_ALL=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_COLLATE=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_CTYPE=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_MESSAGES=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_MONETARY=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_NUMERIC=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
LC_TIME=en_US.UTF-8&amp;lt;br /&amp;gt;&lt;br /&gt;
export LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIM NLS_LANG LD_LIBRARY_PATH&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Also need to add those two lines to ~/.bashrc so that the PHP command-line client can see it too. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
* [http://lewiscarr.co.uk/node/4 Installing ORACLE drivers with PHP]&lt;br /&gt;
*[[Installing MSSQL for PHP]]&lt;br /&gt;
*[[PHP]]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=134729#p588963 Can i install Moodle with Oracle database]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=65488 Who uses Oracle]&lt;br /&gt;
*[https://docs.moodle.org/en/Step-by-step_Install_Guide_for_Solaris_10_with_Oracle_10 Step by step Install Guide for Solaris 10 with Oracle 10]&lt;br /&gt;
*[http://learningischange.com/2009/05/29/install-moodle-on-an-oracle-database-in-25-minutes-or-less/ Install Moodle on an Oracle Database (in 25 minutes or less)]. The related Using Moodle forum discussion is [http://moodle.org/mod/forum/discuss.php?d=124629 here].&lt;br /&gt;
*[http://www.mguhlin.org/2009/05/moodle-on-oracle-database.html Moodle on Oracle Database] discussion on Miguel Guhlin&#039;s blog &lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:XMLDB]]&lt;br /&gt;
[[Category:DB]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Scheduled_Tasks_Proposal&amp;diff=78576</id>
		<title>Development:Scheduled Tasks Proposal</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Scheduled_Tasks_Proposal&amp;diff=78576"/>
		<updated>2010-12-02T05:33:27Z</updated>

		<summary type="html">&lt;p&gt;Aparup: /* Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.0}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This proposal is meant both to provide a replacement for the moodle cron job, and provide a means to schedule once off tasks to be run outside of the user&#039;s request lifecycle.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Subtask&#039;&#039;&#039; an individual piece of cron processing that should be run (equivalent to forum_cron now, or maybe even smaller)&lt;br /&gt;
* &#039;&#039;&#039;Moodle cron instance&#039;&#039;&#039; a cron.php process&lt;br /&gt;
&lt;br /&gt;
== Rationale ==&lt;br /&gt;
&lt;br /&gt;
The moodle cronjob currently delegates all scheduling to each subtask that is run - for example, the forum cron is responsible for checking when it last run, and making decisions about whether or not it should be run again.   This sort of decision process should be centralised, and individual cron subtasks should be called by the central controller.&lt;br /&gt;
&lt;br /&gt;
Additionally, there is not any central locking of subtasks.  At the moment, some subtasks that expect that they might take a long time to run implement their own locking (for example statistics), but it&#039;s not centralised.  Each moodle cron instance runs to completion, no matter how long it takes, and it processes tasks in the order that they&#039;re programmed, regardless of if there are any other moodle cron instances running, that might be processing sub tasks in parallel&lt;br /&gt;
&lt;br /&gt;
The existing events API seems like it should provide a way to schedule tasks to be run outside of a user&#039;s request cycle, but in reality this just adds to the existing cron problem.  We need to have a way in Moodle to schedule once off tasks to be run &amp;quot;at the next available time&amp;quot; which are picked up by cron.  This can be used to process the event queue, but also for some code to just register a new once off cron event &amp;quot;on the fly&amp;quot; and be picked up on the next run.&lt;br /&gt;
&lt;br /&gt;
Finally, we need to be able to run non-related tasks in parallel so that the entire moodle queue isn&#039;t held up by single long running jobs.&lt;br /&gt;
&lt;br /&gt;
== Goals ==&lt;br /&gt;
&lt;br /&gt;
* Centralised locking for &#039;&#039;&#039;all&#039;&#039;&#039; tasks&lt;br /&gt;
* A way consistent for &#039;&#039;&#039;all plugin types&#039;&#039;&#039; to register with Moodle (at installation/upgrade) when they want their jobs run&lt;br /&gt;
* More sophisticated scheduling rather than just intervals in seconds (eg every sunday at 11pm or similar) based on unix cron&lt;br /&gt;
* An administration screen in Moodle to allow site administrators to adjust the scheduling of individual tasks&lt;br /&gt;
* An easy way for core and module code to schedule a once off task to be run as soon as possible&lt;br /&gt;
&lt;br /&gt;
== Approach ==&lt;br /&gt;
&lt;br /&gt;
=== Plugin cron registration ===&lt;br /&gt;
&lt;br /&gt;
Each plugin will be able to provide a db/tasks.php (alongside access.php and events.php etc) that lists all the cronjobs that it wants to have run.  This will look something like the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$tasks = array(&lt;br /&gt;
    array(&lt;br /&gt;
        &#039;function&#039;    =&amp;gt; &#039;yourmodule_cron_somedescription&#039;,&lt;br /&gt;
        &#039;minute&#039;      =&amp;gt; &#039;*&#039;,&lt;br /&gt;
        &#039;hour&#039;        =&amp;gt; &#039;*&#039;,&lt;br /&gt;
        &#039;day&#039;         =&amp;gt; &#039;*&#039;,&lt;br /&gt;
        &#039;month&#039;       =&amp;gt; &#039;*&#039;,&lt;br /&gt;
        &#039;dayofweek&#039;   =&amp;gt; &#039;*&#039;,&lt;br /&gt;
        &#039;description&#039; =&amp;gt; &#039;langstringkey&#039;, // this must correspond to get_string(&#039;langstringkey&#039;, &#039;yourmodule&#039;);&lt;br /&gt;
    ),&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fields are the same as normal unix cron, with the exception that you cannot use 3 letter words for the month and day of week fields like you can for unix cron.  The following is straight from the unix manpage about cron:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              field          allowed values&lt;br /&gt;
              -----          --------------&lt;br /&gt;
              minute         0-59&lt;br /&gt;
              hour           0-23&lt;br /&gt;
              day of month   1-31&lt;br /&gt;
              month          1-12 (or names, see below)&lt;br /&gt;
              day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;
&lt;br /&gt;
       A field may be an asterisk (*), which always stands for ``first-last&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
       Ranges  of  numbers  are  allowed.  Ranges are two numbers separated with a hyphen.&lt;br /&gt;
       The specified range is inclusive.  For example, 8-11 for an ``hours&#039;&#039; entry specifies&lt;br /&gt;
       execution at hours 8, 9, 10 and 11.&lt;br /&gt;
&lt;br /&gt;
       Lists are allowed.  A list is a set of numbers (or ranges) separated by commas.&lt;br /&gt;
       Examples: ``1,2,5,9&#039;&#039;, ``0-4,8-12&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
       Step values can be used in conjunction with ranges.  Following a range with ``/&amp;lt;number&amp;gt;&#039;&#039;&lt;br /&gt;
       specifies  skips  of  the  number&#039;s  value  through  the  range.   For  example,&lt;br /&gt;
       ``0-23/2&#039;&#039; can be used in the hours field to specify command execution every other hour&lt;br /&gt;
       (the alternative in the V7 standard is ``0,2,4,6,8,10,12,14,16,18,20,22&#039;&#039;).  Steps&lt;br /&gt;
       are also permitted after an asterisk, so if you want to say ``every two hours&#039;&#039;, just use ``*/2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unix crontab manpage goes on to say that one can use 3 letter words in the month and dayofweek fields (eg Sun or Feb).  I don&#039;t think this is necessary for our implementation.&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;scheduled_tasks:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Datatype&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|id&lt;br /&gt;
|integer&lt;br /&gt;
|sequence&lt;br /&gt;
|-&lt;br /&gt;
|plugintype&lt;br /&gt;
|varchar(50)&lt;br /&gt;
|plugintype - should match the path-style declarations in get_plugin_types (eg question/type, not qtype).  Will be null for core tasks.&lt;br /&gt;
|-&lt;br /&gt;
|pluginname&lt;br /&gt;
|varchar(50)&lt;br /&gt;
|name of the plugin. Will be null for core tasks.&lt;br /&gt;
|-&lt;br /&gt;
|callfunction&lt;br /&gt;
|varchar(200) (unique)&lt;br /&gt;
|the function to call. Must be unique, as it will be used for the locking.&lt;br /&gt;
|-&lt;br /&gt;
|lastruntime&lt;br /&gt;
|int(10)&lt;br /&gt;
|unix timestamp&lt;br /&gt;
|-&lt;br /&gt;
|nextruntime&lt;br /&gt;
|int(10)&lt;br /&gt;
|unix timestamp&lt;br /&gt;
|-&lt;br /&gt;
|blocking&lt;br /&gt;
|int(1)&lt;br /&gt;
|0 or 1 - whether this task, when running, blocks everything else from running.&lt;br /&gt;
|-&lt;br /&gt;
|minute&lt;br /&gt;
|varchar(25)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|hour&lt;br /&gt;
|varchar(25)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|day&lt;br /&gt;
|varchar(25)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|month&lt;br /&gt;
|varchar(25)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|dayofweek&lt;br /&gt;
|varchar(25)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|customised&lt;br /&gt;
|integer(1)&lt;br /&gt;
|0 or 1 - whether this time differs from what is in code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This table is for all the normal scheduled regular tasks.  The time fields are intially populated when a plugin is installed or upgraded, but can be overridden by an administrator, which sets the &amp;quot;customised&amp;quot; flag to 1.  If the administrator later decides to revert their customisation, the original code-values are repopulated into this table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;scheduled_onceoff_tasks:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Datatype&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|id&lt;br /&gt;
|integer&lt;br /&gt;
|sequence&lt;br /&gt;
|-&lt;br /&gt;
|plugintype&lt;br /&gt;
|varchar(50)&lt;br /&gt;
|plugintype - should match the path-style declarations in get_plugin_types (eg question/type, not qtype).  Will be null for core tasks.&lt;br /&gt;
|-&lt;br /&gt;
|pluginname&lt;br /&gt;
|varchar(50)&lt;br /&gt;
|name of the plugin. Will be null for core tasks.&lt;br /&gt;
|-&lt;br /&gt;
|callfunction&lt;br /&gt;
|varchar(200) (unique)&lt;br /&gt;
|the function to call. Must be unique, as it will be used for the locking.&lt;br /&gt;
|-&lt;br /&gt;
|nextruntime&lt;br /&gt;
|int(10)&lt;br /&gt;
|unix timestamp&lt;br /&gt;
|-&lt;br /&gt;
|customdata&lt;br /&gt;
|text&lt;br /&gt;
|any data or serialised information&lt;br /&gt;
|-&lt;br /&gt;
|blocking&lt;br /&gt;
|int(1)&lt;br /&gt;
|0 or 1 - whether this task, when running, blocks everything else from running.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This table is for the once off tasks, which are run and then deleted.  There isn&#039;t a unique constraint on &#039;callfunction&#039; in this table, because the same once off task may be scheduled twice before the first one is processed.  In this case, the named lock will be obtained using a combination of callfunction and the id.&lt;br /&gt;
&lt;br /&gt;
The original database specification had extra custom fields in the main scheduled_tasks table, that the cronjobs could insert information into, called custom1 and custom2 and so on.  I&#039;ve removed these from this specification until such time as we have a solid use-case for them.  It is certain that we need it for the once off tasks, however, but in this case I think it&#039;s better to just have a text field that can either contain a single value, or a serialised blob of information.&lt;br /&gt;
&lt;br /&gt;
The original spec also had a priority field, but this has been removed after the conversation in Jizerka, which led to the proposal to just let some jobs block all others, rather than prioritising individual tasks.  &#039;&#039;&#039;This decision may be later reverted&#039;&#039;&#039; especially for once off tasks, where some may be really urgent.&lt;br /&gt;
&lt;br /&gt;
=== Locking ===&lt;br /&gt;
&lt;br /&gt;
Penny and Tim originally thought that the best approach was to try and do something that would cause an exception to be thrown - for example, try to insert into a row that had a unique constraint on it, and catch the exception.  However, this will cause far too much noise in the logs.  Matt Oquist came up with a different approach in MDL-21110.  We could potentially change this slightly to allow alternative implementations, by means of an abstract class and factory method (this was suggested by Sam Marshall), but probaby isn&#039;t needed for the initial implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Black magic ===&lt;br /&gt;
&lt;br /&gt;
Cron.php will need to be rewritten to look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
while ($nexttask = cron_get_next_task()) {&lt;br /&gt;
    cron_call_function($nexttask);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With some black magic to hand out the next task, which does:&lt;br /&gt;
&lt;br /&gt;
* Checks how long the existing process is allowed to run for&lt;br /&gt;
* Figures out if there&#039;s already a &amp;quot;blocking&amp;quot; task running&lt;br /&gt;
* Figures out the next task that&#039;s scheduled&lt;br /&gt;
* Tries to get a lock on it&lt;br /&gt;
* Returns that task&lt;br /&gt;
&lt;br /&gt;
== Unresolved issues/ideas ==&lt;br /&gt;
&lt;br /&gt;
* It might be nice at some point to find a way to allow different subtasks to run on different servers by designation.  This could be eventually added in to the administration screens as an extra setting (IP address)&lt;br /&gt;
* We obviously need some way to avoid different tasks trampling on eachother.  We ran through a number of ideas already, from differentiating between read/write operations, to having dependencies or conflicts between tasks, to having each task say which database tables it uses.   Finally we decided it would be best to just have some tasks that are able to simply block all others from being run.  Anything to do with authentication and enrolment must block other tasks from running, as otherwise there could be the problem of for example, forum posts being emailed out just before someone is unenrolled from a course.&lt;br /&gt;
* When the first cron in a long time is running, we should lock the entire cron and let it run to completeness, because the order is really important then.  This means that there also needs to be some global lastcronruntime flag somewhere (like in the config table)&lt;br /&gt;
&lt;br /&gt;
== Psuedo code proposal ==&lt;br /&gt;
Moved [[Development_talk:Scheduled_Tasks_Proposal|to the talk page]]&lt;br /&gt;
&lt;br /&gt;
== Audit of current cron ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Main section&lt;br /&gt;
! Subtask&lt;br /&gt;
! Frequency&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| session_gc&lt;br /&gt;
|&lt;br /&gt;
| every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mod/assignment&lt;br /&gt;
|plugins (none)&lt;br /&gt;
|every minute&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mod/assignment&lt;br /&gt;
|message submissions&lt;br /&gt;
|every minute&lt;br /&gt;
|checks last run time&lt;br /&gt;
|-&lt;br /&gt;
|mod/chat&lt;br /&gt;
|update chat times&lt;br /&gt;
|every five minutes&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mod/chat&lt;br /&gt;
|update_events&lt;br /&gt;
|every five minutes&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mod/chat&lt;br /&gt;
|delete old chat_users and add quits&lt;br /&gt;
|every five minutes&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mod/chat&lt;br /&gt;
|delete old messages&lt;br /&gt;
|every five minutes&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mod/data&lt;br /&gt;
|&lt;br /&gt;
|every minute&lt;br /&gt;
|no _cron function (includes file unnecessarily)&lt;br /&gt;
|-&lt;br /&gt;
|mod/forum&lt;br /&gt;
|mail posts&lt;br /&gt;
|every minute&lt;br /&gt;
|checks last run time&lt;br /&gt;
|-&lt;br /&gt;
|mod/forum&lt;br /&gt;
|digest processing&lt;br /&gt;
|every minute&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mod/forum&lt;br /&gt;
|delete old read tracking&lt;br /&gt;
|every minute&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mod/scorm&lt;br /&gt;
|reparse all scorms&lt;br /&gt;
|every five minutes&lt;br /&gt;
|does hourly checking&lt;br /&gt;
|-&lt;br /&gt;
|mod/wiki&lt;br /&gt;
|delete expired locks&lt;br /&gt;
|every hour&lt;br /&gt;
|-&lt;br /&gt;
|blocks/rss_client&lt;br /&gt;
|update feeds&lt;br /&gt;
|every five minutes&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|quiz/report/statistics&lt;br /&gt;
|delete old statistics&lt;br /&gt;
|every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|admin/reports&lt;br /&gt;
|none&lt;br /&gt;
|every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|language_cache&lt;br /&gt;
&lt;br /&gt;
|every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|remove expired enrolments&lt;br /&gt;
|&lt;br /&gt;
|every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|main gradebook&lt;br /&gt;
|lock pending grades (*2)&lt;br /&gt;
|every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|main gradebook&lt;br /&gt;
|clean old grade history&lt;br /&gt;
|every run&lt;br /&gt;
|has a TODO to not process as often&lt;br /&gt;
|-&lt;br /&gt;
|event queue&lt;br /&gt;
|&lt;br /&gt;
|every run&lt;br /&gt;
|potentially large&lt;br /&gt;
|-&lt;br /&gt;
|portfolio cron&lt;br /&gt;
|clean expired exports&lt;br /&gt;
|every run&lt;br /&gt;
|potentially large&lt;br /&gt;
|-&lt;br /&gt;
|longtimenosee&lt;br /&gt;
&lt;br /&gt;
|20%&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|deleteunconfirmedusers&lt;br /&gt;
|&lt;br /&gt;
|20%&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|deleteincompleteusers&lt;br /&gt;
|&lt;br /&gt;
|20%&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|deleteoldlogs&lt;br /&gt;
|&lt;br /&gt;
|20%&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|deletefiltercache&lt;br /&gt;
|&lt;br /&gt;
|20%&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|notifyloginfailures&lt;br /&gt;
|&lt;br /&gt;
|20%&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|metacourse syncing&lt;br /&gt;
|&lt;br /&gt;
|20%&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|createpasswordemails&lt;br /&gt;
|&lt;br /&gt;
|20%&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|tag cron&lt;br /&gt;
|&lt;br /&gt;
|20%&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|clean contexts&lt;br /&gt;
|&lt;br /&gt;
|20%&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|gc_cache_flags&lt;br /&gt;
|&lt;br /&gt;
|20%&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|build_context_path&lt;br /&gt;
|&lt;br /&gt;
|20%&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|scheduled backups&lt;br /&gt;
|&lt;br /&gt;
|daily (admin defined)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|make rss feeds&lt;br /&gt;
|&lt;br /&gt;
|every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auth/mnet&lt;br /&gt;
|keepalives&lt;br /&gt;
|every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auth/mnet&lt;br /&gt;
|delete old sessions&lt;br /&gt;
|every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auth/ldap&lt;br /&gt;
|sync users&lt;br /&gt;
|custom&lt;br /&gt;
|not scheduled (external cronjob)&lt;br /&gt;
|-&lt;br /&gt;
|auth/cas&lt;br /&gt;
|sync users&lt;br /&gt;
|custom&lt;br /&gt;
|not scheduled (external cronjob)&lt;br /&gt;
|-&lt;br /&gt;
|auth/db&lt;br /&gt;
|sync users&lt;br /&gt;
|custom&lt;br /&gt;
|not scheduled (external cronjob)&lt;br /&gt;
|-&lt;br /&gt;
|enrol/authorize&lt;br /&gt;
|clears old data&lt;br /&gt;
|daily (admin defined)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|enrol/authorize&lt;br /&gt;
|notifies administrators of old data&lt;br /&gt;
|daily (admin defined)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|enrol/authorize&lt;br /&gt;
|process orders &amp;amp; email teachers&lt;br /&gt;
|every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|enrol/flatfile&lt;br /&gt;
|read file and sync users&lt;br /&gt;
|every run&lt;br /&gt;
|!?!&lt;br /&gt;
|-&lt;br /&gt;
|enrol/imsenterprise&lt;br /&gt;
|read file and sync users&lt;br /&gt;
|every run&lt;br /&gt;
|!?!?!&lt;br /&gt;
|-&lt;br /&gt;
|enrol/manual&lt;br /&gt;
|notify people of pending unenrolments&lt;br /&gt;
|daily&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|statistics&lt;br /&gt;
|&lt;br /&gt;
|daily (admin defined)&lt;br /&gt;
|huge&lt;br /&gt;
|-&lt;br /&gt;
|grade/import&lt;br /&gt;
|none&lt;br /&gt;
|every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|grade/export&lt;br /&gt;
|none&lt;br /&gt;
|every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|grade/reports&lt;br /&gt;
|none&lt;br /&gt;
|every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|fetch blog entries&lt;br /&gt;
|&lt;br /&gt;
|every run&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|file gc&lt;br /&gt;
|&lt;br /&gt;
|(optional) daily, else every run?&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|local cron&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
* Audit all existing cronjobs (done)&lt;br /&gt;
* Implement the locking code, either Matt&#039;s or something similar and write robust tests for it (this will be hard to test perhaps - can we test race conditions using simpletest?)&lt;br /&gt;
* Write the black magic that hands out the next task to be run for a given cron process&lt;br /&gt;
* Rewrite cron.php to use the black magic&lt;br /&gt;
* Migrate all the existing cronjobs to the new system&lt;br /&gt;
* Write screens to allow administrators to reschedule tasks&lt;br /&gt;
* Write code to transfer between unix-cron-syntax and user-friendly syntax (and vice versa)&lt;br /&gt;
* Write code to capture requests to schedule once off tasks&lt;br /&gt;
* Update portfolio code to use once off tasks rather than events API&lt;br /&gt;
* Evaluate integration of event API to once off tasks&lt;br /&gt;
* Test thoroughly&lt;br /&gt;
&lt;br /&gt;
The above tasks are now in MDL-25499 as sub-tasks to implement this proposal.&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=77603</id>
		<title>Installing MSSQL for PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_MSSQL_for_PHP&amp;diff=77603"/>
		<updated>2010-11-09T07:31:49Z</updated>

		<summary type="html">&lt;p&gt;Aparup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 1.7}}{{Moodle 1.9}}{{Moodle 2.0}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This short manual is suitable if you are trying to run Moodle 1.7 (and upwards) using the SQL*Server (MSSQL) RDBMS. Steps detailed below must be performed &#039;&#039;&#039;before&#039;&#039;&#039; installing Moodle itself.&lt;br /&gt;
&lt;br /&gt;
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), although it &#039;&#039;&#039;might work with MSSQL 2000 (v.8) or newer&#039;&#039;&#039;. All the development process has been performed using MSSQL 2005 and there could be some &#039;&#039;&#039;unknown problems&#039;&#039;&#039; with previous releases.&lt;br /&gt;
&lt;br /&gt;
While PHP comes with one, more or less, standard extension (mssql) that provides access to MSSQL databases, early we found some hard limits on it. Basically such default extension has some limits that prevent us to use it at all (you can find more info about these problems [[Development:XMLDB problems#MSSQL, PHP, UTF-8 and UCS-2|here]]).&lt;br /&gt;
&lt;br /&gt;
So, in order to allow PHP (i.e. Moodle) to access to MSSQL DBs properly we have to install a &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; to save us from the problems related above. See the sections below for details about the various options.&lt;br /&gt;
&lt;br /&gt;
== Installation overview ==&lt;br /&gt;
&lt;br /&gt;
1. Get MSSQL Server installed and running. ([http://www.microsoft.com/sql/editions/express/default.mspx A free limited version, SQL Server Express Edition] is available for testing.)&lt;br /&gt;
:Make sure that you choose mixed authentication (Windows and local accounts) to keep things simpler later.  You&#039;ll be asked to define the  &amp;quot;sa&amp;quot; account password (it&#039;s the default System Administrator account which has full access to all databases by default).&lt;br /&gt;
&lt;br /&gt;
2. Make sure MS SQL Server can accept incoming TCP/IP connections on port 1433 (the standard one).&lt;br /&gt;
:You might need to explicitly allow this in your Windows firewall (see the Control Panel).  You may also need to edit options in the :&#039;&#039;&#039;SQL Server Configuration Manager&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Network Configuration&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Protocols&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;TCP/IP enabled&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Open the &amp;quot;SQL Server Management Studio&amp;quot; and create a new empty database.  If you are using the &amp;quot;sa&amp;quot; account then you don&#039;t need to do anything else here.&lt;br /&gt;
&lt;br /&gt;
4. Configure these settings in your created (and still empty) database:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true (ALTER DATABASE xxxx SET ANSI_NULLS ON)&lt;br /&gt;
:* Quoted Identifiers Enabled = true (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)&lt;br /&gt;
:* Moodle 2.0 only: Row Versioning Enabled (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)&lt;br /&gt;
&lt;br /&gt;
5. Get PHP installed with a web server.   Unless you want to do it under IIS or some other way, the packages on the [http://download.moodle.org Moodle download page] are a good solution.&lt;br /&gt;
&lt;br /&gt;
6. Choose one of the following specific sections for your server to install the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; installed and running properly on your PHP box.&lt;br /&gt;
&lt;br /&gt;
7. Set the following settings in your php.ini file&lt;br /&gt;
:* mssql.textlimit = 20971520&lt;br /&gt;
:* mssql.textsize = 20971520&lt;br /&gt;
:Also, don&#039;t forget to set one of the following &#039;&#039;&#039;alternatives&#039;&#039;&#039;, in order to get all the data properly &amp;quot;slashed&amp;quot;:&lt;br /&gt;
:* magic_quotes_gpc = Off  &#039;&#039;&#039;or&#039;&#039;&#039;&lt;br /&gt;
:* magic_quotes_gpc = On &#039;&#039;&#039;and&#039;&#039;&#039; magic_quotes_sybase = On &lt;br /&gt;
&lt;br /&gt;
8. With all this properly configured, you can continue with a [[Installing Moodle|standard Moodle installation]].&lt;br /&gt;
&lt;br /&gt;
== Using FreeTDS on 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;
| 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 Alastair Hole by providing the PHP 5.3 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_n&#039;;        // Required&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // assuming MS SQL is on the same server, otherwise use an IP&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // or whatever you called the database you created&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but 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;
*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;
== Using FreeTDS 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].&lt;br /&gt;
&lt;br /&gt;
== Using ODBTP on Unix or Windows ==&lt;br /&gt;
&lt;br /&gt;
You can download ODBTP from http://odbtp.sourceforge.net/. Also you will access to the documentation from the same page.&lt;br /&gt;
&lt;br /&gt;
The downloaded package includes both the source code and some binaries to be installed in the server and some ready-to-use &#039;&#039;&#039;mssql extension alternatives&#039;&#039;&#039; for some platforms/PHP versions (so you won&#039;t need to compile it if your PHP server/version binary package is present).&lt;br /&gt;
&lt;br /&gt;
First of all, we have to install the Win32 service that comes with the package. Let&#039;s assume that it&#039;s going to run in the same Win32 machine where your MSSQL server is running (although it can run in any other Win32 server in your network).&lt;br /&gt;
&lt;br /&gt;
To do do, following the instructions present in http://odbtp.sourceforge.net/install.html, you must:&lt;br /&gt;
&lt;br /&gt;
Do the following on the MSSQL server:&lt;br /&gt;
# Create a directory on the Windows host where the service program files will reside, i.e., md odbtp.&lt;br /&gt;
# Copy the files odbtpctl.exe, odbtpsrv.exe and odbtpsrv.ini files from the winservice directory into the directory created in step 1.&lt;br /&gt;
# Edit the file odbtpsrv.ini of the previous step and this line: &amp;lt;pre&amp;gt;MaxRequestSize=20971520&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Open a command prompt (cmd) window on the Windows host.&lt;br /&gt;
# Change to the directory to which the service program files were copied, i.e., cd odbtp.&lt;br /&gt;
# Run the following commands to install and start the service:&lt;br /&gt;
#*   odbtpctl install&lt;br /&gt;
#*   odbtpctl start&lt;br /&gt;
# With these steps you should have one new service running in your host called &amp;quot;odbtp&amp;quot;. Verify it&#039;s present and running in the &amp;quot;Services&amp;quot; control panel.&lt;br /&gt;
# Don&#039;t forget to enable TCP/IP incoming connections to port 2799 in the host you have installed the service!&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s time to build the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039;. First of all, verify if, in the downloaded package, under the &amp;quot;php&amp;quot; dir, there is one extension suitable for your PHP server/version. If it&#039;s present, you can simply copy it to the php/extensions dir in your PHP server and skip next points about compiling it from source. It&#039;s important to point that, inside each directory, you&#039;ll find &#039;&#039;&#039;two different&#039;&#039;&#039; libraries/dll files. The one that must be copied to the extensions dir is the one called &#039;&#039;&#039;&amp;quot;php_odbtp_mssql.xxx&amp;quot;&#039;&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
If in the downloaded package isn&#039;t present the extension matching your PHP platform/version, you should build if from source files. To do that, just &#039;&#039;&#039;&amp;quot;configure, make, make install&amp;quot;&#039;&#039;&#039;. That will create some stuff under &amp;quot;/usr/local&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve successfully built ODBTP is time to create the &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; that will provide us with the capacity of handling MSSQL DBs from within Moodle. To do so, just configure your PHP server adding this new option to the usual ones:&lt;br /&gt;
&lt;br /&gt;
  --with-odbtp-mssql&lt;br /&gt;
&lt;br /&gt;
then, after the standard &amp;quot;make and make install&amp;quot; steps, your PHP server will be built with MSSQL support provided by ODBTP.&lt;br /&gt;
&lt;br /&gt;
Do the following on the moodle webserver:&lt;br /&gt;
Finally, independently if we are using the binary extension provided in the download or if you have built it from source files, it&#039;s time to configure the extension. &lt;br /&gt;
1. To do so, add this lines, if no present, to your php.ini file:&lt;br /&gt;
&lt;br /&gt;
  extension=php_odbtp_mssql.dll&lt;br /&gt;
&lt;br /&gt;
(only for Win32 PHP servers!)&lt;br /&gt;
&lt;br /&gt;
2. And, for all the server platforms: &lt;br /&gt;
&lt;br /&gt;
  [odbtp]&lt;br /&gt;
  odbtp.interface_file = &amp;quot;/path/to/your/odbtp.conf&amp;quot;&lt;br /&gt;
  odbtp.datetime_format = mdyhmsf&lt;br /&gt;
  odbtp.detach_default_queries = yes&lt;br /&gt;
&lt;br /&gt;
(where &#039;&#039;&amp;quot;/path/to/your/odbtp.conf&amp;quot;&#039;&#039; is usually &#039;&#039;&#039;&amp;quot;/usr/local/etc/odbtp.conf&amp;quot;&#039;&#039;&#039; for Unix systems and &#039;&#039;&#039;&amp;quot;C:\odbtp\odbtp.conf&amp;quot;&#039;&#039;&#039; for Windows systems)&lt;br /&gt;
&lt;br /&gt;
Then, edit such &amp;quot;odbtp.conf&amp;quot; file and put there these contents:&lt;br /&gt;
&lt;br /&gt;
  [global]&lt;br /&gt;
  odbtp host = xxx.xxx.xxx (ip or hostname of the Win32 box running the ODBTP service i.e MSSQL server)&lt;br /&gt;
  type = mssql&lt;br /&gt;
  unicode sql = yes&lt;br /&gt;
  use row cache = yes&lt;br /&gt;
  right trim text = yes&lt;br /&gt;
  var data size = 20971520&lt;br /&gt;
&lt;br /&gt;
With this, your PHP server will be able to connect with the MSSQL DB server using ODBTP. From here, just continue with the installation.&lt;br /&gt;
&lt;br /&gt;
Finally, if you find the ODBTP executables and &#039;&#039;&#039;mssql extension alternative&#039;&#039;&#039; in binary formats, it only will be necessary to install them in your server (binary packages...) without the need to recompile anything (just the php.ini and odbtp.conf edition steps above will be necessary). Of course, it will be really welcome to have all those binary alternatives documented here.&lt;br /&gt;
&lt;br /&gt;
Once ODBTP is working, Moodle config.php 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_n&#039;;        // Required&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;localhost&#039;;      // assuming MS SQL is on the same server, otherwise use an IP&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;moodle&#039;;         // or whatever you called the database you created&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but 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.&lt;br /&gt;
&lt;br /&gt;
== Using ODBC on Windows ==&lt;br /&gt;
[[ODBC]] allows communication with an SQL database.&lt;br /&gt;
{{Not for production sites}}&lt;br /&gt;
&lt;br /&gt;
1. Go to the &#039;&#039;&#039;Administrative Tools&#039;&#039;&#039;  control panel, then the &#039;&#039;&#039;Data Sources (ODBC)&#039;&#039;&#039; panel.&lt;br /&gt;
&lt;br /&gt;
2. Configure one new System/User DSN (call it, for example &amp;quot;moodle&amp;quot;). Dont forget to enable these options if the driver asks for them:&lt;br /&gt;
&lt;br /&gt;
:* ANSI NULLS Enabled = true&lt;br /&gt;
:* Quoted Identifiers Enabled = true&lt;br /&gt;
&lt;br /&gt;
3. Your Moodle config.php should include lines like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dbtype    = &#039;odbc_mssql&#039;;     // Note this is different to all the other configs on this page!&lt;br /&gt;
$CFG-&amp;gt;dbhost    = &#039;moodle&#039;;         // Where this matches the Data source name you chose above&lt;br /&gt;
$CFG-&amp;gt;dbname    = &#039;&#039;;               // Keep it blank!!&lt;br /&gt;
$CFG-&amp;gt;dbuser    = &#039;yourusername&#039;;   // I usually use the &#039;sa&#039; account (dbowner perms are enough)&lt;br /&gt;
$CFG-&amp;gt;dbpass    = &#039;yourpassword&#039;;&lt;br /&gt;
$CFG-&amp;gt;dbpersist =  false;&lt;br /&gt;
$CFG-&amp;gt;prefix    = &#039;mdl_&#039;;            //Prefix, you can change it, but NEVER leave it blank.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Install Moodle as usual.  Good luck!&lt;br /&gt;
&lt;br /&gt;
== Using the SQL Server 2005 Driver for PHP from Microsoft ==&lt;br /&gt;
In July 2008 Microsoft [http://social.msdn.microsoft.com/forums/en-US/sqldriverforphp/thread/a10e5202-9e41-4ff8-a33e-fbcc7b951be2/ released] their new SQL Server 2005 Driver for PHP. It is a PHP extension that allows for the reading and writing of SQL Server data from within PHP scripts. However there are some limitations with this driver that make it incompatible with Moodle, e.g.:&lt;br /&gt;
&lt;br /&gt;
* limitations with how it handles UTF-8 strings and &lt;br /&gt;
* it does not support the legacy mssql php driver function names&lt;br /&gt;
&lt;br /&gt;
For more info see MDL-16497 and MDL-15093.&lt;br /&gt;
&lt;br /&gt;
So, for now, you should not use this driver with Moodle 1.9.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Installing Moodle]]&lt;br /&gt;
* [[Errors FAQ]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]&lt;br /&gt;
* [[Beginning Administration FAQ]]&lt;br /&gt;
* [[Installing Oracle for PHP]]&lt;br /&gt;
&lt;br /&gt;
* [[Category:FAQ]]&lt;br /&gt;
* [[Category:Installation]]&lt;br /&gt;
* [[Category:Developer]]&lt;br /&gt;
* [[Category:XMLDB]]&lt;br /&gt;
* [[Category:DB]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Using_Wiki&amp;diff=75965</id>
		<title>Using Wiki</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Using_Wiki&amp;diff=75965"/>
		<updated>2010-09-20T03:08:01Z</updated>

		<summary type="html">&lt;p&gt;Aparup: changed to say doble square brackets instead of single to add a page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Wiki}}&lt;br /&gt;
This page is for documentation on how to use the wiki activity i.e. View, Edit, Links, History and is redirected from mod/wiki/view, a help page. &lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
[[Image:Wiki_tabs.JPG]]&lt;br /&gt;
A wiki has 4 tabs, the most commonly used tabs are view and edit.&lt;br /&gt;
&lt;br /&gt;
==Adding a wiki page==&lt;br /&gt;
There are several ways to add a new wiki page.  In later versions of Moodle, the course participant&#039;s privileges can affect adding or editing wiki pages.  First you will create a link to a page that does not exist, then the wiki will create the blank page which someone can edit.&lt;br /&gt;
=== From a Wiki page===&lt;br /&gt;
This is the easiest way to add a page (or the first one that worked for me!).  Participants in a Wiki can create a new page by editing an existing Wiki page and adding a Wiki link that points to the page they want to create.  A Wiki link is simply any character string enclosed in square brackets.  The string is converted to a link by the following process:&lt;br /&gt;
&lt;br /&gt;
# Click the &#039;&#039;Edit&#039;&#039; tab on the front page of the Wiki &lt;br /&gt;
# In the edit box type the title of the new page that you want to create.  Enclose the title text in DOUBLE square brackets. Like this(but with double square brackets instead):  [[Image:Wiki non linked page example 1.JPG|center]]&lt;br /&gt;
# Click &#039;&#039;Save&#039;&#039;.&lt;br /&gt;
# The page you have just edited will now be displayed.  The words &amp;quot;My First Added Page&amp;quot; will be displayed with a question mark link immediately after it and may look like:[[Image:Wiki non linked page example 2.JPG|center]]&lt;br /&gt;
# Click on the &amp;quot;?&amp;quot; and you will be taken to an edit screen for a new page called:- &amp;quot;My First Added Page&amp;quot;&lt;br /&gt;
# Edit this new page with text as you will, and then click &#039;&#039;Save&#039;&#039;.  You just created a new wiki linkable page. &lt;br /&gt;
# Want to check the link by going back to the original Wiki page?  &lt;br /&gt;
##Click on the page link under &amp;quot;referring links&amp;quot; at the bottom of the new page in view mode.&lt;br /&gt;
##Another way is to click the &#039;&#039;- Choose Wiki Links -&#039;&#039; box, and then, from the drop down menu, select &#039;&#039;Site map&#039;&#039;.  Click on the original page displayed on the screen.  The words &amp;quot;My First Added Page&amp;quot; will have now become a link to your new page, a Wiki link.  &lt;br /&gt;
# Bingo!&lt;br /&gt;
&lt;br /&gt;
===Add by initial wiki creation===&lt;br /&gt;
When the teacher selects &#039;&#039;&#039;Wiki&#039;&#039;&#039; from the [[Adding resources and activities|Add an Activity&lt;br /&gt;
]] pull down menus in a course, they will be asked to create the first page.&lt;br /&gt;
&lt;br /&gt;
===Add by using search ===&lt;br /&gt;
In some versions of Moodle (not in 1.8 standard), any participant (with correct privileges) of an existing wiki can enter the name of the page they would like to create in the Search box on a wiki page.  For example they might enter the name &amp;quot;Roses&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: If the page already exists &lt;br /&gt;
::they will be taken to the page &amp;quot;Roses&amp;quot;&lt;br /&gt;
: If the page does not exist, they will see:&lt;br /&gt;
:: &#039;&#039;&#039;There is no page titled &amp;quot;Roses&amp;quot;&#039;&#039;&#039; &lt;br /&gt;
::They can create this page by clicking on the &amp;quot;create this page&amp;quot; link &lt;br /&gt;
::and begin editing the new page called &amp;quot;Roses&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Editing a wiki page==&lt;br /&gt;
Editing the standard Moodle wiki is simple&lt;br /&gt;
* Click on the &#039;&#039;&#039;edit&#039;&#039;&#039; tag at the top of the wiki page&lt;br /&gt;
* Edit the text&lt;br /&gt;
* Then save the page, or preview the page before saving&lt;br /&gt;
&lt;br /&gt;
* Remember that MoodleDocs is a different(more robust and complicated) kind of wiki than the standard Moodle wiki. Many MoodleDoc or WikiMedia wiki tags (See [[Help:Editing]]) &#039;&#039;&#039;may not&#039;&#039;&#039; work in the standard Moodle wiki in versions 1.8 and earlier.&lt;br /&gt;
The standard help file gives the basics of editing in ErfurtWiki. See [http://moodle.org/help.php?module=wiki&amp;amp;file=howtowiki.html&amp;amp;forcelang=#createpages Moodle Help Docs on How to wiki]&lt;br /&gt;
&lt;br /&gt;
==Wiki search==&lt;br /&gt;
Wiki search ignores hyperlinks so it is wise to add a &amp;quot;Keywords:&amp;quot; line which contains the words of the the page title separated by commas, and any other entries that you wish to be found by the search.&lt;br /&gt;
&lt;br /&gt;
=NWiki=&lt;br /&gt;
&lt;br /&gt;
if you are using Ludo&#039;s new Nwiki module, there are some additional features.&lt;br /&gt;
&lt;br /&gt;
==Change to one of the following editors==&lt;br /&gt;
&lt;br /&gt;
Nwiki has several parsers, each one requiring a different sort of text. Its best to choose properly at the beginning, as altering half way through is not a good idea - they may well make a mess of text with a different formatting.&lt;br /&gt;
* HTMLeditor - the default editor that is used for all other moodle forms&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=115&amp;amp;filter=1 DFwiki] - the parsing engine from a previous third-party version of the wiki software. You or your students may be familiar with this and wish to continue using it&lt;br /&gt;
* Ewiki - the parsing engine from the previous default moodle wiki.&lt;br /&gt;
* nwiki - the most up to date engine, which is almost identical to the one used by wikipedia.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Also See==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=1015 OUWiki] (Plugin)&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=570 Tiddlywiki integration] (Plugin)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Wiki]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Afficher un wiki]]&lt;br /&gt;
[[de:Wiki ansehen]]&lt;br /&gt;
[[ja:Wikiを閲覧する]]&lt;/div&gt;</summary>
		<author><name>Aparup</name></author>
	</entry>
</feed>