How to install Magento 2 on XAMPP in three simple steps?

Install xampp in Magento 2

Folks, our team has installed Magento 2 beta version 0.74.0 on their local machines, we are planning to migrate all our Magento 1 extensions to Magento 2 but before that we thought it would be good idea to share the Magento 2 installation process with the community.

According to our tech lead, this was done in 3 simple steps, hope this works for you as well

Step 1 – Install XAMPP

https://www.apachefriends.org/download.html (We install version 5.6.3 / PHP 5.6.3)

  • Edit php.ini to enable extensions as below:

            extension=php_intl.dll

            extension=php_openssl.dll

            always_populate_raw_post_data = -1

  • Open C:\xampp\apache\conf\extra\httpd-vhosts.conf and the following entry

<VirtualHost *:80>

ServerAdmin magento2@dev.com

DocumentRoot “C:/xampp/htdocs/magento2”

ServerName www.magento2.dev

#ErrorLog “logs/dummy-host2.example.com-error.log”

#CustomLog “logs/dummy-host2.example.com-access.log” common

</VirtualHost>

  • Now open c:\Windows\System32\drivers\etc\hosts (as administrator) and add the following line

127.0.0.1              www.magento2.dev

Step 2 – Install Composer

https://getcomposer.org/download/

If you scroll down you will find Windows Installer

During install please make sure install shall menus option is selected

Select PHP.exe (C:\xampp\php\php.exe)

Step 3 – Install Magento 2

  • Create Magento2 folder in c:\xampp\htdocs\
  • Open git bash and run the following command

git init

git remote add origin https://github.com/magento/magento2.git

git pull origin master

  • Once Magento2 code is downloaded then right click on composer.json file and click composer install
  • Create database with name magento2
  • Open magento2.dev in your browser, this should show the set up wizard, follow the wizard and it should be done.
  • If the images are missing from admin or frontend then run the following command -:

php bin/magento setup:static-content:deploy

Hope the above article helps in some way, please leave us feedback or question related to Magento2 installation in the comment below.

 

5 thoughts on “How to install Magento 2 on XAMPP in three simple steps?

  1. Otherwise a wonderful article which ultimately helped me install Magento2 on my local system using XAMPP as well, BUT I came across couple of challenges which I would like to point in here, which may help someone else just like me having landed here for some assistance.

    1. first Issue I came across was an error in Virtual Host Deffinition as given above is isincorrect and instead it should be like

    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot “C:/xampp/htdocs/magento2”
    ServerName http://www.magento2.dev
    #ErrorLog “logs/dummy-host2.example.com-error.log”
    #CustomLog “logs/dummy-host2.example.com-access.log” common

    2. You have missed on php in here as well 🙂
    If the images are missing from admin or frontend then run the following command -:
    php bin/magento setup:static-content:deploy

    Hope this will add some value to this great content.

    1. Thanks Chris for your feeback and providing link to manually installing magento 2 without composer even though we always recommend to use composer instead of installing it manually. Thanks again

  2. Hi, you have nicely explained an entire procedure. But if you place some images or mention some FAQs would increase the worth of your blog or something related to the errors while installation.

    Overall I enjoyed reading your blog post. Thank you!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.