I use Windows 10. I am trying to install Magento 2 using XAMPP. My admin screen is blank and I get these errors:
Refused to apply style from ” because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from ‘http://localhost/Magento2/pub/static/version1559567140/adminhtml/Magento/backend/en_US/jquery/jstree/themes/default/style.css‘ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from ‘http://localhost/Magento2/pub/static/version1559567140/adminhtml/Magento/backend/en_US/extjs/resources/css/ext-all.css‘ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from ‘http://localhost/Magento2/pub/static/version1559567140/adminhtml/Magento/backend/en_US/extjs/resources/css/ytheme-magento.css‘ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from ‘http://localhost/Magento2/pub/static/version1559567140/adminhtml/Magento/backend/en_US/extjs/resources/css/ext-all.css‘ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from ‘http://localhost/Magento2/pub/static/version1559567140/adminhtml/Magento/backend/en_US/jquery/jstree/themes/default/style.css‘ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from ‘http://localhost/Magento2/pub/static/version1559567140/adminhtml/Magento/backend/en_US/extjs/resources/css/ytheme-magento.css‘ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
require.js:1 Failed to load resource: net::ERR_CONNECTION_RESET
mixins.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
requirejs-config.js:536 Uncaught ReferenceError: require is not defined
at requirejs-config.js:536
opensans-400.woff2:1 Failed to load resource: the server responded with a status of 404 (Not Found)
opensans-400.woff:1 Failed to load resource: the server responded with a status of 404 (Not Found)
4
Answers
Step 1: If you use windows machine Please change the path on this location “vendor/magento/framework/view/element/template/file/validator.php”
From
$realPath = $this->fileDriver->getRealPath($path);
To
$realPath = str_replace(”, ‘/’, $this->fileDriver->getRealPath($path));
Step 2: Check Your root .htaccess
Remove IfVersion
Step 3: Remove IfVersion from pub/.htaccess and pub/Static/.htaccess
Hope working as per acceptation. If you face any problem Please tell me.
Hope no need of any code change. You already done installation successfully right.?
Please check below things are proper in your side.
Hope this will help you out
In function isPathInDirectories added a line
$realPath = str_replace(”, ‘/’, $realPath);
$realPath = $this->fileDriver->getRealPath($path);
$realPath = str_replace('\', '/', $realPath); // This is the code you extra added.
1 first check your deploy model and set developer
php bin/magento deploy:mode:show
php bin/magento deploy:mode:set developer
2 open file
/vendor/magento/framework/View/Element/Template/File/Validator.php
in magento install dir , find
$realPath = $this->fileDriver->getRealPath($path);
replace with :
$realPath = str_replace(”, ‘/’, $this->fileDriver->getRealPath($path));
open file
app/etc/di.xml
in magento install dir, find
MagentoFrameworkAppViewAssetMaterializationStrategySymlink
and replace with
MagentoFrameworkAppViewAssetMaterializationStrategyCopy
Have a try.