E-Commerce is getting big, and one of the biggest e-commerce systems in use is Magento. It is an open source software package that allows users to set up an online store. While “easy” isn’t the first word I would use for Magento, it’s certainly one of the better options out there if you’re looking for a professional e-commerce solution. Today, we’ll be installing Magento on XAMPP.
As a designer, developing themes for Magento might be something you would like to look into. But, unlike installing WordPress on XAMPP, Magento’s installation procedures can be a bit intimidating, especially for a designer who just wants to get it working so they can start developing themes and other pretty things. Where WordPress is the darling of the 5 minute installation, Magento takes a little coaxing to work. Here’s a step-by-step procedure that will hopefully save you a headache. Please note that I run XAMPP, so this tutorial is written for XAMPP only and is Windows 7 specific.
For this tutorial, I am running the following:
Magento Community 22.214.171.124
Step One: Make sure you have the latest version of XAMPP installed. You can get XAMPP at the Apache Friends website, here. At the time of this article, the latest version of XAMPP is 1.8.1. I won’t go into installation and configuration of XAMPP in this tutorial. If you’re new to XAMPP and don’t have it installed yet, please refer to my Installing XAMPP on WordPress tutorial for details.
Step Two: Go to Magento and download the Community version. Magento has various versions of their e-commerce software. The Community version is open-source and supported by community developers, designers and users. Magento’s other major software is Magento Enterprise that is supported by its developers. As you may have guessed, Community is free and Enterprise will cost you a certain sum of money. If you want to know more, they have a great FAQ about it. Let’s get started with the Community version by downloading the “Downloader” version. I’ve installed Magento using the Full Release and the Downloader version and in my experience, the Downloader version puts up less of a fight during installation.
Please note that you may have to sign up for an account on Magento’s site before you can download the software. Once you do get to the download link, you might notice a helpful PDF being offered under “Designer’s Guide”. Click on the link, download the PDF and save it somewhere to look at later. It’s useful!
Step Three: Before we get to Magento itself, we need to prepare XAMPP for installation. First thing’s first, make a MySQL database for your new Magento installation. Go to your localhost phpMyAdmin: http://localhost/phpmyadmin/ Click on Databases and create a magento database. Make sure you name it something you’ll be able to remember:
Click on the “Create” button once you’re done. Now click on your newly created Magento MySQL database:
We’re going to make a new user for your Magento database, similar to what we did for the WordPress installation. On an actual live server, you never want to use the root account. Too much sensitive material that could pose a security problem if something were to go wrong. So click on the Privileges button at the top of the screen, then under “New” click on “Add user”.
Step Four: Fill in your database username and password and make sure you use Local in the drop down menu for the Host, or type in “localhost”. Once, you’re done with that, scroll down.
Make sure “Grant All Permissions on “magento_box” (or your database name)” is selected and click on “Check All” under Global Permissions. Then scroll down and ensure Resource Limits are all set to 0 and click on Add User.
Step Five: Now that was the easy part. Magento’s system requirements states that it will work with 5.2.13 – 5.3.15. Now, that doesn’t say it’ll work with PHP 5.2 and Newer. It literally means any versions outside of that range will throw errors. Often, these errors present themselves during installation. Which is what makes Magento a more difficult beast to tame. We actually need to go into our XAMPP installation and modify some Apache and PHP files so Magento will install without a hitch.
With that having been said, let’s tackle Apache first. Stop your Apache and MySQL services in your XAMPP control panel and exit out of the control panel. Next, if you installed XAMPP in its desired location, you should be able to find a file called httpd.conf in this location: c://xampp/apache/conf/httpd.conf. Make a copy of the httpd.conf file before you open it in a text editor like Notepad or Notepad++. Once opened, look for this line:
#LoadModule rewrite_module modules/mod_rewrite.so
And remove the # at the beginning of the line. So it should look like this:
LoadModule rewrite_module modules/mod_rewrite.so
Yes, just remove the #. That’s all you need to do. Nothing more. Some installations already remove the #, so you might not have to do anything here. Once you remove the # from that line or verify that the # isn’t there, save your httpd.conf file and exit. Now we’ll deal with PHP.
Step Six: Navigate to your php.ini file. Which should be located here: c://xampp/php/php.ini. Again, make a copy of it before you edit it, then open it in a text editor. Now find this line within php.ini:
And remove the semicolon (;). So that the line will look like this:
Again, only remove the ; and nothing more. Some installations will have the semicolon already removed. In which case, you don’t need to do anything except verify that it isn’t there. Save php.ini but don’t close it yet.
Step Seven: During the installation, Magento will require a few minutes to complete one of its tasks. Your XAMPP installation is likely to allow less time than this and as a result, will corrupt the Magento installation. The solution for this problem is to increase the timeout threshold in the php.ini file. You can do this by locating the following string in php.ini:
max_execution_time = 30
And increasing the 30 to 1600. So that it looks like this:
max_execution_time = 1600
After that, save php.ini and close out the file.
Step Eight: Finally, we can start actually installing Magento onto our local machine. First, restart your Apache and MySQL servers. If you didn’t stop them before and have been editing them while they were on, just stop them now and start them up again. Create a new folder in your XAMPP htdocs folder called “magento”. Find the Downloader Mangento file you retrieved earlier, and unpack the downloader.php file. Copy the downloader.php file into your magento folder that you just created.
Step Nine: Navigate to your Magento downloader.php file, by going here: http://localhost/magento/downloader.php. If everything is on the right track, this should be greeting you:
Click on the “Continue” button, and you should see this:
Click on “Check for InnoDB Support” if you’re interested in InnoDB Support, if not, then no big deal. Then click on “Continue” again.
Click on “Continue” here too. We want to leave everything as is, because it’s already set to exactly what we want. Magento’s installation goes fairly smoothly as long as we make sure we have our bases covered first.
Wonderful. Click on “Continue”. The next screen gets a little more exciting. I promise.
Make sure your installation options are exactly what you want and click on the magical “Start the download process” button. Which will cause this to happen:
Strange as it looks, Magento is just doing its thing. It will download the necessary files, install them, then clean up after itself. So efficient! Go take a little break. You deserve it. Come back in a few minutes and it’ll look like this:
Yay! Click on “Continue Magento installation” then read over the license agreement if that’s your cup of tea, agree to it, then click “Continue to set your Localization”. At the Localization screen, set your time, currency and language settings and then click “Continue” again.
Configuration is probably the most exciting screen you’ll be looking at for a while. And I say this because once you click on the “Continue” button here, Magento will finish installing itself and you’ll be left hanging for a few minutes. Remember when we changed the timeout in php.ini? That was for this step. Go through the form first though and fill in the appropriate fields. Make sure you change the “Database Name” to your database’s name and input your username and password for your database into the appropriate fields as shown above. Double check everything to make sure it’s accurate. Once you’re ready, click on “Continue”. Now would be a good time to make a sandwich or something because this could take up to seven minutes to complete. I managed to make an elaborate cup of chai tea in the time it took Magento to finish this step. Whatever, you do, don’t try to refresh or close your browser. Just let it do its thing and you should get this glorious screen:
See, if you’ve spent as much time as I have, trying to figure out what Magento’s problem is during installation with no prior knowledge of how it works and you finally make it to the Create Admin Account page, it’s like you discovered buried treasure. With that having been said, you can create your administrative account here. Go nuts, but remember, never use the same username and password for your administrative account as your database account.
Also don’t worry about filling in the Encryption Key. Magento will generate a key for you on the next page (just like it says). It’s highly recommended that you write that key down somewhere so you don’t forget it. Once you’re done filling out the form, click on “Continue”. Write down your encryption key. Do it!
After you get your encryption key locked away in a fireproof safe, you can choose to go to the Frontend or Backend of your new Magento installation.
After all this, you should finally be able to work with Magento. Enjoy.