Some of you may be banging your head against a wall trying to figure out how to setup Magento in your local XAMPP installation. Fret not aggravated peoples, we have found the answer!

As you may know, Magento is a popular e-commerce platform that can handle anything from small business to enterprise e-commerce solutions. Despite it's rather large size and not-very-optimized code, the community edition of Magento is notorious for having excessively large databases and a single .log file that is around 3GB after awhile (which is what we encountered)...

However, if you are installing a FRESH COMMUNITY EDITION (version 1.6.2.0 at the time of this tutorial's birth), then we will go through the steps with you one by one!

The Process

Herein lies the process for installing magento:

Step One

Download the most recent community edition of magento!

Step Two

Go to http://localhost/phpmyadmin/ and add a new database!

Step Three

Extract the magento files in C:\xampp\htdocs\magento\ for Windows
OR
/Applications/XAMPP/htdocs/ on Mac

Note: the above directories are the default directories and may not necessarily be the places where you installed xampp. If this is different, then extract your magento files into the ApacheDoc document root "htdocs" folder of your xampp installation.

Step Four

Next we should update our hosts and get it out of the way now. Bear in mind, the hosts file maps domain names to ip addresses. When you type a domain into your browser window, your browser will check to see if there is a matching entry for that domain name in your host file.

On Windows navigate to C:\windows\system32\drivers\etc right click on your hosts file and select edit. You will see a bunch of random numbers which are ip addresses.

Add:
127.0.0.1 magento.localhost.com and save the file.

Hosts File Edit

Press the window key + r (or simply search for and/or open cmd.exe) and type the following:

ipconfig /flushdns

Flush DNS Windows

Note: to our friends who use Windows Vista, you must launch the command prompt as an administrator before you type this command!
Editing the Hosts File on Mac

Open Terminal and type the following (after each command press return):

We need to open the hosts file for editing
$ sudo nano /private/etc/hosts

Add this to the bottom of the hosts file
127.0.0.1 magento.localhost.com

When done editing the hosts file, press control-o to save the file.
Press enter on the filename prompt, and control-x to exit the editor.

Now we must flush the DNS cache on our system!
$ dscacheutil -flushcache

Step Five

Assuming all went well, you are now ready to open your favorite web browser and type in magento.localhost.com/magento/ and you will be redirected to the magento installation screen!

Note: we do recommend when getting to this option: We recommend that you store all session information in the file system and NOT the database.

Some options to you should choose when configuring your database information:

  • Skip URL Validation
  • Use Apache Server Rewrites

As you process through the installation process, please be patient. Do NOT click multiple times on any field especially the page where you enter in database information. Magento has a very extensive database and therefore it takes time to install and add all of the tables and populate those tables with relevant information.

Step Six

That's it! You should have a fully functioning Magento application on your XAMPP installation!

Be Sociable, Share!