I followed this instructions "How to install Magento 2.4 on Localhost (Xampp) with Elasticsearch" to install Magento 2.4.1 on XAMPP 7.4.13.
I have installed XAMPP, composer, elasticsearch successfully.
The differencies were only:
1. I have set xampp to use post 8080.
2. I have used 127.0.0.1 instead of localhost in php setup:install (but tried it with localhost as well - same errors)
php bin/magento setup:install --base-url="http://127.0.0.1/luma/" .....
Successfully did indexer:reindex, setup:upgrade, setup:static-content:deploy -f, cache:clean, cache:flush
But when I try to access home page I get errors (in console of inspector in Chrome) as following and I cannot access admin page as well (404).
[Report Only] Refused to load the stylesheet '<URL>' because it violates the following Content Security Policy directive: "style-src getfirebug.com cdn.dnky.co webchat.dotdigital.com yotpo.com <URL> p.yotpo.com staticw2.yotpo.com w2.yotpo.com 'self' 'unsafe-inline'". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.
screenshot: here
I suppose it is something stupid I have missed, but i am not able to find any solution or idea where to move.
Solved! Go to Solution.
The problem was in redirection of xampp port from 80 to 8080, and my inability to properly configure magento/.htaccess to respect this change.
I found a solution in stopping services using port 80 on Windows 10 by cmd command
net stop was /y
and disambling World Wide Web Publishing Service in services.
Then I could set the XAMPP back to port 80, and all works as expected.
More info : How to Solve Port 80 Problems When Running Apache on Windows
The problem was in redirection of xampp port from 80 to 8080, and my inability to properly configure magento/.htaccess to respect this change.
I found a solution in stopping services using port 80 on Windows 10 by cmd command
net stop was /y
and disambling World Wide Web Publishing Service in services.
Then I could set the XAMPP back to port 80, and all works as expected.
More info : How to Solve Port 80 Problems When Running Apache on Windows