03 October 2009 ~ 23 Comments

How to install Magento on a PC with XAMPP

After wasting hours yesterday trying to get Magento working on XAMPP, I finally hit a winning combination. So here’s the summary of how to get a local copy of Magento running on a PC. Tested on Windows Vista (32bit) with XAMPP v1.7.1 and Magento 1.3.2.4.

Quick tips

  • Use XAMPP 1.7.1 – the version is important! v1.6.8 may also work.
  • Enable curl in php.ini
  • Install from http://127.0.01 and NOT localhost

XAMPP

To run a PHP/MySQL site on a PC you need a Linux distro, giving you an Apache server on your PC. We use XAMPP – it’s reliable, well-supported and easy to install. When you install XAMPP, the version is VERY important:
XAMPP 1.7.2 uses PHP5.3 which the curent version of Magento can’t handle
XAMPP 1.7.1 is the version I’m using – recommended
XAMPP 1.7.0 does NOT work with Magento – Apache will crash during Magento install
XAMPP 1.6.8 has been reported to work with Magento but I can’t verify this

So if you’re starting from scratch, use v1.7.1. If you have an existing install, check your version and upgrade if necessary. XAMPP project: http://www.apachefriends.org/en/xampp-windows.html. Older versions can be downloaded from SourceForge: http://sourceforge.net/projects/xampp/files/. Choose the XAMPP Windows versions.

CURL

By default curl is disabled in XAMPP. Download /apachefriends/xampp/php/php.ini and find the curl extension. Uncomment it by removing the semi-colon in front of it:
extension=php_curl.dll

Installing Magento

Download the latest version of Magento: http://www.magentocommerce.com/product/community-edition
Unzip the folder into your /htdocs/ folder. By default this will unzip into a /magento/ folder.
Create a blank database via your PHPMyAdmin (http://localhost/phpmyadmin)
Go to: http://127.0.0.1/magento/index.php/install and follow the install procedure.

Note that I’m saying “127.0.0.1″. If you use “localhost” cookies won’t work (except in Opera), you won’t be able to log into admin and you will have URL warnings. Localhost isn’t recognised as valid domain name by Magento. Using “127.0.0.1″ gets round that problem as it contains dots.

You’re done & ready to develop your Magento shop offline!

Share and Enjoy:
  • del.icio.us
  • Facebook
  • email
  • Twitter
  • Add to favorites
Tags: ,

23 Responses to “How to install Magento on a PC with XAMPP”

  1. m0sh3g 4 October 2009 at 3:16 am Permalink

    “Localhost isn’t recognised as valid domain name by Magento.”

    This is incorrect, the Magento doesn’t have any preference for localhost or not, it’s a browser issue, as you’ve mentioned that it works with Opera.

    http://www.google.com/search?q=localhost+cookie

    As a side note, I’ve found that WAMP presents less problems with configuring and crashing.

  2. Rhea 4 October 2009 at 1:27 pm Permalink

    I’m sorry, but it is yourself that is in error. The latest versions of Magento include a check for a FQDN (Fully Qualified Domain Name), which must have one or more periods (dots) in the name e.g. yourdomain.com

    ‘localhost’ contains no periods (dots) whilst ‘127.0.0.1′ does, and this is why you must use 127.0.0.1 and not localhost.

    Older versions of Magento, which don’t have the FQDN check, will work with ‘localhost’.

    Rhea

  3. Mark 9 October 2009 at 4:35 am Permalink

    setup a virtual host. apache/conf/extra/httpd-vhosts

    Can have multiple Magentos installed all running of whatever domain you want. Just add the appropriate lines in your hosts file too!!

  4. avon 14 November 2009 at 10:11 pm Permalink

    i recieved a massage – “Fatal error: Method Varien_Object::__tostring() cannot take arguments in C:\xampp\htdocs\magento\lib\Varien\Object.php on line 488″
    how can i resolve that and move on with the installation?
    thank you

  5. Edith 16 November 2009 at 5:02 pm Permalink

    Hi Avon – are you trying to install Magento on PHP5.3? The current version is not compatible with PHP5.3. If your on a local XAMPP install, I’d recommend to roll back to PHP 5.2.9.

    The Magento forum has a lot of threads on this error, but my concern would be that even if you fix this one, you’ll run into further PHP5.3 problems. Magento forum links: http://bit.ly/3igurT

  6. j2ibeo 25 November 2009 at 8:34 am Permalink

    I got the same error with Edith and now downloading a lower version of PHP ( 5.2.11) . Is this version working on magento?

    thanks

  7. Edith 25 November 2009 at 9:24 am Permalink

    Hi j2beo – As far as I know, it’s only 5.3+ that cause problems. However on the Magento forum there are workarounds for 5.3+. You do need to modify core code, but it is possible to get it to work. Search for “Magento” and “PHP5.3″ on Google / Magento forum.

  8. Joe 4 January 2010 at 10:02 pm Permalink

    FYI. This totally works. The author is 100% correct. Now all I need is a step-by-step to repair the hole in the wall that I made with my head.

  9. Rhea 4 January 2010 at 10:56 pm Permalink

    Yes, those holes in the wall are a real problem. Made a few of those myself over the years!

  10. Jonathon 31 January 2010 at 12:38 am Permalink

    Running XAMPP 1.7.1 with Magento 1.3.2.4

    All was well setting up the site until I tried adding new products. Apache crashes… Any thoughts?

  11. Rhea 31 January 2010 at 1:55 pm Permalink

    Edit your php.ini as follows, then completely shut down Apache and restart:

    1. file uploads limit should be set to 128 Mbs
    2. max execution time should be set to 90 seconds

    and

    3. make sure you’re not running PHP 5.3. If you are then roll back XAMPP to the laest 5.2+ version, which can be found at Source Forge

    Report back if they don’t solve the problem

    Rhea

  12. Srinivas Tamada 2 February 2010 at 5:19 am Permalink

    Hi Rhea,

    I modified php.ini but while clicking the Configuration page button ‘continue’ the apache http server has stopped working message is coming.

  13. hidalcri 7 February 2010 at 9:03 am Permalink

    You are awesome! I think that I bang my head so hard that it trans-passed to the neighbor apartment!! Hours trying and trying. Thank you so much!!!

    Now, how can you configure magento to work via the FTP server of your site??

    Thanks again so much!!

  14. Best Content Management System 19 February 2010 at 11:02 pm Permalink

    Thanks for the tips, they really helpes! I was able to figure out how to install Magento locally onto my computer running Windows XP. Here is a step by step guide on how to install Magento with no errors! http://www.jvfconsulting.com/blog/117/How_To_Install_Magento_Locally_On_Windows_XP.html

  15. Ed Hardy 11 March 2010 at 10:42 am Permalink

    I modified php.ini but while clicking the Configuration page button ‘continue’ the apache http server has stopped working message is coming.

  16. Edith 11 March 2010 at 11:53 am Permalink

    Hi Ed – which version of XAMPP and what version of Magento are you using? Edith

  17. Alexander 15 May 2010 at 1:53 pm Permalink

    Hi anytime I get to the point where I need to fill in my host name, database name and all and click continue, it shuts down my apache server. I’m trying to install using xampp version 1.70, what could be the cause?

  18. Edith 17 May 2010 at 9:34 am Permalink

    Hi Alexander – as stated in my blog: XAMPP 1.7.0 does NOT work with Magento – Apache will crash during Magento install. You need to upgrade your XAMPP install to at least 1.7.1.

  19. sarah 3 July 2010 at 2:52 am Permalink

    I am trying to install magento 1.4.0.1 on xampp 1.7.2 — i am also stuck in the configuration page. I’ve recreated the database, but still no avail, any thoughts on this?

  20. Rhea 3 July 2010 at 10:22 am Permalink

    The very first paragraph advises that you use XAMPP 1.7.1 (and not 1.7.2). I recommend you go with that advice.

    Rhea

  21. priya 17 July 2010 at 12:24 pm Permalink

    i am using windows vista . i want to install magento in my local computer.But when i install magento an error occurs “PHP extension “curl” must be loaded.” .how can i solve this problem…

  22. Rhea 17 July 2010 at 12:55 pm Permalink

    When you install XAMPP it does not come with the cURL add-on as standard, but this is available from the same page as XAMPP. You need to download that and install it.

  23. ECOMBUS.com 23 July 2010 at 6:04 am Permalink

    I think you may alter the Varien.php in \app\code\core\Mage\Core\Model\Session\Abstract\ to solve the problem what about cookies.
    Change if (isset($cookieParams['domain']) to if (isset($cookieParams['domain']) && !in_array(“127.0.0.1″, self::getValidatorData())) {


Leave a Reply