Author Box

Discuss Your Project

About Us

We are Microsoft Gold partner with its presence across the United States and India. We are a dynamic and professional IT services provider that serves enterprises and startups, helping them meet the challenges of the global economy. We offer services in the area of CRM Consultation and implementation, Application development, Mobile application development, Web development & Offshore Development.

magento 2 installation in window os

7 Steps to Install Magento 2 in Windows OS with XAMPP

By Pooja Sharma / December 2, 2020

July 1, 2021
7 Steps to Install Magento 2 in Windows OS with XAMPP

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

System Requirement for Magento 2

  • Apache 2.2 or 2.4 
  • Download XAMPP 
  • PHP 7.0.13 -7.0.x, 7.1.x, 7.2.x 
  • MySQL %.6,5.7 
  • Browser - Google Chrome, Internet Explorer, or Firefox, etc. 

Step 1: Install XAMPP 

  • To Download the 7.2.x version click here
  • Open and install XAMPP on your Windows 

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

  • Open your XAMPP Control Panel
  • Click on Apache’s Config and go to PHP (php.ini) 
  • Search for extension=php_intl.dll, extension=soap, extension=sockets and extension=php_xsl.dll, and remove the semicolon “;” at the beginning from both. 
  • Start the Apache and MySQL services from the XAMPP control panel. 

Also, read: How to add Simple & Configurable Products in Magento 2

Step 2: Install Composer (Optional)

  • Browse XAMPP PHP exe file location to install the composer. 

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

  • Extract the Download Magento 2.3.5 archive and rename the extracted folder with the name you wish 
  • Copy the renamed folder and past your XAMPP\htdocs location (ex: D:\xampp\htdocs). 

Also, read: 4 Effective ways Small Businesses Can Optimize in Magento 2 Store

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

  • Start Installing (click Start Readiness Check). 
  • After click Readiness Check. 
  • Click Next and “Add Database” step 2, enter the database details such as server host, username, password, name. 

Add database name you created in localhost phpMyAdmin then click next. 

  • In the Web Configuration step, enter the store and Magento admin address. Click Next 
  • Customize Your Store step, enter the details such as time zone, currency, language, and click Next 
  • Create an Account step, configure the username, email, and password. Click Next 
  • Finally, for the installation step, click Install Now 

Also, read: Must use Magento 2 extension for additional functionality

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;
} 
  • And refresh the window and click install. 
  • A success message will be displayed as below after the successful installation: 

Step 6: Launch the admin panelin the browser

  1. Still if you don’t get any display on the admin dashboard:  
  1. Change 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 page and a dialog box with Magento 2 login screen appear. 

  • Open Command prompt for running Magento cache clear command.  
  • Go to the Mangento project location directory (D:\xampp\htdocs\magento>) 
  • php bin/magento setup:upgrade 
  • php bin/magento setup:static-content:deploy -f 
  • php bin/magento c:c 

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

[sc name="Web Development"]

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

System Requirement for Magento 2

  • Apache 2.2 or 2.4 
  • Download XAMPP 
  • PHP 7.0.13 -7.0.x, 7.1.x, 7.2.x 
  • MySQL %.6,5.7 
  • Browser – Google Chrome, Internet Explorer, or Firefox, etc. 

Step 1: Install XAMPP 

  • To Download the 7.2.x version click here
  • Open and install XAMPP on your Windows 

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

  • Open your XAMPP Control Panel
  • Click on Apache’s Config and go to PHP (php.ini) 
  • Search for extension=php_intl.dll, extension=soap, extension=sockets and extension=php_xsl.dll, and remove the semicolon “;” at the beginning from both. 
  • Start the Apache and MySQL services from the XAMPP control panel. 

Also, read: How to add Simple & Configurable Products in Magento 2

Step 2: Install Composer (Optional)

  • Browse XAMPP PHP exe file location to install the composer. 

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

  • Extract the Download Magento 2.3.5 archive and rename the extracted folder with the name you wish 
  • Copy the renamed folder and past your XAMPP\htdocs location (ex: D:\xampp\htdocs). 

Also, read: 4 Effective ways Small Businesses Can Optimize in Magento 2 Store

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

  • Start Installing (click Start Readiness Check). 
  • After click Readiness Check. 
  • Click Next and “Add Database” step 2, enter the database details such as server host, username, password, name. 

Add database name you created in localhost phpMyAdmin then click next. 

  • In the Web Configuration step, enter the store and Magento admin address. Click Next 
  • Customize Your Store step, enter the details such as time zone, currency, language, and click Next 
  • Create an Account step, configure the username, email, and password. Click Next 
  • Finally, for the installation step, click Install Now 

Also, read: Must use Magento 2 extension for additional functionality

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;
} 
  • And refresh the window and click install. 
  • A success message will be displayed as below after the successful installation: 

Step 6: Launch the admin panelin the browser

  1. Still if you don’t get any display on the admin dashboard:  
  1. Change 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 page and a dialog box with Magento 2 login screen appear. 

  • Open Command prompt for running Magento cache clear command.  
  • Go to the Mangento project location directory (D:\xampp\htdocs\magento>) 
  • php bin/magento setup:upgrade 
  • php bin/magento setup:static-content:deploy -f 
  • php bin/magento c:c 

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

Web Development Services

Are you looking for a reliable web development company? Our highly skilled web developers enables us to deliver result oriented web development services. Contact our team to understand, how we can help you in achieving your business goals.

0 0 votes
Article Rating
Subscribe
Notify of
guest
1 Comment
Inline Feedbacks
View all comments
Taimur khan
Taimur khan
December 17, 2020 1:43 pm

Very well-written article. Thanks for sharing this. Very helpful to me right now.

1
0
Would love your thoughts, please comment.x
()
x