I have installed Magento 2.2.4.

After installation, it was good, loading pages as expected.

But, when I setup:di:compile, it gives blank page on frontend and admin as well.

Once I delete generated folder and load page, it will again ok, and no blank page.

I checked it on Ubuntu, it works fine.

  • any error while run setup:di:compile or run successfully? Commented May 7, 2018 at 5:01
  • Have you check magento log files? Commented May 7, 2018 at 5:11
  • @Suresh Chikani: no error while running setup:di command
    – Guru
    Commented May 8, 2018 at 13:20
  • @Dhiren Vasoya: i see no error in logs, but i will share my log here
    – Guru
    Commented May 8, 2018 at 13:21
  • Sometimes this happens because symlinks are not allowed in template settings: Advanced > Developer > Template Settings > Allow Symlinks Commented Aug 16, 2018 at 5:08

5 Answers 5


I am also facing the same issue for me a temporary fix is force deploying developer mode (even if you are already on it or not) i.e. Executing the following command after di compile

 php bin/magento deploy:mode:set developer

It is a temporary / quick fix , i am still looking into issue will update answer if find the root cause

  • i am already in developer mode, but same issue in developer mode as well
    – Guru
    Commented May 8, 2018 at 13:22
  • 2
    what i am trying to say is after running compile command , again set mode to developer even though you are on it already Commented May 8, 2018 at 13:24
  • awesome! it works
    – l00k
    Commented Sep 28, 2018 at 20:44
  • 1
    What the hell... this worked for me Commented Jul 28, 2020 at 1:10

First Open “Validator.php” file located as the following path. vendor\magento\framework\View\Element\Template\File\Validator.php

find the function :

protected function isPathInDirectories($path, $directories)

Now inside this function find this line of code.

$realPath = $this->fileDriver->getRealPath($path);

And replace this line of code with the below code.

$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));

Now compile your Magento by using commands:

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:flush
  • This is really wonderful and works for me. Thank you very much to save my precious time. Commented Jan 23, 2021 at 4:42

I have fixed same issue on my Windows 10 system using below steps

1) increase memory_limit = 3000M

2) new fresh installation Magento 2.1.8 with wamp server php v 7.0.32

Now admin and front both working fine, please let me know if its work for you.


Windows 10 Env Run deploy and compilation

As per discussion, you are already in developer mode.

  • Try to install git bash or you can use powershell
    My choice is git bash.

  • Go to Magento Root directory.
    Need to give permission when you run:
    php bin/magento setup:di:compile
    Try to give permission on,
    chmod 777 -R generated/ var/ pub/static

  • Even you have to give permission after
    php bin/magento cache:flush

  • 1
    done but the issue is still the same i.e., fresh Magento 2.2.4 after di:compile shows blank white screen on the frontend and "not redirecting properly" on the backend. Commented Jun 8, 2018 at 2:40
  • Please check mod_rewrite is enable or not. if not enable it and try again. Commented Dec 3, 2018 at 4:09

Please run following command :

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy -f

php bin/magento cache:clean

php bin/magento cache:flush

Not the answer you're looking for? Browse other questions tagged or ask your own question.