After these 10 steps, I guarantee you will create a Magento 2 site on localhost with XAMPP.
In case you need, we also publish a guide of Magento Installation for Magento version 1.x.
*Important Note: Before installing any version of Magento 2, you could easily find your favorite Magento 2 version in this article: UP-TO-DATE Magento Download (all Magento 2 versions).
You can watch this video in case you don’t like reading too much of Magento 2 installation. 😀
Magento Download (all Magento 2 versions).First, you need to know the requirements for Magento 2 installation. When you download one version of Magento 2, there will be a line below to tell you which Web server, database and php configuration you need for this version. You could download Magento 2 from this trustful and up-to-date source: UP-TO-DATE
In this guide, we use Magento Community Edition 2.0.10, which requires at least php 5.5.22. For more information of prerequisites of Magento 2, read in http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements-2.0-tech.html.
If you choose version 2.1, you can read in http://devdocs.magento.com/guides/v2.1/install-gde/system-requirements-2.1-tech.html.
*Note: Now (December 1st, 2018), Magento has released a new version of Magento 2.3. More information of prerequisites of Magento 2.3 can be read in: https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html
In this guide, we use Magento Community Edition 2.0.10 with XAMPP version 5.6.24, but you can try other versions of XAMPP which meets the requirements of your version of Magento 2.
After finishing the set up of XAMPP, open it and start both Apache and MySQL web server.
When both modules have a green background, you know they have been already ready.
Actually, the most often hindrance to start Apache is when a program also takes port 443 or 444 like this
You should turn off the program using same port with Apache in order to continue.
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.
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.
Now you need to go through 6-step-installation of Magento 2. So watch it closely.
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.
PHP Settings Check: always_populate_raw_post_data error. To resolve this error, you need to access php.ini file. Using XAMPP, open this file like that:
Search this line: always_populate_raw_post_data = -1
Make sure the number is -1, then remove the semicolon “;” at the beginning of the lines.
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 “;”.
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.
Add necessary database, like Database Server Host, Database Server Username and Database Name.
Switch to localhost/phpmyadmin in web browser, create a new database name exactly the same with your previous Database Name when adding necessary database.
Find your IP in localhost/phpmyadmin like that:
Customize your Store. Change Default Time Zone, Currency as well as Language here.
Thanks for reading our Magento 2 installation guide!