Showing results for 
Search instead for 
Did you mean: 

Magento 2.4 Blank page for store or admin pages after installation

Magento 2.4 Blank page for store or admin pages after installation

This is my first time setting up a Magento2 server, I've followed the guide from the official website.

I am using PHP 7.47, mysql, apache, all on the same host.

I pulled the repo to /var/www/html where it puts itself into /var/www/html/magento2

I then run "composer install" within /var/www/html/magento2, which does its thing without error.

Then I run the magento install using bin/magento, cinehub which does its thing without error once again.

Since I just want to test for now, I've set the base url as

According to every guide I've found, after that, I should only have to go to and see the store, but I get a blank page instead. The default apache page on works just fine, tested both locally and remotely with another computer on the lan, and on both returns a blank page.

The PHP memory is set to 2G, I've done every little recommendation from the official guide. Since this was for a test run, I am running the webserver as root, so it shouldn't be getting file permission issues (it passes the file permission check on the install).

The webserver installation seems to be fine, if I modify the index.php to do an echo test, that works fine, that means the issues seems to be within the running of the application within the index.php and further down the line but I am not getting any errors out of it. That means it doesn't trigger the try/catch (which would output something) and then crashes later on.

Any help would be greatly appreciated, thank you for your time.

Edit: So ultimately the error is HTTP Error 500.

I've tried with nginx, same issue. I've tried with PHP7.3, same issue. I've tried every remedy I've found about folder permission but to no avail. Because I have the same issue with both nginx and apache I am led to believe it's not in my webserver configuration. MySql configuration seems to be no trouble, it's set on a different host for now.

Just to be sure it isn't something dumb, this is the steps I take from a fresh install:

As root:

Install Apache, SSL and security modules, configure httpd.conf as mentioned in the guide

Install PHP 7.4 and all the modules required as per the guide, modify memory and time zone in php.ini and save comments in opcache.ini

Install elasticsearch

Download and move composer

Create magento user, give it www-data(apache for centos8) roles. chown -R on /var/www/html to magento:apache

Do the file permission routine thing from the guide.

Switch to mangeto user

Pull the git repo into /var/www/html/magento2

Run composer install in magento2

Run bin/magento install... commandline from the guide (edited to my stuff).

At that point it says to validate install, so I check localhost/magento2 and that's where I get http 500 error.

chown -R on /var/www/html/magento2 just in case.

While nginx was a bit more fiddly to install it seems to get further than http error 500. Instead I get a fatal error accessing page cache due to zend, (even though it has full rights there).

Presently I am installing with centos 8, should I use centos 7? Most guides seem to refer to centos 7.


Re: Magento 2.4 Blank page for store or admin pages after installation

Hello @dramacoolt9e73 


First echo and exit code in index.php on docroot, check if working till there, i working, then give permission as per the Magento requirement from below :

cd <your Magento install dir> 

// 644 permission for files
find . -type f -exec chmod 644 {} \; 
// 755 permission for directory
find . -type d -exec chmod 755 {} \;    
// 777 permission for var folder
find ./var -type d -exec chmod 777 {} \;                    

find ./pub/media -type d -exec chmod 777 {} \;

find ./pub/static -type d -exec chmod 777 {} \;

chmod 777 ./app/etc

chmod 644 ./app/etc/*.xml

after this, run below command :

php bin/magento deploy:mode:set developer
php bin/magento cache:flush

then hit the URL, if still getting 500, check log files inside var/log.


Let us know if it works !

Problem Solved ? Click on 'Kudos' & Accept as Solution to encourage to write more answers !

Re: Magento 2.4 Blank page for store or admin pages after installation

@dramacoolt9e73 ,

if you have cloned from the Magento GIT repo then you need to run from the PUB folder. 

you can check there is no index.php in the root folder of magento2. 

so Magento will not run from the root folder & from now on you need to point to the pub folder. 


try running


you also need to update the URL

php bin/magento setup:store-config:set --base-url=""
php bin/magento setup:store-config:set --base-url-secure=""

php bin/magento cache:flush


kindly Accept as a Solution if this works for you and give Kudos Smiley Happy 


Re: Magento 2.4 Blank page for store or admin pages after installation

I got similar result as @dramacoolt9e73, one thing different is webserver. Apache 2 is used in my deployment. Both store front page and admin page are blank.


Here is the information I found in /var/log/apache2/error.log.

[Sun Feb 07 08:32:48.874268 2021] [mpm_prefork:notice] [pid 981] AH00163: Apache/2.4.41 (Ubuntu) configured -- resuming normal operations

[Sun Feb 07 08:32:48.934525 2021] [core:notice] [pid 981] AH00094: Command line: '/usr/sbin/apache2'

[Sun Feb 07 08:54:21.106116 2021] [php7:error] [pid 1093] [client] PHP Fatal error: Uncaught ReflectionException: Class Magento\\Framework\\App\\ResourceConnection\\Proxy does not exist in /var/www/html/unifield/vendor/magento/framework/Code/Reader/ClassReader.php:24\nStack trace:\n#0 /var/www/html/unifield/vendor/magento/framework/Code/Reader/ClassReader.php(24): ReflectionClass->__construct()\n#1 /var/www/html/unifield/vendor/magento/framework/ObjectManager/Definition/Runtime.php(54): Magento\\Framework\\Code\\Reader\\ClassReader->getConstructor()\n#2 /var/www/html/unifield/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(48): Magento\\Framework\\ObjectManager\\Definition\\Runtime->getParameters()\n#3 /var/www/html/unifield/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\\Framework\\ObjectManager\\Factory\\Dynamic\\Developer->create()\n#4 /var/www/html/unifield/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(170): Magento\\Framework\\ObjectManager\\ObjectManager->get()\n#5 /var/www/html/unifield/vendor/magento/framework/ObjectManager/Factory/AbstractFactor in /var/www/html/unifield/vendor/magento/framework/Code/Reader/ClassReader.php on line 24


Please advise any further action I can do to solve this issue.



Re: Magento 2.4 Blank page for store or admin pages after installation

It worked for me. The store works normally under the pub folder. But why is that and how can I make it work under the root folder?