Magento2 – Blank Admin Page After Install with No Errors

adminblankmagento2pagewhite-screen

I am attempting to install a Magento 2.4.1 solution that it's already in production. I've previously installed other Magento solutions that were similar and had no issues. In this case, the install process goes without errors, but as soon as I try going to localhost/admin I get a completely white page, no errors or anything useful and the URL which should redirect to the admin page does not change. URL Rewrites are enabled. The apache logs as well as Magento's logs display no errors, enabling ini_set('display_errors', 1); in bootstrap.php does nothing either. I've already done the necessary changes to Magento's code because I am running it on XAMPP, Windows. To install I followed this guide. So the proper changes were done in Gd2.php, Validator.php and PluginListGenerator.php files. The PHP version is correct, I'm using 7.3 and as I mentioned above, URL rewrites are enabled. Also, the cache was cleared and flushed, the .htaccess file is in place, I've used the one in /pub folder and also got fed up searching the internet for this. What could be causing it?

enter image description here

Best Answer

Ok, I figured it out eventually. Turns out the issue was due to the env.php file. The --backend-frontname was actually causing the issue. I had this as Admin instead of admin, so this should have been all lower-case. So to fix it, I went and opened {my-magento-folder}\app\etc\env.php and adjusted the file like this.

This chunk of code

'backend' => [
    'frontName' => 'Admin'
]

I've changed it to this

'backend' => [
    'frontName' => 'admin'
]

After saving the file and reloading the page the issue was solved. If someone can leave a comment and explain why the casing is important here, please do. Hopefully this helps someone in need. Good luck!

Related Topic