Install Magento 2.4 with sample data on Xampp, Windows 10 by Composer and Command line

Опубликовано: 22 Февраль 2026
на канале: 77 Tips
16,210
155

Install Magento 2.4 with sample data on Xampp, Windows 10 by Composer and Command line


1. Install Composer

2. Install Elasticsearch & run and test
Ok



http://localhost:9200/

3. Install magento24
Download:

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4 magento24/
or download Archive (zip/tar)



Command line:

php bin/magento setup:install --base-url="yourdomain" --db-host="localhost" --db-name="dbmagento24" --db-user="root" --db-password="" --admin-firstname="admin" --admin-lastname="admin" --admin-email="[email protected]" --admin-user="admin" --admin-password="admin123" --use-rewrites="1" --backend-frontname="admin"

do not turn off elasticsearch
please waiting install......... 1h, ok

4. Test and see the result

php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush

Note: On Xampp Windows

Change Symlink to copy in file di.xml
Find file Validator.php in ...Magento\Framework\View\Element\Template\File
At around line 138 replace code with this one



and cache:flush

http://yourdomain/
Fix Two Factor Auth login admin
php bin/magento module:disable Magento_TwoFactorAuth