Learn Magento 2.4 Installation On Windows

We learned how to install Magento 2.4 on Ubuntu 20.04 and macOS in our previous blogs. Now, in this blog, we’ll switch to Learn Magento 2.4 Installation On windows.

Installation Requirements For Magento 2.4:

Operating systems

  • Distributions of Linux, including RedHat Enterprise Linux (RHEL), CentOS, Ubuntu, Debian, macOS, Windows.

Memory requirement

  • Magento2 requires 2GB or higher RAM. 

Composer

  • Composer 2.x cannot be supported by Magento.

Web servers

  • Apache 2.4
  • Nginx 1.x

Database

  • MySQL 8.0
  • MariaDB 10.4

PHP

Magento supports PHP 7.4.0

Elasticsearch

  • As of 2.4.0 Magento, MySQL is no longer available for search purposes. You’re supposed to use Elasticsearch.
  • Elasticsearch 2.x, 5.x, and 6.x are no longer supported by Magento.

To get detailed information about system requirements, just visit the mentioned link: https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html

What We’re Going To Use:

  • OSWindow 10
  • SERVERApache 2
  • RAM8 GB
  • PHP: 7.4
  • MY SQL8.0
  • Composer: 1.10
  • Elasticsearch: 7.10

Magento 2.4 Installation On Windows

So let’s move to the installation part.

STEP 1: Download and Configure XAMPP Web server.

Firstly, download the XAMPP Web Server to set up the environment for Magento2 Community Edition. After that, tap “Next” in every setup window and Install the XAMPP Web Server.

After successful installation, run your XAMPP Web Environment and Launch Apache and MySQL Service.

Before proceeding further, you need to allow the requisite PHP extensions. So, just tap the apache “config” button and select the php.ini configuration file.

Enable intl“, “xsl“, “Soap“, extensions in the configuration file by searching for the extensions by pressingctrl+f as shown in the below images. And then remove the semicolon to uncomment it before the line.

Note: By default, the rest of the PHP extensions are enabled. If it’s not then you can enable it now or even later by following the above way. In case, if you get any error defining the necessity of any other PHP extension.

Now, Look for extension=by pressing ctrl=f. you will find this as below:

after that, replace the modulename” with “php_Sockets.d11 and uncomment it by removing the semi-colon like as below.

Save and close the file at last. Stop and restart the Apache.

STEP 2: Download Magento 2 By Using The Composer.

Upon completion, download the Magento 2 Community Edition zip file from the mentioned link: https://github.com/magento/magento2/releases

Extract the Zip file in the htdocs folder of the XAMPP installation directory after it has been downloaded. To do that, right-click the Magento2 zip file and select extract files, and then select the htdocs destination path and press OK.

Now go to the folder htdocs and find the extracted Magento folder. Rename this folder to Magento2.

STEP 3: Now, open theGd2.php file located as per the following path:

magento2\lib\internal\magento\framework\image\adaptor\Gd2.php

find the below lines;

and then replace with,

$allowed_schemes = [‘ftp’, ‘ftps’, ‘http’, ‘https’];
$url = parse_url($filename);
if ($url && isset($url[‘scheme’]) && strlen($url[‘scheme’]) > 1 && !in_array($url[‘scheme’], $allowed_schemes)) {
return false;

and at last, save the file and exit.

STEP 4: Download and install Composer:

On your Windows system download composer by using the link: https://getcomposer.org/Composer-Setup.exe and then install it. Tap Next in every setup window and Install the composer.

The php.exe file path must be defined next. Provide the path and then click Next

STEP 5: Install Magento2 dependencies using Composer.

Now execute the below commands in the command prompt to downgrade the composer version and to install the required Magento2 dependencies on your localhost. 

STEP 6: Similarly, Download and Install The Elastic Search To Move Further.

Download Elasticsearch from the mentioned link: https://www.elastic.co/downloads/elasticsearch and install it.

Extract the Zip file in the htdocs folder of the XAMPP installation directory after it has been downloaded. To do that, right-click the elasticsearch zip file and select extract files, and then select the htdocs destination path and press OK.

After successful extraction, run the bash file as an administrator. 

You will get the output like below.

Note: Please don’t close this window until the completion of the Magento 2.4 installation. Otherwise, it will show up an error.

Please wait for a while to get the installation done. And then type “localhost:9200” in the browser and you’ll get details of the installed Elasticsearch extension. The output will be identical as seen in the image below:

STEP 7: MySQL Database Creation.

For Magento2, we have to create a database. Firstly, open the web browser and hit the URL http://localhost/phpmyadmin to open the PHPMyAdmin page. Then, by using thenew button in the menu section on the left, create a database by the name magento2 or by another name of your choice.

STEP 8: Magento Installation.

After creating the database, the next step is to install Magento2. Open your browser first and enter http://localhost/magento2. You will get the output as similar below.

Likewise, Execute The Commands Below To Install Magento 2 By Using The Required Variables Such As Host, Database Name, Username, And Password, Etc.

when this command is successfully executed, the output will be identical as seen in the image below:

STEP 9: Now, open the Validator.php file located as per the following path:

magento\lib\internal\magento\framework\View\Element\Template\File\Validator.php

Find these lines;

and then modify it to,

$realPath = str_replace(‘\’, ‘/’, $this->fileDriver->getRealPath($path));

and at last, save the file and exit.

STEP 10: In Addition, Enable Requisite commands.

while the installation of Magento2 has been successfully completed. Go to your browser and enter the IP address or your domain name. As a result, the homepage of your default eCommerce website will be like this:

STEP 11: Magento Configuration.

After all the above steps, you can now access your admin panel by using your credentials. Therefore, the admin login will open as in the image below.

You can’t log in to Magento Admin Panel after installation since two-factor authentication has been implemented in Magento2.4 and won’t be allowed you to log in. Hence, a page similar to the one below will open.

Moreover, to log in, we need a working email id. And then Magento sends an email to conduct the authentication on the given email id. In that case, the 2-factor authentication module must need to be disabled and later set up by the admin panel. Thus, we can disable 2FA by using the below command in the Magento web root directory:

php bin/magento module:disable Magento_TwoFactorAuth

**We highly recommend you to continue with 2-factor authentication**

At last, the admin panel is accessible. In addition, this is what the default admin dashboard looks like.

In short, your eCommerce platform is ready to use.

Thanks For Reading!

At last, we hope it works for you! And during this blog, you have found something valuable.

Keep in touch!!

In case of any help or query, please contact us or raise a ticket.

Category(s) magento
. . .

Comment

Add Your Comment

Be the first to comment.

css.php