How To Install Magento 2.4.x & 2.4.5 via Composer

There are following below Steps need to follow

Here, we considering machine has been already installed following below software as per compatibility of Magento 2.4 Requirement

  • PHP Latest Version 7.4 or above
  • Elastic Search Latest Version 7.6 & above
  • MYSQL Latest Version 5.7 or 8.0
  • Apache Version 2.4 or Nginx Version 1.8
  • Composer 2.0

Step[1] – Download Magento 2.4

Run the following below command in the root directory [Create Empty Folder inside C:/xampp/htdocs/magento244] to download Magento 2 by using composer

[1.1] Magento 2.4 Community Edition

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition .

[1.2] [ Magento 2.4.x Enterprise Edition (Adobe Commerce Enterprise Edition 2.4.x) / Magento 2.4.x Cloud Edition 2.4.x (Adobe Commerce Cloud Edition 2.4.x) ]

Here below command for Magento 2.4.4

composer create-project --repository-url=https://repo.magento.com/ magento/project-enterprise-edition=2.4.4 .

Step[2] – Set Correct Directory & Files Permission

Run the following below command in the root directory to set correct Directory & Files Permission

sudo chmod 777 app/etc

sudo chmod 644 app/etc/*.xml

find var -type d -exec chmod 777 {} \;

find pub/media -type d -exec chmod 777 {} \;

find pub/static -type d -exec chmod 777 {} \;

sudo chmod -R 777 generated

sudo chmod -R 777 var

sudo chmod u+x bin/magento

Step[3]Magento 2.4 Instllation Command

Run the following below command to Magento 2.4

php bin/magento setup:install --base-url="http://127.0.0.1/magento24sample/" --db-host="localhost" --db-name="magesampledata24" --db-user="root" --admin-firstname="admin" --admin-lastname="admin" --admin-email="admin@admin.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="INR" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin"

--------------------------------------------------------------------

Above Command having following below data

[1] base-url=http://127.0.0.1/magento24sample/
[2] db-host="localhost"
[3] db-name::" magesampledata24"
[4] db-user:: "root"
[5] admin-firstname="admin"
[6] admin-lastname="admin"
[7] admin-email="admin@admin.com"
[8] admin-user="admin"
[9] admin-password="admin123"
[10] language="en_US"
[11] currency="USD"
[12] timezone="America/Chicago"
[13] use-rewrties="1"
[14] backend-frontname="admin"

Steps[4] – Magento 2.4 Installation Process Showing

Similarly, way as above will be displayed other running steps

Finally last two running steps

If Message displaying as below, indicates, Magento 2 Installation has been successfully installed.

[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /admin

Run below CLI Command

php bin/magento deploy:mode:set developer

php bin/magento setup:upgrade

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

php bin/magento indexer:reindex

php bin/magento cache:clean

php bin/magento cache:flush

Now run, Magento 2.4 Frontend URL as well as Admin URL

http://127.0.0.1/magento24sample/
http://127.0.0.1/magento24sample/admin 

admin credentials admin / admin123 

During Installation,

When installing Magento 2.4.x & if getting below error

In PatchApplier.php line 170:

Unable to apply data patch Magento\Theme\Setup\Patch\Data\RegisterThemes for module Magento_Theme. Original exception message: Wrong file

In Gd2.php line 64:

Wrong file

Error format as below

Solution: Find validateURLScheme function in vendor\magento\framework\Image\Adapter\Gd2.php file. at line 96. Replace function with this: !file_exists($filename)

Replace existing validateURLScheme function with modified validateURLScheme function as per below code

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;
  }

Finally, Magento 2.4 or 2.4.x Installation will be completed 100% after above changes by Composer

If you want to Magento 2.4.x Sample Data Deployment, follow below Link

How to Install Magento 2.4.x with Sample Data via Command Line

Other Important Magento 2.X Link

Magento 2.3 To Magento 2.4.5 Comptibility For PHP, MYSQL, Composer, Apache etc


Magento 2.4.3-p1 Installation Steps


Magento 2.4.3 Installation Steps


Magento 2.4.3 Features


Magento 2.4.3 – p1 Features


Magento 2.4 Two Factor Authentication


Magento 2.4.1 Features


Magento 2.4 Features


Magento 2.4 Installation


Magento 2.2, Magento 2.3, Magento2.4 Installation Issue on Windows 10, XAMPP


Magento 2 Installation at 51% Error: (Wrong file in Gd2.php:64) Module ‘Magento_Theme’

Leave a Reply

Your email address will not be published. Required fields are marked *