You need to download Magento 2.4.5 by command line
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.5 magento-2.4.5
For example
Prepare to Install
1-) Change the Validator.php in vonder\magento\framework\View\Element\Template\File at line 138
Orginal scripts:
$realPath = $this->fileDriver->getRealPath($path);
Change to:
$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
2-) Find validateURLScheme function in vendor\magento\framework\Image\Adapter\Gd2.php file. at line 96. Replace function with this
if ($url && isset($url['scheme']) && !in_array($url['scheme'], $allowed_schemes) && !file_exists($filename)) {
return false;
}
3-) Disable Magento_TwoFactorAuth
4-) Start Elasticsearch , you can see How to install Elasticsearch
Install
- Run command line to install Magento project
php bin/magento setup:install --base-url="https://site.local/magento-2.4.5/" --db-host="localhost" --db-name="magento_245" --db-user="root" --admin-firstname="admin" --admin-lastname="admin" --admin-email="[email protected]" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin" --search-engine=elasticsearch7 --elasticsearch-host="127.0.0.1" --elasticsearch-port=9200
- After Installation command line is done, please run SQL Query below:
INSERT INTO `core_config_data` (`config_id`, `scope`, `scope_id`, `path`, `value`, `updated_at`) VALUES (NULL, 'default', '0', 'web/secure/base_static_url', 'https://site.local/magento-2.4.5/pub/static/', current_timestamp()), (NULL, 'default', '0', 'web/unsecure/base_static_url', 'https://site.local/magento-2.4.5/pub/static/', current_timestamp());
INSERT INTO `core_config_data` (`config_id`, `scope`, `scope_id`, `path`, `value`, `updated_at`) VALUES (NULL, 'default', '0', 'web/secure/base_media_url', 'https://site.local/magento-2.4.5/pub/media/', current_timestamp()), (NULL, 'default', '0', 'web/unsecure/base_media_url', 'https://site.local/magento-2.4.5/pub/media/', current_timestamp());
- Move index.php, cron.php, get.php, static.php and .htaccess from /pub/ to the root web (magento-2.4.5)
- Change index.php at line 12
require __DIR__ . '/../app/bootstrap.php';
to
require __DIR__ . '/app/bootstrap.php';