7 Steps to Install Magento 2 in Windows OS with XAMPP

7 Steps to Install Magento 2 in Windows OS with XAMPP
Back to blog

In this guide, we are going to install Magento 2 on the Windows platform using the XAMPP server. We need to know about the system requirements that are mentioned below: 

System Requirements for Magento 2 

  1. Apache 2.2 or 2.4  

  2. Download XAMPP

  3. PHP 7.0.13 -7.0.x, 7.1.x, 7.2.x  

  4. MySQL %.6,5.7  

  5. Browser – Google Chrome, Internet Explorer, or Firefox, etc.

Step 1: Install XAMPP 

  1. To Download the 7.2.x version, click here

  2. Open and install XAMPP on your Windows.

Install and save it in the drive you wish to keep the file. 

  1. Open your XAMPP Control Panel.  

  2. Click on Apache’s Config and go to PHP (php.ini)

  1. Search for extension=php_intl.dll, extension=soap, extension=sockets , and extension=php_xsl.dll, and remove the semicolon “;” at the beginning of both.

  1. Start the Apache and MySQL services from the XAMPP control panel.

Step 2: Install Composer (Optional) 

  1. Download Composer and install it on Windows.

  1. Browse the XAMPP PHP exe file location to install Composer.

Step 3: Download the Magento 2.3.5 setup from the Magento Official website

  1. Extract the Download Magento 2.3.5 archive and rename the extracted folder with the name you wish  

  2. Copy the renamed folder and paste your XAMPP\htdocs location (ex, D:\xampp\htdocs).

 

Step 4: Install Magento 2 (Run localhost open project – localhost/magento)

  1. Start Installing (click Start Readiness Check).

  1. After clicking Readiness Check.

  1. Click Next and “Add Database” step 2, enter the database details such as server host, username, password, and name.

Add the database name you created in the localhost phpMyAdmin, then click Next.  

  1. In the Web Configuration step, enter the store and Magento admin address. Click Next

  1. Customize Your Store step, enter the details such as time zone, currency, language, and click Next.  

  1. Create an Account step, configure the username, email, and password. Click Next 

  1. Finally, for the installation step, click Install Now. 

Step 5: However, the process of installation is incomplete and gives an error

Sort the error: 

You can replace this function validateURLScheme in File name: \vendor\magento\framework\Image\Adapter\Gd2.php

private function validateURLScheme(string $filename) : bool  
    {  
       $allowed_schemes = [‘ftp’, ‘ftps’, ‘http’, ‘https’]; 
        $url = parse_url($filename); 
        if ($url && isset($url[‘scheme’]) && !in_array($url[‘scheme’], $allowed_schemes) && !file_exists($filename) && strlen($url[‘scheme’]) > 1) {  
        return false; 
     }  
    return true; 
}  

 

  1. And refresh the window and click install. 

  2. A success message will be displayed as below after the successful installation:

Step 6: Launch the admin panel in the browser

  1. Still, if you don’t get any display on the admin dashboard:   

  1. Change the URL validator function on   

/vendor/magento/framework/View/Element/Template/File/Validator.php:113

protected function isPathInDirectories($path, $directories)  
    {  
        $realPath = str_replace(‘\\’, ‘/’, $this->fileDriver->getRealPath($path));  
         if (!is_array($directories)) {  
             $directories = (array)$directories; 
        }  
        foreach ($directories as $directory) {  
             if (0 === strpos($realPath, $directory)) {  
                return true;
            }  
        }  
        return false; 
    }  

  1. Refresh the page, and a dialog box with the Magento 2 login screen appears.

Step 7: Run the Magento Composer Command to remove browser console error and resolve the broken image link

  1. Open the Command Prompt to run the Magento cache clear command.   

  2. Go to the Magento project location directory (D:\xampp\htdocs\magento>)  

  3. php bin/magento setup:upgrade  

  4. php bin/magento setup:static-content:deploy -f  

  5. php bin/magento c:c


Finally, Magento 2 is successfully installed and is ready to operate on Windows localhost.

Conclusion:

In wrapping up these 7 steps to install Magento 2 on a Windows OS using XAMPP, you’ve embarked on a journey that transforms your computer into a dynamic platform for eCommerce development. As a web developer, this process demystifies the installation, making it accessible for anyone eager to delve into Magento’s capabilities. 

The straightforward approach outlined here ensures that you’re not bogged down by unnecessary complexities. By following these steps, you’ve not only set up Magento 2 but also gained a foundational understanding of the environment it thrives in. 

Now armed with a Magento-powered Windows environment, you’re poised to unleash your creativity and build engaging and robust eCommerce solutions. This isn’t just an installation; it’s the gateway to crafting digital storefronts that stand out in the vast online landscape. Happy coding!

Frequently Asked Questions 

Q: Can I install Magento 2 on Windows without XAMPP? 

A: Yes, you can install Magento 2 on Windows without XAMPP. For this, you can use the WAMP, MAMP, or a manual Apache–MySQL–PHP setup to install Magento 2 without XAMPP. 

Q: Which PHP version is best for Magento 2 installation? 

A: PHP 7.2.x is a recommended version when you are looking to set up Magento 2 locally on your Windows operating system. 

Q: Why do I need Composer for Magento 2 installation? 

A: Composer helps you manage Magento dependencies, updates, and extension efficiency. 

Q: Is it safe to use Magento 2 on localhost for development? 

A: Yes, it is safe for you to use the Magento 2 on localhost for development.

Real-World Results

Discover How We Deliver Results

blog-postPost preview
Pooja Sharma 01 Jan 1970

TypeScript Vs JavaScript Vs ECMAScript – Know The Difference

In this article, you will know the major differences between Typescript, Javascript, and Ecmascript.

blog-postPost preview
Subodh Dharmwan 01 Jan 1970

Core Data in iOS & macOS: A Complete Guide to CRUD, Predicates, and Data Management

Core Data is one of Apple's most popular frameworks for iOS and macOS apps. Core data is used to manage the model layer objects in applications.

blog-postPost preview
Pooja Sharma 01 Jan 1970

Top 9 Software Development Models to Choose From: Phases and Applications

Here are the top 9 Software Development Models to Choose From: Phases and Applications.

blog-postPost preview
Pooja Sharma 06 Jul 2025

Software Development Time Estimation: A Practice Guide

This hands-on software development time estimation guide describes the basics of estimating time, provides practical time-estimating techniques.

blog-postPost preview
Pooja Sharma 14 Aug 2025

A Quick Guide to Install Laravel 8 on Windows 10 XAMPP

Laravel 8 is a PHP-based web application framework, here is a quick guide on how to install Laravel 8 on windows 10 xampp.

Turning expertise into action for your business.

We are more than just developers and consultants—we are your partners in navigating the digital landscape. Let us be the engine behind your next big success while you focus on your core vision.

Explore Opportunities!