cancel
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, which does its thing without error once again.

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

According to every guide I've found, after that, I should only have to go to 127.0.0.1/magento2 and see the store, but I get a blank page instead. The default apache page on 127.0.0.1 works just fine, tested both locally and remotely with another computer on the lan, and on both 127.0.0.1/magento2 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.

2 REPLIES 2

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 http://127.0.0.1/magento2/pub/

 

you also need to update the URL

php bin/magento setup:store-config:set --base-url="http://127.0.0.1/magento2/pub/"
php bin/magento setup:store-config:set --base-url-secure="http://127.0.0.1/magento2/pub/"

php bin/magento cache:flush

 

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