After these 10 steps, I guarantee you will create a Magento 2 site on localhost with XAMPP.
Or you can watch this video in case you don’t like reading too much.
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.
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.
After installing Magento 2 on localhost, you may encounter some layout errors. To fix these errors, read this title.
You also can want to know Common Magento Mistakes Beginners Need to Avoid.
Ready to foster your knowledge