Install Magento 2.4 on Windows 10 (2021)

Installing Magento 2.4 on Windows 10 can be really frustrating because of all the errors related to configurations. Here is a very simple step by step tutorial to install Magento 2.4, configuring and resolving all the errors that arise in the process. A video-based tutorial is also available if you prefer to watch and follow the steps.

Following are the pre-requisites required for installing Magento. Download the setups of the following.

After downloading the setups, You need to install XAMPP and Composer and follow the steps below.

  • Start Apache and MySQL from XAMPP Control Panel.
  • Navigate to htdocs folder inside XAMPP installation directory.
  • Create a new folder inside htdocs with the name of “elasticsearch”. Paste the downloaded Elasticsearch zip file inside the newly created folder. Extract the zip file, navigate to bin folder, and double click on “elasticsearch.bat” to start elasticsearch cluster.
  • Make sure that elasticsearch is up and running by visiting localhost:9200 by any browser. You should see a JSON object.
  • Now visit localhost/phpmyadmin and create a new database ‘magento
  • Create a new folder inside htdocs with the name of ‘magento’. Paste the Magento zip file, that we downloaded earlier, inside this folder and extract it.
  • Inside your magento directory, navigate to vendor\magento\framework\Image\Adapter and open G2d.php with any code editor. Search for the method named “validateURLScheme”, which should be at line # 86. Replace the entire method code with this code:
  • Inside your magento directory, navigate to vendor\magento\framework\View\Element\Template\File and open Validator.php with any code editor. Scroll down to line # 138. Replace the entire line with the following snippet:
  • Inside your magento directory, navigate to vendor\magento\framework\Interception and open PluginListGenerator.php with any code editor. Scroll down to line # 158. Replace the entire line with the following snippet:
  • Inside your XAMPP installation directory, navigate to xampp/php and open php.ini with any code editor. Enable the extensions intl, soap, sockets, xsl on line 921, 943, 944, 949 respectively by removing semi-colon before the word extension. Now restart xampp.
  • Inside your magento directory, open cmd and run the following commands in order. If any command gives an error, make sure your PHP version is 7.3 or greater and you’ve made all the changes mentioned above.
  • We are nearly there. Open localhost/phpmyadmin and switch to database ‘magento’. Now the run the following query in the SQL Query tab:
  • Open localhost/magento/admin in any browser and login using ‘admin’ and ‘admin123’ as username and password respectively. After logging in, if the loader does not disappear and keeps on loading then there is one more change you need to make. Inside your magento directory, navigate to app/etc/di.xml and search for

and replace it with

  • Now refresh the page and voila, you have installed Magento 2.4 successfully! Phew, that was a lot of work.

If you got stuck at any point, there is a video tutorial available and you can watch it for a reference.

Similar Posts