cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 Installation cannot access admin URL, CSS missing

Magento 2 Installation cannot access admin URL, CSS missing

I need some help with my Magento 2 installation. I have been working on Magento for many years but this is my first installation alone and I only worked with Magento 1. I have installed Magento 2.3.4 with a manual installation and all seemed fine. After installation I cannot access the admin link (404) and the frontend is missing the CSS. 

 

Server:

Apache/2.4.39

 

I have been stuck on this for days and tried many solutions posted in the forum but so far no luck. 

 

This was the last solution I tried but still no change:

Find : /vendor/magento/framework/View/Element/Template/File/Validator.php:139find :

 

foreach ($directories as $directory) {

        if (0 === strpos($realPath, $directory)) {

             return true;

        }

}

 

Replace with:

 

foreach ($directories as $directory) { $realDirectory = $this->fileDriver->getRealPath($directory);

        // and replace `$directory` with `$realDirectory`

        if (0 === strpos($realPath, $realDirectory)) {

              return true;

        }

}

 

I have just done a fresh installation again and haven't changed anything yet, any idea as to what I can do to access my backend? Please help Smiley Sad

 

PS: One solution got the frontend back to normal but I still cant access the backend

2 REPLIES 2

Re: Magento 2 Installation cannot access admin URL, CSS missing

Hello @CB 

 

Please run the below commands:

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
php bin/magento cache:clean

I hope it helps.

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

Re: Magento 2 Installation cannot access admin URL, CSS missing

 

Hello @CB,

You should check apache whether you turn on mod_rewrite.

If not yet -> turn it on.

If you did it, next check whether there is a file .htaccess in the root folder.