Claim your Biolink Click Here
1 like 0 dislike

How to install magento 2.4.6 on windows 10/11 in Localhost XAMPP?

in Computers & Internet by (820 points) | 60 views

1 Answer

0 like 0 dislike

How to install magento 2.4.6 on windows 10 /11 localhost

Table of Contents

Step 1: Download and Install Xampp and enable PHP extensions in php.ini

Step 2: Download and install composer

Step 3: Download elasticsearch then run

Step 4: Download magento2.4.6 using composer

Step 5: Create Virtual Host for magento

Step 6: Create database user and database for Magento 2.4.6 using phpMyAdmin

Step 7: Install Magento 2.4.6

Download and install XAMPP

Download and install composer


----------------------------------------------------------------------------------------------- Download and run Elasticsearch

Download Magento

composer create-project --repository-url= magento/project-community-edition mage2rock

Public Key(username): 49d5e318ce1764cbb3b709e1380b34ce

Private Key(password): 5b36e15269917b811c1516fa07567e72


Server configuration (Create virtual host)


DocumentRoot "C:/xampp/htdocs/mage2rock/pub" ServerName DocumentRoot "C:/xampp/htdocs" ServerName localhost

then open C:\Windows\System32\drivers\etc\hosts file in notepad and add the below line at the bottom of the file.

Restart XAMPP

Create Database in phpmyadmin


Install Magento

php bin/magento setup:install --base-url="" --db-host="localhost" --db-name="mage2rock" --db-user="mage2rock" --db-password="Admin@12345" --admin-firstname="admin" --admin-lastname="admin" --admin-email="Emails are not allowed" --admin-user="admin" --admin-password="Admin@12345" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin" --search-engine=elasticsearch7 --elasticsearch-host="localhost" --elasticsearch-port=9200

Find validateURLScheme function in vendor\magento\framework\Image\Adapter\Gd2.php file. at line 70. Replace function with this:

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)) {

          return false;

      return true;   


Go to: C:\xampp\htdocs\magento2.4\vendor\magento\framework\View\Element\Template\File - > Edit Validator.php using a text editor and find this line: Find this line

strpos($realPath, $directory)

Replace strpos($path, $directory)

Then, Open up app/etc/di.xml in the editor, fint this line

“Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink” replace


-------------------------------------------------------------------------------------------------- ===================

Run Below Command

php bin/magento indexer:reindex

php bin/magento setup:upgrade

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

php bin/magento cache:flush

php bin/magento module:disable Magento_AdminAdobeImsTwoFactorAuth Magento_TwoFactorAuth

Thanks for watching------------

by (4.7k points)

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
asked Sep 7, 2017 in Education & Reference by Krish (1.1k points) | 552 views
2 like 0 dislike
1 answer
1 like 0 dislike
1 answer
asked Jan 4, 2018 in Education & Reference by Sam (1.6k points) | 1.2k views
1 like 0 dislike
1 answer
2 like 0 dislike
0 answers
asked May 31, 2020 in Education & Reference by Marc (4.7k points) | 312 views
0 like 0 dislike
1 answer
asked Sep 5, 2019 in Computers & Internet by Neha (1.1k points) | 275 views
0 like 0 dislike
5 answers

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,313 questions
1,475 answers
4,809 users