2

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.

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

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

4
  • i am already in developer mode, but same issue in developer mode as well
    – Guru
    May 8 '18 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 May 8 '18 at 13:24
  • awesome! it works
    – l00k
    Sep 28 '18 at 20:44
  • 1
    What the hell... this worked for me Jul 28 '20 at 1:10
4

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
1
  • This is really wonderful and works for me. Thank you very much to save my precious time. Jan 23 at 4:42
2

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.

-1

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

2
  • 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. Jun 8 '18 at 2:40
  • Please check mod_rewrite is enable or not. if not enable it and try again. Dec 3 '18 at 4:09
-1

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.