skip to Main Content

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)

Blank admin

4

Answers


  1. 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.

    Login or Signup to reply.
  2. Hope no need of any code change. You already done installation successfully right.?
    Please check below things are proper in your side.

    • check rewrite a2enmod is enabled or not.
    • Try to re run your deployment command again and give necessary permissions. for your local you can have full permissions for var/,generate/,app/etc/,pub/static (remember to remove app/etc full permission when you going live)
    • Note for magento2.3 you need php7.2 support

    Hope this will help you out

    Login or Signup to reply.
    1. …vendormagentoframeworkViewElementTemplateFileValidator.php
    2. 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.

    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search