(925) 479-9768

How To Install Magento Locally On Windows XP

By Jason Franco posted on Friday, February 19, 2010 @ 11:26 AM - (How To's)

The following is a guide for those folks that want to setup a proper development environment for building out a Magneto cart on your local windows box. I’m one of those old school developers that like’s to have a multi-phased approach when it comes to developing, testing and deploying a website. The first step of this process is to get your local windows development box setup to properly run the MySQL Database, the Apache Web server and most importantly trick your machine into believing it’s the actual server that hosts the domain.

Now, we’ve checked online and seen a bunch of places saying that this is not possible and to have Magento working on a Windows box and that you need to install Ubuntu to get this working. This couldn’t be farther from the truth and just adds unneeded complexity. So let’s keep it as simple as possible.

  1. Download the XAMPP from Apache Friends: http://www.apachefriends.org/en/xampp-windows.html. We’re currently using XAMPP Version 1.6.6a, however, feel free to use the latest. Which has some differences and some Apache/MySQL extensions turned on default, but it will all work the same.
    1. It’s a very simple install and you can follow the instructions without really changing any of the defaults. However, for the sake of this document, we’ll change the install directory to the use the original settings that XAMPP used to come with and install to:
      1. C:\apachefriends\xampp
  2. Once XAMPP is installed, we’ll need to setup our environment to handle multiple site development as well as for properly running Magento. We’re a web development shop, so we find that we need to work on multiple sites as once to properly support our customers.
    1. For the purpose of this document, we’ll be building out a website for CleanEase.
      1. Navigate out to your “C:\apachefriends\xampp\htdocs” directory and create the new “cleanease” folder:
  3. We’ll then need to make sure that both the Apache & MySQL environments are setup for what Magento needs.
    1. MySQL
      1. We’ll need to edit the configuration files to support the InnoDB transactional storage engine otherwise you’ll get nowhere fast. Navigate out to your local my.cnf file found at: C:\apachefriends\xampp\mysql\bin\my.cnf. Open this up into your text editor of choice and make sure that the InnoDB settings are not commented out. It should looks something like this:
        1. # Comment the following if you are using InnoDB tables
          #skip-innodb
          innodb_data_home_dir = "C:/apachefriends/xampp/mysql/"
          innodb_data_file_path = ibdata1:10M:autoextend
          innodb_log_group_home_dir = "C:/apachefriends/xampp/mysql/"
          innodb_log_arch_dir = "C:/apachefriends/xampp/mysql/"
          ## You can set .._buffer_pool_size up to 50 - 80 %
          ## of RAM but beware of setting memory usage too high
          innodb_buffer_pool_size = 16M
          innodb_additional_mem_pool_size = 2M
          ## Set .._log_file_size to 25 % of buffer pool size
          innodb_log_file_size = 5M
          innodb_log_buffer_size = 8M
          innodb_flush_log_at_trx_commit = 1
          innodb_lock_wait_timeout = 50
        2. Make sure that the “skip-innodb” line is commented out, but all the other settings can use the defaults that are already specified. Save and close the file.
      2. We usually have MySQL installed as a service, so get into your Services Control Panel and restart it:
    2. Apache
      1. Configuring the php.ini file
        1. We’ll need to enable a few extensions for Magento to work properly. To do this, open up your php.ini file. The version of XAMPP we use (Version 1.6.6a ) has two php.ini files, however, the one that is really used by the web server is found in the Apache bin directory:
          1. C:\apachefriends\xampp\apache\bin\php.ini
            1. Note: On the newer version of XAMPP, we’ve found that they’ve finally cleaned things up and only have one php.ini file found in C:\apachefriends\xampp\php\php.ini. So please make sure to update this file.
        2. Make sure the following extensions are active. Meaning, that you just need to remove the “;” (semi-colon) character out from in front of it:
          1. extension=php_mcrypt.dll
            extension=php_curl.dll
            extension=php_pdo_mysql.dll
            extension=php_pdo.dll
      2. Configuring the httpd.conf file
        1. You’ll find this file located at:
          1. C:\apachefriends\xampp\apache\conf\httpd.conf
        2. Enable URL rewrites:
          1. You can do this by remove the “#” hash character in front of the following line:
            1. LoadModule rewrite_module modules/mod_rewrite.so
        3. Change the Document Root to point to the website you wish to work on, in this case, we want to change this to the CleanEase project:
          1. DocumentRoot "C:/apachefriends/xampp/htdocs/cleanease"
          2. IMPORTANT: This is the best way to go about installing a local version of Magento on your box and will allow you to easily deploy this out to your production environment without having to jump through a bunch of extra hoops.
      3. We usually have Apache installed as a service, so get into your Services Control Panel and restart it:
  4. Next, go out and download Magento, you can find the No Registration download page here: http://www.magentocommerce.com/download/noregister. Make sure to get the “Full Release - stable version” download and don’t mess around with the other ones, I’ve found that they just lead you down the wrong path and take far too long for an install process. For this document, we’re using version 1.3.2.4, which we downloaded on 2/10/2010 and now I see another version 1.4.0.0 as of 2/12/2010. Why do these guys put out so many releases so quickly?
  5. Once this is downloaded, you’ll want to exact the zip file into the CleanEase folder: C:\apachefriends\xampp\htdocs\cleanease.


    As you can see from the files in the zip, it will still extract them to a “magento” folder, so we’ll just need to move all of those files one level up:
  6. Setting up your “hosts” file
    1. This is the most IMPORTANT step throughout all of this process. Without this step, the cookies of the Magento install will not work properly and the database will not properly install when going through the Magento setup.
    2. You can find your local “hosts” file in the following location:
      1. C:\WINDOWS\system32\drivers\etc\hosts
        1. There is no file extension, but you can easily open this in Notepad or any text editor.
    3. Make sure to add the following domain entry to point to your localhost IP address:
      1. 127.0.0.1 www.cleanease.com
      2. It’ll look something like this:
    4. Save the file
  7. Create an empty database called “cleanease” within your phpMyAdmin instance:
  8. Now that you’ve done all the setup, it’s now time to hit your local instance via your favorite web browser to start the Magento Installation Wizard. Open up the www.cleanease.com website in your browser, and if you did all the above setup correctly, you’ll see the first part of the Magento installation screen:
    1. Feel free to use the default settings for the Localization:
    2. Make sure to enter in the “cleanease” database name, check also check the following:
      1. Skip Base URL validation before next step
      2. Use Web Server (Apache) Rewrites
    3. This part of the process will take a bit of time as its building out the database and setting up your environment. However, if all works well, it will take to the final step of the wizard to create the administrator user:

Once you get through this portion, it will ask you if you want to go visit the frontend or login to the backend. Feel free to login to the backend to start setting things up. A few things to note:

  • You can always use a different domain, it would be best to use the one you wish to ultimately install to.
  • In addition, you can use any database name or directory name you wish, but just make sure you use ones that are consistent with the domain name so you can easily track them.
  • Make sure to edit your httpd.conf file, specifically the DocumentRoot value to the directory you wish to run your other Magento instances.

Now that we’ve got this process down, we can finally use proven development techniques to get our websites looking exactly the way our clients want on our local boxes before we move them to production.

Enjoy!

Comments (14)

By Army Ration Packs posted on Tuesday, February 23, 2010 @ 9:07 PM
Installing Magento is not so easy like joomla or wordpress.. Mainly Magento is developed for Linux operating system so if we want to install it to Windows XP with Xampp then we need to change some entities of Xampp file which is shown here.
By fishing organizations posted on Thursday, February 25, 2010 @ 6:36 AM
Man, Magento is a tough cookie! Thank you so much for this guide. It has been a huge help for me. It seems like, in spite of all the hype over Vista and 7, there are still a lot of people running good ol' XP.

It is great to find that there are those who are looking out for the XP users.
By Canvas Prints posted on Thursday, March 11, 2010 @ 7:41 AM
Hi, I have a website that is currently up and running I wan't to upgrade it to a Magneto site, do I have to take my Photography Site down whilst I install it ?
By doggie192 posted on Tuesday, March 16, 2010 @ 7:19 PM
I use magento to run in wamp server. Finally come to admin login page, but cannot get into the admin page. It keep repeat the login page. How to solve this kind of problem?
By Nicholas Reed posted on Thursday, March 18, 2010 @ 3:45 PM
This tutorial is godly. I am using xp, but I still can't get past the login.
I've got this at the top of my hosts file
127.0.0.1 localhost
127.0.0.1 www.innerware.com
(with a lot others)

when I go to http://innerware.com/admin or http://www.innerware.com/admin it just takes me back to http://localhost

One note is I installed from http://localhost and not http://innerware.com, because I didn't enlarge the one of your images that shows that part.

What do you think I should do?
By Nicholas posted on Thursday, March 18, 2010 @ 6:11 PM
Its all working. Just to REMOVE index.php and index.html from the HTDOCS folder. THATS IT!
By Justin posted on Wednesday, April 14, 2010 @ 5:47 AM
Wow, what a tutorial! Knowing that lots of folks did not want to move to Vista (notably those on XP Pro), you had to think it would be possible to install Magenta on that OS. This is a goldmine, thanks Jason.
By os posted on Friday, April 23, 2010 @ 8:37 PM
Fatal error: Maximum execution time of 60 seconds exceeded in D:\wamp\www\project\opensource\magento\lib\Zend\Db\Statement\Pdo.php on line 228
By Al Doan posted on Sunday, May 23, 2010 @ 1:45 PM
os, you're on PHP 5.3, you can't use xampp > 1.7.1 or you get those errors, good tutorial though, easy walk through, a few kinks along the way, but all in all very well documented!

Thanks
By Al Doan posted on Sunday, May 23, 2010 @ 2:18 PM
also, if anyone else runs into this, I had everything setup on localhost and it worked fine but I couldn't login to my magento admin panel (it just looped to the login screen without any kind of error or anything). The problem is magento can't set a cookie with localhost, so I had to set a localhost.com in my hosts file and then set that in the base url, then I logged in fine. FYI
By grimsby web design posted on Tuesday, June 8, 2010 @ 5:15 PM
i had the same problem as os

Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\inthepink\lib\Varien\Db\Adapter\Pdo\Mysql.php on line 276

so i need to install an older version of xampp?
By AMY posted on Friday, June 11, 2010 @ 5:01 AM
Hi
I have installed it accordingly as above into my Windows 7. When i clicked on http://www.cleanease.com/. It is showing me phpinfo() page. What is the reason?
By ayok posted on Sunday, June 20, 2010 @ 8:15 AM
I got www.magento.com/magento/index.php? localhost only is going to htdocs, en now www.magento.com going to htdocs, not magento folder.

should i add "127.0.0.1 localhost/magento"?
By Meda posted on Thursday, July 8, 2010 @ 7:45 AM
To avoid "Fatal error: Maximum execution time of" just set "max_input_time" in your php.ini.
Name:   
Email:   
Website:
Comment:
  
Verification:
    (Please type what see you see above.)