Fixes bug MDL-8234, "New groups code & AS keyword"
[moodle-pu.git] / lang / en_utf8 / docs / installamp.html
blob50fa38eb93eb8cd1c4bd08acea5877eb3a9df727
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>Moodle Docs: Installing PHP and MySQL</title>
6 <link rel="stylesheet" href="docstyles.css" type="TEXT/CSS" />
7 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
8 </head>
10 <body>
11 <h1>Installing Apache, MySQL and PHP</h1>
12 <blockquote>
13 <p>Moodle is written in a scripting language called PHP, and stores most of its
14 data in a database. The database we recommend is MySQL. Before installing Moodle
15 you must have a working PHP installation and a working database to turn your
16 computer into a functional web server platform. These packages can be tricky
17 to set up for average computer users, so this page has been written to try to
18 make this process as simple as possible for different platforms:</p>
19 <ul>
20 <li><a href="#host" class="questionlink">Hosting Service</a></li>
21 <li><a href="#mac" class="questionlink">Mac OS X</a></li>
22 <li><a href="#redhat" class="questionlink">Redhat Linux</a></li>
23 <li><a href="#windows" class="questionlink">Windows</a></li>
24 </ul>
25 <p class="questionlink">&nbsp;</p>
26 <h3 class="sectionheading"><a name="host" id="host"></a>Hosting Service</h3>
27 <blockquote>
28 <p>Unfortunately hosting services vary quite a lot in the way they work. Some
29 will even install Moodle for you.</p>
30 <p>Most will offer a web-based control panel to control your site, create databases
31 and set up cron. Some may also offer terminal access via ssh, so that you
32 can use the command shell to do things.</p>
33 <p>You should work your way through the <a href="./?file=install.html">Installation
34 guide</a> and take each step at a time. Ask your hosting provider if you get
35 stuck. </p>
36 <p>&nbsp;</p>
37 </blockquote>
38 <h3 class="sectionheading"><a name="mac" id="mac"></a>Mac OS X</h3>
39 <blockquote>
40 <p>The easiest way to do this is use the Apache server that Apple provides,
41 and add PHP and MySQL using Marc Liyanage's packages. Both of the pages below
42 come with good instructions that we won't duplicate here:</p>
43 <blockquote>
44 <p><strong>PHP</strong>: Download from here: <a href="http://www.entropy.ch/software/macosx/php/" target="_top">http://www.entropy.ch/software/macosx/php/</a></p>
45 <p><strong>MySQL</strong>: Download here: <a href="http://www.entropy.ch/software/macosx/mysql/" target="_top">http://www.entropy.ch/software/macosx/mysql/</a></p>
46 </blockquote>
47 <p>Once these are installed the standard <a href="./?file=install.html">Installation
48 guide</a> should be fairly straightforward.</p>
49 <p>A more detailed walkthrough is here: <a href="http://moodle.org/wiki/index.php/InstallingMoodle">http://moodle.org/wiki/index.php/InstallingMoodle</a></p>
50 <p>&nbsp;</p>
51 </blockquote>
52 <h3 class="sectionheading"><a name="redhat"></a>Redhat Linux</h3>
53 <blockquote>
54 <p>You should install all available RPM packages for Apache, PHP and MySQL.
55 One package that people frequently forget is the php-mysql package which is
56 necessary for PHP to talk to MySQL.</p>
57 <p>Once these are installed the standard <a href="./?file=install.html">Installation
58 guide</a> should be fairly straightforward.</p>
59 <p>A more detailed walkthrough is here: <a href="http://moodle.org/wiki/index.php/InstallingMoodle">http://moodle.org/wiki/index.php/InstallingMoodle</a></p>
60 </blockquote>
61 <p>&nbsp;</p>
62 <h3 class="sectionheading"><a name="windows" id="windows"></a>Windows</h3>
63 <blockquote>
64 <p>The easiest way to do this is use <a href="http://www.easyphp.org/" target="_blank">EasyPHP</a>,
65 a package that bundles all the software you need into a single Windows application.
66 Here are the steps from start to finish:</p>
67 <ol>
68 <li> Firstly, if you have ever installed MySQL before (even as part of another
69 package), uninstall it all, delete all the MySQL files and make sure you
70 delete <strong>c:\my.cnf</strong> and <strong>c:\windows\my.ini</strong>.You
71 might want to do a search and delete ANY file called <strong>my.cnf</strong>
72 or <strong>my.ini</strong>.</li>
73 <li> If you've ever installed PHP before delete any files called <strong>php4ts.dll</strong>
74 from around your Windows directory, as well as any files called <strong>php.ini</strong>.</li>
75 <li> Download EasyPHP from here: <a href="http://www.easyphp.org/telechargements/dn.php?F=easyphp1-7">http://www.easyphp.org/telechargements/dn.php?F=easyphp1-7</a>
76 (approx 10 Mb)</li>
77 <li> Run the downloaded file: <strong>easyphp1-7_setup.exe</strong>. The installation
78 process is in French but is otherwise much like installing any other Windows
79 program - I advise accepting the defaults and letting it all install. Note
80 that &quot;Suivant&quot; means Next and &quot;Oui&quot; means Yes.</li>
81 <li>At the end of the install leave the checkbox selected to &quot;Lancer
82 EasyPHP&quot; (Start EasyPHP) and hit the 'Terminer&quot; button. You might
83 be taken to a information web page which you can safely ignore. </li>
84 <li>If all went well - congratulations! Apache, PHP and MySQL are all installed
85 and running! You should see a black E in your toolbar tray. You can right
86 click on it to get a menu which will let you control the running programs.</li>
87 <li>Some things may be in French and you may prefer English. You can download this file <a href="http://www.easyphp.org/telechargements/dn.php?F=indexUS_1.7">http://www.easyphp.org/telechargements/dn.php?F=indexUS_1.7</a> which contains English versions of www and home folder in the EasyPHP1-7 folder. These can be copied over the default files.</li>
88 <li> The next thing you need to do is to set up a database for Moodle to use.
89 Right-click the black E in the toolbar tray and choose Administration, then click DB Management (beside PHPMyAdmin).</li>
90 <li>If asked for a username, use &quot;<strong>root</strong>&quot; with a <strong>blank password</strong>. You
91 should see a phpMyAdmin web interface that allows you to create a new databases
92 and user accounts. </li>
93 <li>Create a new database by typing &quot;moodle&quot; into the field and
94 hitting the &quot;Create&quot; button. That was easy!</li>
95 <li>You can also create a new user to access your database if you want. This
96 can be a bit tricky for a first-time user, so you might just want to use
97 the existing user &quot;root&quot; with no password in your Moodle config
98 for now, and fix this later.</li>
99 <li> You're ready to install Moodle! Download the latest release of Moodle
100 from <a href="http://moodle.org/download" target="_blank">http://moodle.org/download</a>,
101 then unzip the archive.</li>
102 <li>Copy your moodle files into <strong>C:\Program Files\EasyPHP\www. </strong>You
103 can either copy the entire moodle directory (ie C:\Program Files\EasyPHP\www\moodle)
104 or copy all the <em>contents</em> of the moodle directory. If you choose
105 this second option then you will be able to access your Moodle home page
106 using http://localhost/ instead of http://localhost/moodle/.</li>
107 <li> Make a new empty folder somewhere else for Moodle to store uploaded files
108 in, eg: <strong>C:\moodledata</strong></li>
109 <li> Go into your Moodle folder. Make a copy of config-dist.php, and call
110 it config.php</li>
111 <li> Edit config.php using a text editor (Notepad will do, just be careful
112 that it doesn't add unwanted spaces at the end). </li>
113 <li>Put in all your new database info:<br />
114 $CFG-&gt;dbtype = 'mysql';<br />
115 $CFG-&gt;dbhost = 'localhost';<br />
116 $CFG-&gt;dbname = 'moodle';<br />
117 $CFG-&gt;dbuser = 'root'; <br />
118 $CFG-&gt;dbpass = '';<br />
119 $CFG-&gt;dbpersist = true;<br />
120 $CFG-&gt;prefix = 'mdl_';</li>
121 <li>And put in all your file paths:<br />
122 $CFG-&gt;wwwroot = 'http://localhost/moodle'; // Use an external address
123 if you know it. <br />
124 $CFG-&gt;dirroot = 'C:\Program Files\EasyPHP\www\moodle'; <br />
125 $CFG-&gt;dataroot = 'C:\moodledata';</li>
126 <li>Save config.php - you can ignore the other settings if there are any.</li>
127 <li>You're nearly there now! The rest of the setup is all web-based. Visit
128 <a href="http://localhost/moodle/admin/" target="_blank">http://localhost/moodle/admin/</a>
129 with your browser to continue the setup via your browser.</li>
130 <li>To use zip files with Moodle (for example the backups use zip) you might
131 need to enable &quot;zlib&quot;. You can do this by going to your EasyPHP
132 directory (<strong>C:\Program Files\EasyPHP</strong>), and running the program
133 phpini.exe in there. Put a mark in the checkbox next to &quot;zlib.dll&quot;.
134 Close that window, then go to the black E in your toolbar and right-click
135 it to get a menu - select &quot;Restart&quot; from this menu.</li>
136 <li>Lastly, you need to set up some sort of cron. See the <a href="./?file=install.html">Installation
137 guide</a> for more details on this.</li>
138 </ol>
139 <p>If you don't or can't use EasyPHP, here are some a few tips to make sure
140 your PHP is set up correctly and avoid common problems:</p>
141 <ul>
142 <li>Make sure you enable the GD module so Moodle can process images - you
143 may have to edit php.ini and remove the comment (;) from this line: 'extension=php_gd2.dll'.
144 </li>
145 <li>Make sure you enable the Zlib module so that you can create and unpack
146 zip files from within Moodle.</li>
147 <li>Make sure sessions is turned on - you may have to edit php.ini and fix
148 the directory for <strong>session.save_path</strong> - instead of the default
149 "/tmp" use a Windows directory like "c:/temp".</li>
150 </ul>
151 <p>&nbsp;</p>
152 </blockquote>
153 </blockquote>
154 <p align="center"><font size="1"><a href="." target="_top">Moodle Documentation</a></font></p>
155 <p align="center"><font size="1">Version: $Id$</font></p>
157 </body>
158 </html>