Joseph Anderson
Joseph Anderson

Reputation: 4144

Magento 2 Blank Admin New Install

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

Upvotes: 0

Views: 1321

Answers (4)

J.FU
J.FU

Reputation: 1

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

Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink

and replace with

Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

Have a try.

Upvotes: 0

Dinush Chathurya
Dinush Chathurya

Reputation: 512

  1. ...\vendor\magento\framework\View\Element\Template\File\Validator.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.

Upvotes: 0

N.ameen
N.ameen

Reputation: 281

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

Upvotes: 1

Avadh Patel
Avadh Patel

Reputation: 36

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.

Upvotes: 1

Related Questions