cancel
Showing results for 
Search instead for 
Did you mean: 

Error 404 after installing magento

Error 404 after installing magento

I installed magento with the composer and followed the requisites. I using mac and i used brew to install mysql , php and apache in the end when i did  this:

bin/magento setup:install \
--base-url=http://localhost/magento-now \
--db-host=localhost \
--db-name=magento4 \
--db-user=root \
--db-password=my password \
--admin-firstname=admin \
--admin-lastname=admin \
--admin-email=admin@admin.com \
--admin-user=admin \
--admin-password=admin123 \
--language=en_US \
--currency=USD \
--timezone=America/Chicago \
--use-rewrites=1


 

the message was sucessfull :

[SUCCESS]: Magento installation complete.

[SUCCESS]: Magento Admin URI: /admin_1fs0k4

Nothing to import.

 

but when i go to browser and type localhost/magento-now  it gives me 404

Not Found

The requested URL was not found on this server.

 

This is my log file from the var/log folder 

[2021-06-04 10:10:24] main.DEBUG: cache_invalidate: {"method":"GET","url":"http:/","invalidateInfo":{"tags":["FPC"],"mode":"matchingTag"}} []
[2021-06-04 10:10:24] main.DEBUG: cache_invalidate: {"method":"GET","url":"http:/","invalidateInfo":{"tags":["WEBSERVICE"],"mode":"matchingTag"}} []
[2021-06-04 10:10:24] main.DEBUG: cache_invalidate: {"method":"GET","url":"http:/","invalidateInfo":{"tags":["TRANSLATE"],"mode":"matchingTag"}} []
[2021-06-04 10:10:24] main.DEBUG: cache_invalidate: {"method":"GET","url":"http:/","invalidateInfo":{"tags":["VERTEX"],"mode":"matchingTag"}} []
 
it was more but i just pasted this ones to dont ocupy much space
 
And this is my .htaccess file 
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
5 REPLIES 5

Re: Error 404 after installing magento

Hi @franciscofdc60 

 

Did you configure your domain name in the host file?

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: Error 404 after installing magento

like in the file from the apache where was User _www and group _www?  if you are talking about that i didnt changed that i just changed the Listen from 8080 to 80 because when i did that change i could restart httpd and it was stoped in the brew services list.

I dont now if it helps but i have some new logs to show from the var/log folder

2021-06-04 14:16:54] main.CRITICAL: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) {"exception":"[object] (Zend_Db_Adapter_Exception(code: 1045): SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) at /Users/skreysoftware/Desktop/magento241/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:144, PDOException(code: 1045): SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) at /Users/skreysoftware/Desktop/magento241/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128)"} []
 
this appear in the debug.log file
 
in the expetion.log it appears a similar message
like the system.log 
[2021-06-04 14:16:54] main.ERROR: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) [] []
 
maybe i need to change something in my mysql_secure_installation?

Re: Error 404 after installing magento

setup:install --base-url=http://127.0.0.1/magento421/ \

--db-host=localhost --db-name=magento421 --db-user=root --db-password=89123456 \

--admin-firstname=magento --admin-lastname=User --admin-email=user@example.com \

--admin-user=admin --admin-password=admin123 --language=en_US \

--currency=USD --timezone=America/Chicago --use-rewrites=1 \

--search-engine=elasticsearch7 --elasticsearch-host=localhost \

--elasticsearch-port=9200

 

thats that way i made it and in the url i put localhost/magento421 or 127.0.0.1/magento421 and its always 404 error.

I tried using Mamp but when i go to the setup window the orange button to accept or cotinue doesnt appear so i cant do the setup

Re: Error 404 after installing magento

Please try Below steps

  1. Delete var/cache folder
  2. Go to database SELECT * FROM core_config_data WHERE path = 'web/seo/use_rewrites' and make it 0
  3. Then enter url in your browser magento_base_url/index.php/your_admin_url

try and let me know if you face any issue.

 

Check the documentation install Magento 

Re: Error 404 after installing magento

Hi,

The reason that you may run into a 404 not found error after a fresh install of Magento 2.4. 2 is due to a change starting from Magento 2.4. 2, which requires you to set the webroot to /pub/ for better security.

Thanks and Best Regards:

Windows Club