3

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.

Teja Bhagavan Kollepara
  • 3,816
  • 5
  • 32
  • 69
Guru
  • 495
  • 1
  • 6
  • 25

5 Answers5

9

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

Anas Mansuri
  • 2,627
  • 1
  • 11
  • 28
Vishwas Bhatnagar
  • 4,679
  • 3
  • 38
  • 60
5

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
Sushant Vishwas
  • 119
  • 1
  • 6
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.

anonymous
  • 3,722
  • 3
  • 25
  • 67
0

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

krzysiej
  • 103
  • 4
MR.R DNATH
  • 462
  • 2
  • 10
-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

Chirag Gondaliya
  • 1,324
  • 7
  • 20