Setting up Magento in XAMPP
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 220.127.116.11 at the time of this tutorial's birth), then we will go through the steps with you one by one!
Herein lies the process for installing magento:
Go to http://localhost/phpmyadmin/ and add a new database!
Extract the magento files in C:\xampp\htdocs\magento\ for Windows
/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.
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.
127.0.0.1 magento.localhost.com and save the file.
Press the window key + r (or simply search for and/or open cmd.exe) and type the following:
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
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
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!
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.
That's it! You should have a fully functioning Magento application on your XAMPP installation!