Note: You are currently viewing documentation for Moodle 3.1. Up-to-date documentation for the latest stable version of Moodle is probably available here: Installing AMP.

Installing AMP: Difference between revisions

From MoodleDocs
m (→‎Windows: the url of the download page has changed)
 
(48 intermediate revisions by 19 users not shown)
Line 1: Line 1:
AMP or AMPPlite stands for '''A'''pache, '''M'''ySQL & '''P'''HP. Moodle is written in a scripting language called [[PHP]] and stores most of its data in a database. The recommended database is [[MySQL]]. Before installing Moodle you must have a working PHP installation and a working database to turn your computer into a functional web server platform. XAMP is a Windows and MAMP is a Mac OS version.
{{Installing Moodle}}
Moodle does have [[Complete install packages]] in the [http://download.moodle.org/ download section] as well as the Moodle only package.
AMP, stands for '''A'''pache, '''M'''ySQL & '''P'''HP. This is not the only platform on which Moodle runs but is the most common and fine for basic installations.  


The AMP individual applications can be tricky to set up for average computer users. This page has been written to try to make this process as simple as possible for different platforms.    
'' 'All-in-one' Moodle installers for Windows and OSX are available at http://httpd.apache.org/docs/2.0/install.html (not intended for 'production' sites). ''


== First a word about PostgreSQL ==


== Hosting Service ==
If you would prefer to use the PostgreSQL database (and you should consider it) you can - when using the package type installers - just install it instead of MySQL. MySQL tends to be the universal choice with the simpler 'one-click' installers. For a 'one-click' installer with PostgreSQL, Apache and PHP you can check [http://bitnami.com BitNami], it supports Windows ([http://bitnami.com/stack/wapp WAPP]), Linux ([http://bitnami.com/stack/lapp LAPP]) and Mac ([http://bitnami.com/stack/mapp MAPP]).
 
Unfortunately hosting services vary quite a lot in the way they work. Some will even install Moodle for you.
 
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.
 
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.
 


== Mac OS X ==
== Mac OS X ==


The easiest way to do this is use the [[Apache]] server that Apple provides, and add PHP and MySQL using Marc Liyanage's packages. Both of the pages below come with good instructions that we won't duplicate here:
OSX comes with a suitable [[Apache]] web server and a not so suitable PHP (it doesn't have all the required extensions).  
 
* '''PHP''': Download from here: http://www.entropy.ch/software/macosx/php/
* '''MySQL''': Download here: http://www.entropy.ch/software/macosx/mysql/


Once these are installed the standard [[Installing Moodle|Installation guide]] should be fairly straightforward.
Here are some other possibilities (all are documented so this is not repeated here):
* Liip 'one click' installer from http://php-osx.liip.ch/. Note that it is primarily biased towards developers.
* [http://www.mamp.info/ MAMP]: One click installer - easy to use and well documented. Probably only suitable for personal use.
* [http://www.ampps.com/  Softaculous AMPPS]: Another one click installer - for both Windows and OSX this time.
* [http://www.macports.org/ MacPorts]: A complete Linux-style package repository. You will find the AMP components here. See [https://trac.macports.org/wiki/howto/MAMP Getting Apache, MySQL, and PHP Running under MacPorts]
* [http://www.finkproject.org/ Fink]: an alternative to MacPorts.
* [http://bitnami.com/stack/mamp BitNami MAMP Stack]: On 'one-click' installer with for MySQL, Apache and PHP which supports the BitNami applications modules to installed on top of it like the [http://bitnami.com/stack/mamp/modules#moodle BitNami Moodle module].


Go here for a [[Step-by-step Guide for Installing Moodle on Mac OS X 10.4 Client]] (not server) Mac.
There might be some problems with the installation in Yosemite. You may need to go to Applications/MAMP/Library/bin (or use finder) and find the file envvars, and rename it to _envvars.  Make sure your MAMP server is completely stopped before doing any of the ports change and/or renaming the envvars file.


== Red Hat Linux ==
== Linux ==
You should install the packages from your distribution's repository for [[Apache]], [[PHP]] and MySQL. You will almost certainly need additional extensions for [[PHP]] (e.g. the extension for the database). The packaged versions of Moodle are not recommended (it's not much harder to install from moodle.org download)


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.
See (for example):
* Ubuntu - https://help.ubuntu.com/community/ApacheMySQLPHP
* Debian - http://wiki.debian.org/LaMp
* RedHat / Centos - http://www.howtoforge.com/quick-n-easy-lamp-server-centos-rhel
* SuSE / OpenSuSE - http://www.susegeek.com/internet-browser/install-configure-lamp-apachemysqlphp-in-opensuse-110/


Once these are installed the standard [[Installing Moodle|Installation guide]] should be fairly straightforward.
While one-click installers (e.g. XAMPP or BitNami LAMP Stack) exist for Linux, it is so simple to install the components the "right" way that they seem pointless. Using the standard method will make it much easier for you to obtain help and support.  


A more detailed walkthrough is here: [[RedHat Linux installation]]
Of course, if you wish to (or you need a particularly new version) you can compile all or some of the elements from source. All the elements have good documentation. The tricky one is PHP and some guidance for Debian/Ubuntu is here: [[Compiling PHP from source]]


== Windows ==
== Windows ==


Installing Moodle '''for the first time''' on a [[Localhost]] (a stand alone computer) is easy and can be a very useful tool even if a web based production Moodle Server is available for use. These instructions work on a Window XP computer.
Windows has slightly more variations as you can use [[Apache]] or Microsoft's [[IIS]] Web Servers. The following one-click Web server installers include the Apache Web server, the MySQL database server, the PHP scripting language and the phpMyAdmin database (MySQL) manager. Some may include other components.
#On the [http://download.moodle.org/windows/ Windows packages] download page, choose the version you would like. Click on the download link in the rightmost column. This will download a large zip file.
#Unzip the downloaded file at c: and keep the path structure for all the files. 
#Rename the just created c:\moodle to c:\xampplite (c:\xampplite will be our example) but you could rename it c:\moodle16 or c:\moodle17 or C:\testMoodle or whatever .
#Using Windows Explorer run the file c:\xampplite\set_xampp.bat which will make sure all the configuration files use c:\xampplite as the home or root directory.
#The following steps assume that the web server will be able to use port 80 on your computer. See [[Windows_installation_using_XAMPP#Skype |troubleshooting if you are running Skype]] which also likes to use this port as a default.  
#There many ways to start the localhost webserver from this point for the Moodle install.  Here are two ways.
##Slightly faster
###Using Windows Explorer run the file c:\xampplite\restart_xampp.bat and do not close the window that opens.
##Still fast
###In Windows Explorer click on  c:\xampplite\apache_start to start the Apache web server. This opens a new window that you should leave open.
###In Windows Explorer click on  c:\xampplite\mysql_start to start the MySQL database server. This opens yet another new window that you should leave open.
#In your favorite Web browser, go to address bar and type "localhost" and press enter or go.
#This will start the Moodle Install process, which the [[Installing Moodle]] [[Installing_Moodle#Go_to_the_admin_page_to_continue_configuration| MoodleDoc page section]] describes in a little bit more detail. This can take some time for a new user. '''Don't panic''', you can change things later and the install process will tell you what you absolutely have to fill in or correct.


===Easier Moodle restarts===
* [http://www.wampserver.com/en/ WampServer]: One of the best installers for Windows.
There are lots of ways to start a Moodle after an install.   Most Moodlers will have one or more "localhost" links on their computer installed in "Favorites" or even as a browser's default opening screen. But first a web server has to be started. Here are two ways to start them.
* [http://bitnami.com/stack/wamp BitNami WAMP Stack]: A very good installer that allows other [http://bitnami.com/stacks BitNami Stacks] to be installed on top, like the [http://bitnami.com/stack/moodle BitNami Moodle Stack].
====Automatic Window services startup====
* [http://www.easyphp.org/ EasyPHP]: A good and known popular alternative.
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 -> Run... and type the command "c:/xampplite/service.exe -install" into Open box. Then click OK.
* [http://www.apachefriends.org/en/xampp-windows.html XAMPP]: Probably the best known installer for Windows. It should only be used for development or as a personal web server.
* [http://php.net/manual/en/install.windows.php Official PHP Documentation]: Instructions to install PHP on all manner of Windows and Web server variations.
* [http://www.mysql.com/downloads/mysql/ MySQL]: Select Windows and download installer.  
* [http://www.postgresql.org/download/windows/ PostgreSQL]: Download installer for Windows.


Start Moodle by typing localhost in the web browser and/or adding localhost as a favorite site.
=== Installer packages and components ===
====Single button service startups====
Sometimes there are more than one localhost installed on a computer. Create a short cut on the start menu, favorites or desktop that points to each specific file like c:\xampplite\restart_xampp.bat . Lable each shortcut to a localhost differently, for example C_MoodleXampp, or Moodle16 or Moodle17 or whatever. 


Start the Moodle by placing localhost in the web browser or adding it as a favorite site. Which ever localhost you restarted, that is the Moodle your web browser will find.
The following table lists the components and versions of each package (as of August 27, 2014):


==Other install options==
{| style="width:75%; height:75px" border="0"
Instead of using this package you can also install XAMPP and Moodle separately as explained on the page [[Windows_installation_using_XAMPP]].  
|-
| '''Product''' || '''Version''' || '''Httpd (Apache)''' || '''PHP''' || '''MySQL''' || '''PHPMyAdmin''' || '''Address'''
|-
| WampServer || 2.5 || 2.4.9 || 5.5.12 || 5.6.17 || 4.1.14 || [http://www.wampserver.com/en/ Web page]
|-
|  || 2.4 || 2.4.4 || 5.4.16 || 5.6.12 || 4.0.4 ||
|-
|  || 2.2e || 2.4.2 || 5.4.3 || 5.5.24 || 3.5.1 ||
|-
| BitNami WAMP Stack || 5.4.32-0 || 2.4.10 || 5.4.32 || 5.5.39 || 4.2.7.1 || [https://bitnami.com/stack/wamp Web page]
|-
|  || 5.3.29-0 || 2.2.23 || 5.3.29 || 5.5.29 || 3.5.5 ||
|-
| EasyPHP (Wevserver) || 14.1 || 2.4.10 || 5.4.31 || 5.6.19 || 4.2.6 || [http://www.easyphp.org/ Web page]
|-
| EasyPHP(Devserver) || 14.1 VC11 || 2.4.7 VC11 || 5.[6-3].x || 5.6.15 || 4.2.0 ||
|-
|  || 14.1 VC9 || 2.4.7 VC9 || 5.[4-2].x || 5.6.15 || 4.2.0 ||
|-
| XAMPP || 1.8.3 || 2.4.10 || 5.5.15 || 5.6.20 || 4.2.7.1 || [https://www.apachefriends.org/download.html Web page]
|-
|  || 1.8.2 || 2.4.10 || 5.4.31 || 5.5.39 || 4.2.7.1 ||
|-
| ----------------- || --------- || ---------- || ------------- || ------ || ------- ||
|-
| XAMPP || 1.7.4 || 2.2.17 || 5.3.5 || 5.5.8 || 3.3.9 ||
|-
| || 1.7.1 || 2.2.11 || 5.2.9 || 5.1.33 || 3.1.3.1 ||
|}


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.
'''Important Notes'''
* PHP 5.5.x versions are built with VC11 (Visual Studio 2012 compiler). These builds require you to have the Visual C++ Redistributable for Visual Studio 2012 [http://www.microsoft.com/en-us/download/details.aspx?id=30679/ x64/86] installed. These PHP versions '''do not''' work in windows XP nor in Windows Server 2003.


Here you can find steps for an [[IIS]]: [[Windows installation]] for XAMPP or Windows 2003 .
* PHP 5.4.x versions are built with VC9 (Visual Studio 2008 compiler). These builds require you to have the Visual C++ Redistributable for Visual Studio 2008 SP1 [http://www.microsoft.com/en-us/download/details.aspx?id=5582/ x86] or [http://www.microsoft.com/en-us/download/details.aspx?id=15336/ x64] installed. These PHP versions '''are the last''' to support windows XP.


==Testing PHP==
* XAMPP packages 1.7.4 and 1.7.1 were included in the table because those are the versions on which the [http://download.moodle.org/windows/ Windows Moodle Packages] are built: from Moodle 2.1.x to 2.5.x with XAMPP 1.7.4; and Moodle 1.9.19+ with XAMPP 1.7.1.
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:


  <?php phpinfo()?>
* Moodle version 2.0.x isn't available any more as a Windows Moodle Distribution.


You should be able to open this file in a web browser by going to to the URL '''localhost/phpinfo''' and see a web page that has PHP status information in it such as [[phpinfo|this]].
==Vista and Windows 7==


==See also==
Many people have trouble installing the stand alone local [http://download.moodle.org/windows/ Moodle for Windows] on Vista and Windows 7.


*[[Installing Moodle]]
Here are some things you might want to try:
*[[Installation FAQ]]
*[[Upgrading Moodle]]
*[[Debian GNU/Linux installation]]
*[[Complete install packages]], also includes instructions for creating a stand alone (localhost) installation on a single computer.


[[Category:Core]]
* A simple one is to use http://bitnami.org/stack/moodle
[[Category:Administrator]]
* 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.
[[Category:Installation]]
* For personal (evaluation) use - install XAMPP or EasyPHP and then Moodle using the normal installation instructions.


[[es:Instalación AMP]]
[[es:Instalación AMP]]
[[fr:Installation de AMP]]
[[ja:AMPのインストール]]
[[ja:AMPのインストール]]
[[ru:Установка AMP]]
[[ru:Установка AMP]]
[[pl:Instalacja AMP]]
[[de:Installation von Apache, MySQL und PHP]]

Latest revision as of 21:42, 28 January 2015

AMP, stands for Apache, MySQL & PHP. This is not the only platform on which Moodle runs but is the most common and fine for basic installations.

'All-in-one' Moodle installers for Windows and OSX are available at http://httpd.apache.org/docs/2.0/install.html (not intended for 'production' sites).

First a word about PostgreSQL

If you would prefer to use the PostgreSQL database (and you should consider it) you can - when using the package type installers - just install it instead of MySQL. MySQL tends to be the universal choice with the simpler 'one-click' installers. For a 'one-click' installer with PostgreSQL, Apache and PHP you can check BitNami, it supports Windows (WAPP), Linux (LAPP) and Mac (MAPP).

Mac OS X

OSX comes with a suitable Apache web server and a not so suitable PHP (it doesn't have all the required extensions).

Here are some other possibilities (all are documented so this is not repeated here):

There might be some problems with the installation in Yosemite. You may need to go to Applications/MAMP/Library/bin (or use finder) and find the file envvars, and rename it to _envvars. Make sure your MAMP server is completely stopped before doing any of the ports change and/or renaming the envvars file.

Linux

You should install the packages from your distribution's repository for Apache, PHP and MySQL. You will almost certainly need additional extensions for PHP (e.g. the extension for the database). The packaged versions of Moodle are not recommended (it's not much harder to install from moodle.org download)

See (for example):

While one-click installers (e.g. XAMPP or BitNami LAMP Stack) exist for Linux, it is so simple to install the components the "right" way that they seem pointless. Using the standard method will make it much easier for you to obtain help and support.

Of course, if you wish to (or you need a particularly new version) you can compile all or some of the elements from source. All the elements have good documentation. The tricky one is PHP and some guidance for Debian/Ubuntu is here: Compiling PHP from source

Windows

Windows has slightly more variations as you can use Apache or Microsoft's IIS Web Servers. The following one-click Web server installers include the Apache Web server, the MySQL database server, the PHP scripting language and the phpMyAdmin database (MySQL) manager. Some may include other components.

Installer packages and components

The following table lists the components and versions of each package (as of August 27, 2014):

Product Version Httpd (Apache) PHP MySQL PHPMyAdmin Address
WampServer 2.5 2.4.9 5.5.12 5.6.17 4.1.14 Web page
2.4 2.4.4 5.4.16 5.6.12 4.0.4
2.2e 2.4.2 5.4.3 5.5.24 3.5.1
BitNami WAMP Stack 5.4.32-0 2.4.10 5.4.32 5.5.39 4.2.7.1 Web page
5.3.29-0 2.2.23 5.3.29 5.5.29 3.5.5
EasyPHP (Wevserver) 14.1 2.4.10 5.4.31 5.6.19 4.2.6 Web page
EasyPHP(Devserver) 14.1 VC11 2.4.7 VC11 5.[6-3].x 5.6.15 4.2.0
14.1 VC9 2.4.7 VC9 5.[4-2].x 5.6.15 4.2.0
XAMPP 1.8.3 2.4.10 5.5.15 5.6.20 4.2.7.1 Web page
1.8.2 2.4.10 5.4.31 5.5.39 4.2.7.1
----------------- --------- ---------- ------------- ------ -------
XAMPP 1.7.4 2.2.17 5.3.5 5.5.8 3.3.9
1.7.1 2.2.11 5.2.9 5.1.33 3.1.3.1

Important Notes

  • PHP 5.5.x versions are built with VC11 (Visual Studio 2012 compiler). These builds require you to have the Visual C++ Redistributable for Visual Studio 2012 x64/86 installed. These PHP versions do not work in windows XP nor in Windows Server 2003.
  • PHP 5.4.x versions are built with VC9 (Visual Studio 2008 compiler). These builds require you to have the Visual C++ Redistributable for Visual Studio 2008 SP1 x86 or x64 installed. These PHP versions are the last to support windows XP.
  • XAMPP packages 1.7.4 and 1.7.1 were included in the table because those are the versions on which the Windows Moodle Packages are built: from Moodle 2.1.x to 2.5.x with XAMPP 1.7.4; and Moodle 1.9.19+ with XAMPP 1.7.1.
  • Moodle version 2.0.x isn't available any more as a Windows Moodle Distribution.

Vista and Windows 7

Many people have trouble installing the stand alone local Moodle for Windows on Vista and Windows 7.

Here are some things you might want to try: