Magento 2 – How to setup Magento with XAMP on Windows

Categories Magento 2, Software Development, Start Coding
magento_logo

Today I want to show you how to set up Magento on your Windows machine via XAMP.

1. Download and install XAMP
2. Create database for Magento
3. Download and Setup Magento 
4. Deploy static content

What is XAMP?

XAMPP is a completely free, easy to install Apache distribution containing MariaDB, PHP and Perl. The XAMPP open source package has been designed for extremely easy installation and use.


1. Download and install XAMP

First of let´s start of by downloading XAMP on their officially site Download XAMP.

XAMP03 (2)

After the download is finished (this can take awhile) execute the file and get into the installation process. Now click-through the installation process (just check the boxes seen in the picture below). Once your installation is finished this screen should appear. Now you should have an Desktop shortcut for your XAMP control panel.XAMP02

XAMP03


Now start XAMP control panel and run your Apache and your MySQL server by clicking on start. If your port where Apache is running is blocked please consider taking a look on this site http://www.coder-welten.com/windows-10-unable-to-open-process/ . The control panel should now look like this.

XAMP04

2. Create database for Magento 2

Open up following URL http://localhost/phpmyadmin/., create a databse with the name of your choice mine is magento2. XAMP06

3. Download and Setup Magento 2 

You can download Magento on there website over here Download Page. Select the ZIP version for the download. Before downloading create a user account, this account is needed later on when developing custom Modules for Magento.

Now, go to the default folder of XAMPP: C:\xampp\htdocs. Create a new folder, for example named “magento2″. Move and extract the downloaded file of Magento 2 in this new folder.

XAMP08

Open your web browser, type in search bar: localhost/name-of-new-folder/. In this example, it is localhost/magento2/. Welcome you to the Magento 2 installation on localhost with XAMPP.

Time to hit Agree and Setup Magento button.

XAMP07

 

 


Click Readiness Check button. If you pass all the checks, you can continue. Have you not, you must fix the error to continue. The 2 most often errors are php Settings Check and php Extensions Check.

XAM09 To resolve this error, you need to access php.ini file. Using XAMPP, open this file like that:XAMP09

PHP Extensions Check: The usual missing extensions are xsl and intl. To resolve this, search extension=php_intl.dll as well as extension=php_xsl.dll, then both remove the beginning semicolon “;”.

XAMP10

Now you need to stop both Apache and MySQL in XAMPP, then restart them again for new effects to be activated and resolved. Click Try Again in localhost for new result, after checking, hit Next.


After the Check is successful move on to Step 2: Add Database. Add necessary database, like Database Server Host, Database Server Username and Database Name. Database server Username is always root but you can also create one via phpmyadmin.XAMP11

Step 3: Web Configuration… just click on next no need to specify something else. Now move on to Step 4: Customize your Store and enter your preferences for the store. On Step 5: Create Admin Account …this is your Admin Panel account.XAMP12On Step 6: Install finally hit the Install Now button and for 2 – 3 minutes. You now have successfully installed Magento 2 on your web server. But we are still missing one thing to do. Let´s move on to the last step.

4. Deploy static content

You may have the problem that Magento get´s loads of 404 Not found error when you open the developer tools via F12 to solve this problem we must deploy static view files. In order to do that we must setup the php environment variable on your machine this Tutorial shows how to setup the environment variable for your specific PHP version.

After that is done please go to your Magento installation dir  via cmd:

XAMP12

The static view files deployment command enables you to write static files to the Magento file system when the Magento software is set for production mode.

Run that command and you should be fine. Now switch over to http://localhost/magento2/ there you can verify that Magento has been successfully installed.

magento

You now have a brief overview on how to setup Magento 2 on your local Windows machine.

Hope you guys and girls enjoyed reading this as much as I enjoyed writing it. Do you think this tutorial will be of help to someone? Do not hesitate to share. If you liked it, share it somewhere else or subscribe to my blog.

5 thoughts on “Magento 2 – How to setup Magento with XAMP on Windows

  1. Moritz,
    many thanks for the detailed post. Was getting headache trying to get rid of the 404 errors until I found your blog post. Very helplful.

    Grüße aus Hessen 😉
    Marc

    1. Hey Marc,

      freut mich zu hören, darf ich fragen welchen Shop du mit Magnto umsetzten möchtest?

      Schonen Abend und Grüße aus Bayern
      Moritz

Leave a Reply

Your email address will not be published. Required fields are marked *