Skip to content

devomman/magento

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Magento 2.4.1 Local Setup using XAMPP

N|Solid

Folow Step by Step

  1. Download XAMPP and install and Run.
  2. Download Composer and install.
  3. While Installing Composer Select "C:\xampp\php\php.exe" then finish installing.
  4. Download Elastic Search Zip File.
  5. Extract zip to "C:\xampp\htdocs" and Rename folder "elasticsearch" inside "C:\xampp\htdocs"
  6. Now Goto "C:\xampp\htdocs\elasticsearch\bin\elasticsearch.bat" and RunAs Administrator also Check in Browser Working or Not:
http://localhost:9200/
  1. Don't Close Or Terminate "elasticsearch.bat" until magento install has done.
  2. Download Magento zip file. (Choose Sample Data or Empty then Signin/Signup to Download)
  3. Extract zip to "C:\xampp\htdocs" and Rename folder "yourdomain.com" inside "C:\xampp\htdocs"
  4. Now Goto "C:\xampp\htdocs\yourdomain.com\vendor\magento\framework\Image\Adapter\Gd2.php" file and open it Any Editor.
  5. Areound Line 86. Replace the code below:
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;
}
  1. Now Check in Browser "Localhost/yourdomain.com" and it's asking to setup with command line Ex. Below:

    Welcome to Magento Admin, your online store headquarters.
    Please review Terms & Agreement and read Getting Started to learn
    how to install Magento using the command line.

  2. Now Open Browser and Type

http://localhost/phpmyadmin/
  1. Goto: Database Tab >> Type: magentolocal_db >> Click: Create
  2. Now goto "C:\xampp\htdocs\yourdomain.com" and Address Bar Type "cmd" to run the command same folder or Goto same directory using command line.
  3. Now Run below command and chnage yours a) Domain Name, DB Name, User, Email & Password:
  php bin/magento setup:install --base-url="http://localhost/yourdomain.com" --db-host="localhost" --db-name="magentolocal_com_db" --db-user="root" --db-password="" --admin-firstname="system" --admin-lastname="admin" --admin-email="devomman@gmail.com" --admin-user="systemadmin" --admin-password="@dminPass1" --use-rewrites="1" --backend-frontname="admin"
  1. First Time Xampp User Getting this Error Below will Appear in Command Line:

    In Installer.php line 545:\

    Missing following extensions: 'intl' 'soap' 'xsl' 'sockets'
  2. So Now We have enable following extensions in "C:\xampp\php\php.ini" open php.ini file in Editor

;extension=intl
;extension=soap
;extension=xsl
;extension=sockets
  1. Search one by one extension line in editor and uncomment the line to enable.
  2. Once you enable then stop and exit XAMPP Server and Restart don't close/terminate elastic search until the setup process completely done.
  3. Now Follow the Same Step 16 - Step 17. Again and the result: will appear Below ex:

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

  1. Now Follow the Same Step 16 and Type in Command Line Below:
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush
  1. After Done >> Goto "C:\xampp\htdocs\yourdomain.com\app\etc\di.xml" and Open in Editor
  2. Search "Symlink" and Replace to "Copy" This Step is Not Required - try without this step
  3. Now Goto "C:\xampp\htdocs\yourdomain.com\vendor\magento\framework\View\Element\Template\File\Validator.php" and Open in Editor
  4. Chnage the Line Around 138 Below:
$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
  1. Now Follow the Same Step 16 and Type in Command Line Below and Done!
php bin/magento cache:flush
  1. Disable Magento_TwoFactorAuth if Needed Follow the Same Step 16 and Type in Command Line:
php bin/magento module:disable Magento_TwoFactorAuth
  1. Now Follow the Same Step 16 and Type in Command Line Below and Done!
php bin/magento cache:flush

Requied Download Files

Note: Please download this files before you start.

Download Link
Magento https://magento.com/tech-resources/download
XAMPP https://www.apachefriends.org/download.html
Composer https://getcomposer.org/
Elastic Search https://www.elastic.co/downloads/elasticsearch

Thanks to Muhammad Omman | Email: devomman@gmail.com

About

Magento Guide

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published