1

As my question states, I have installed magento 2.4.7-beta1 on xampp 8.2.12 in windows 11 with composer 2.6.5 and elasticesearch 7.16.3 freshly. However any images on frontend and magento admin panel on the backend are not being displayed and I'm receiving static blank pages instead.

Images not being loaded on frontend

Absolute grey blank page in admin panel url

I've had tried the following solutions like this & this and yet it is to no avail. Please advice.

2 Answers 2

0

from magento root, run the following command from CLI.

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
sudo chmod -R 777 var/ generated/ pub/
1
  • Please do tell me if I'm wrong but how do I run "sudo" & "chmod" commands on a windows CLI? As for the rest of the commands I've already ran them several times now and also I'm running magento locally and the pub folder has full access control granted to all users on the machine.
    – Azerael
    Dec 6, 2023 at 15:32
0

if you install magento windows system then change below file.

Step 1 : go to vendor\magento\framework\Image\Adapter\Gd2.php

find code function => validateURLScheme

if ($url && isset($url['scheme']) && !in_array($url['scheme'], $allowed_schemes)) {
        return false;
    }

to

 if ($url && isset($url['scheme']) && strlen($url['scheme']) > 1 && !in_array($url['scheme'], $allowed_schemes)) {
    return false;
    }

Step 2 : go to magento directory vendor/magento/framework/View/Element/Template/File/Validator.php

find function => isPathInDirectories

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

to

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

After apply below commands.

 php bin/magento s:up
 php bin/magento setup:di:compile
 php bin/magento s:static-content:de -f 
 php bin/magento c:f
6
  • Thank you for your help however I had already made those changes in the validator & gd2 files during magento setup and also had ran those commands afterwards from my magento root folder with my CLI and I double checked the functions as stated and ran the commands again but it still didn't change a thing i.e., this the same static page on frontend & grey blank page on backend in place admin panel. Any thoughts?
    – Azerael
    Dec 6, 2023 at 15:12
  • please delete folders pub/static/frontend and pub/static/adminhtml and pub/static/deployed-version.text and reminder don't delete .htaccess file. after apply commands. php bin/magento s:up php bin/magento setup:di:compile php bin/magento s:static-content:de -f php bin/magento c:f php bin/magento indexer:reindex Dec 7, 2023 at 10:26
  • I deleted the frontend & adminhtml folders with the deployed-version.txt as mentioned without deleting the htaccess file and ran the commands on root CLI and still no improvement. Still the same static pages on browser.
    – Azerael
    Dec 7, 2023 at 12:15
  • hello dear, magento var/log directory shows .log file. so please check it. tell me. Dec 8, 2023 at 4:50
  • Thank you very much for your help again but since I wasn't getting much solution on my problem so I reverted back to 2.4.6-p1 and that solved the issue. I think there's some internal error in one of the config files of 2.4.7 update which may have caused the problem. But still thank you for your time.
    – Azerael
    Dec 8, 2023 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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