cancel
Showing results for 
Search instead for 
Did you mean: 

Windows 10 local Setup dev.magento.com getting 404 error

Windows 10 local Setup dev.magento.com getting 404 error

Trying to install Magento in Windows local ( windows 10), intention is to check how to integrate. Followed the following guide and installed Magento

https://www.youtube.com/watch?v=gqhaumVfSUI

 

Basically installed XAMP and got it running - Apache,MySql running. Installed Elastic Search ( localhost service of elastic host is running), installed Magento using composer and followed steps to tweak some files as below

Enable extension in php.ini
extension=gd
extension=intl
extension=mbstring
extension=php_soap.dll
extension=php_xsl.dll
extension=php_sockets.dll

 

Update this value in php.ini file
max_execution_time=18000
max_input_time=1800
memory_limit=4G

 

Change Database Password
mysqladmin.exe -u root password admin
E:\xampp\phpMyAdmin\config.inc.php
7) Run below command in folder where Magento install.
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.5 ./
8) Run Elastic search, Xampp apache and mysql:
php bin/magento setup:install --base-url="http://dev.magento.com/" --db-host="localhost" --db-name="magento2" --
db-user="root" --db-password="programingAdd" --admin-firstname="admin" --admin-lastname="admin" --admin-e
mail="user@example.com" --admin-user="admin" --admin-password="admin@12345" --language="en_US" --curre
ncy="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin" --search-engine=elas
ticsearch7 --elasticsearch-host="localhost" --elasticsearch-port=9200

 

Go to: E:\xampp\htdocs\magento\vendor\magento\framework\View\Element\Template\File\ Validator.php
$realPath = $this->fileDriver->getRealPath($path);
Replace with this code:
$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
10) Add entry in host files:
E:\xampp8.1\apache\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "E:/xampp/htdocs/magento/pub"
ServerName dev.magento.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "E:/xampp/htdocs"
ServerName localhost
</VirtualHost>
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 dev.magento.com
11) Run Magento Install Command:
php bin/magento setup:install --base-url="http://dev.magento.com/" --db-host="localhost" --db-name="magento2" --
db-user="root" --db-password="test" --admin-firstname="admin" --admin-lastname="admin" --admin-email="test@
gmail.com" --admin-user="admin" --admin-password="admin12345" --language="en_US" --currency="USD" --tim
ezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin" --search-engine=elasticsearch7 --elasti
csearch-host="localhost" --elasticsearch-port=9200

 

Replace Line In app/etc/di.xml
Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink
TO:
Magento\Framework\App\View\Asset\MaterializationStrategy\Copy
13) Run Magento Commands:
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:flush
14) Disable extension:
php bin/magento module:disable Magento_TwoFactorAuth

 

 

All steps ran successfully , now i have Apache and Mysql running and also the Magento db.

 

I followed some posts and not sure where to change.

 

Following is the content of . .htaccess file in Magento root

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/pub/
RewriteCond %{REQUEST_URI} !^/setup/
RewriteCond %{REQUEST_URI} !^/update/
RewriteCond %{REQUEST_URI} !^/dev/
RewriteRule .* /pub/$0 [L]
DirectoryIndex index.php

Following is the content in apache\conf\extra\httpd-vhosts.conf

<VirtualHost *:80>
DocumentRoot "C:/sw/Magento-Ins/htdocs/magento/pub/"
ServerName dev.magento.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/sw/Magento-Ins/htdocs"
ServerName localhost
</VirtualHost>

Following is the entry in Windows hosts file

127.0.0.1 dev.magento.com

When accessing http://dev.magento.com in a browser results in HTTP Error 404..

 

Also checked following

C:\sw\Magento-Ins\apache\bin>httpd.exe -t
Syntax OK

Please accept my apology if i posted in wrong forum and it is more of Apache related issue, but request you to please guide me..

 

Following is the screnshot of XAMPimage.png

 

 

 

Thanks.