Installing Moodle on Mac (localhost) for local development

New Moodlers often find it difficult to get started with Moodle development or testing. So, I thought that I must write an article for those new Moodlers in order to let them get started in the Moodle world. (I am writing for Mac users only as the process is well documented for Windows users.)

What you need:
1. A PC with an internet connection.
2. 20-30 Min time

How to start:
1. You need to first download and install “XAMPP for Mac” from apachefriends.org or from this direct link http://www.apachefriends.org/download.php?xampp-macosx-1.7.3.dmg
2. After installing Xampp, you need to download the Moodle package from http://download.moodle.org/ . Select the latest stable version which is right now Moodle 2.4.1
3. Extract this zip archive of Moodle to you Mac’s /Applications/Xampp/htdocs directory.
4. Then you need to prepare a directory to contain moodle data. Lets create a directory named “moodledata” in the Applications/XAMPP/XAMPPfiles directory.
5. Now its the time to start your server. Just go to Applications/XAMPP/XAMPP control and you will see a screen like this
Screen Shot 2013-02-21 at 3.22.20 PM
You need to start just “Apache” and “Mysql”.
6. Then, start your browser and test your server by typing http://localhost
7. Then, go to phpmyadmin by typing http://localhost/phpmyadmin You need to create the database for Moodle using this tool.
8. Click database name “moodle” under create new database field and choose utf8_unicode_ci as the encoding method in the drop down. Click “create”.
9. Now enter http://localhost/moodle to start installing moodle. You will see a screen similar to this.

Screen Shot 2013-02-21 at 4.02.58 PM
10. Select the default language and click next.
11. On the very next page, you need to enter the paths for your moodle. You have to mention the url, moodle directory and the moodle data directory.

Screen Shot 2013-02-21 at 4.04.54 PM
12. Choose the database type, you can leave it to “Improved Mysql”
13. Then you have to enter the database settings like dbname, user, pass.
For host field leave localhost as default, for db name enter “moodle” (created in step 8), for db user enter “root” and leave password as default and click next.
14. Now, it may show you an error that it can’t copy the config.php in the moodle directory you specified. So, you may either copy the code ans paste it yourself in config.php or you need to make moodle directory writable for web server and reload the current page.
15. Continue with all the steps and your Moodle will be installed on your local computer for testing.

Please share your experience with us.

Leave a Reply