I’m very confusing what’s the matter?
I use :
xampp3.3
php 8.2
magento 2.4.6
elasticsearch 8.8.1
I did all the others said in forums and other questions in stackoverflow or magento stackexchange. but my problem didn’t resolve.
what I did:
- setting in the database core_config_data table:
INSERT INTO core_config_data (path, value) VALUES (‘dev/static/sign’,0) ON DUPLICATE KEY UPDATE value = 0;
and set ‘web/seo/use_rewrites’ to 0 due to an answer in forums.
- remove folders in ‘pubstatic’ and ‘var’.
- change owner and give permissions:
takeown /f . /r
this commands one by one:
icacls .pub /grant Everyone:F /t
icacls .var /grant Everyone:F /t
icacls .appetc /grant Everyone:F /t
- on httpd.conf the line below is active: LoadModule rewrite_module modules/mod_rewrite.so
- add this section to httpd.conf:
<Directory "C:xampphtdocsmagento2"> Options Indexes
SymLinksifOwnerMatch MultiViews AllowOverride All Require all granted
and
timeout 300
-
in di.xml, change developerMaterialization value from symLink to Copy.
-
run this commands one by one
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:flush -
delete cache folder under var and even clean cashe by:
php binmagento cache:clean
php binmagento cache:flush
I use localhost, and also use 127.0.0.1 in store url and admin url.
magento2 is loaded but without any css. and the admin panel not loaded at all (404 error).
I test on developer and also production mode.
my installation command for magento 2.4.6 is :
php bin/magento setup:install --base-url=http://localhost/magento2/ --db-host=localhost --db-name=magento --db-user=root --db-password=root --admin-firstname=E --admin-lastname=R [email protected] --admin-user=admin --admin-password=admin123 --language=en_US --use-rewrites=1 --search-engine=elasticsearch8 --use-sample-data --cleanup-database
I spent much time but without any success.
2
Answers
There are many reason for this, first at all, you need to open the 404 link in browser to see the actual issue, sometime It’s the issue with permission (need to check the Apache/Nginx log)
Second, reason likely to happen because files did not generate properly, for this case, you need to enable the
developer
modeSee here: https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-mode.html#change-to-developer-mode
Then run command
bin/magento setup:upgrade
Hope this work for you.
Some of you might getting css and js loading issue.
INSERT INTO core_config_data (path, value) VALUES (‘dev/static/sign’,0) ON DUPLICATE KEY UPDATE value = 0;
and set ‘web/seo/use_rewrites’ to 0 due to an answer in forums.
php bin/magento indexer:reindex && php bin/magento se:up && php bin/magento se:s:d -f && php bin/magento c:f