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!





“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.
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
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!!
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
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
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
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.
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.
Yes, those holes in the wall are a real problem. Made a few of those myself over the years!
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?
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
Hi Rhea,
I modified php.ini but while clicking the Configuration page button ‘continue’ the apache http server has stopped working message is coming.
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!!
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
I modified php.ini but while clicking the Configuration page button ‘continue’ the apache http server has stopped working message is coming.
Hi Ed – which version of XAMPP and what version of Magento are you using? Edith
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?
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.
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?
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
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…
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.
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())) {