cancel
Showing results for 
Search instead for 
Did you mean: 

I have installed Magento 2.4.1 succesfully but my browser shows plain text

I have installed Magento 2.4.1 succesfully but my browser shows plain text

I hope anyone can help me. I had so much trouble installing it...and now this. Please HELP!

<?php
/**
 * Application entry point
 *
 * Example - run a particular store or website:
 * --------------------------------------------
 * require __DIR__ . '/app/bootstrap.php';
 * $params = $_SERVER;
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website2';
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
 * $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
 * \/** @var \Magento\Framework\App\Http $app *\/
 * $app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
 * $bootstrap->run($app);
 * --------------------------------------------
 *
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

try {
    require __DIR__ . '/app/bootstrap.php';
} catch (\Exception $e) {
    echo <<<HTML
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
    <div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;">
        <h3 style="margin:0;font-size:1.7em;font-weight:normal;text-transform:none;text-align:left;color:#2f2f2f;">
        Autoload error</h3>
    </div>
    <p>{$e->getMessage()}</p>
</div>
HTML;
    exit(1);
}

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);
2 REPLIES 2

Re: I have installed Magento 2.4.1 succesfully but my browser shows plain text

Hello @andreeafet0bd5 

 

You must have only downloaded magento project, you can install via command line by following help :

https://devdocs.magento.com/guides/v2.4/install-gde/composer.html

 

Make sure you have a running elasticsearch if you are using Magento 2.4.x.

 

Hope it helps !

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: I have installed Magento 2.4.1 succesfully but my browser shows plain text

Hi Gaurav, I solved it.

 

I had this problem after Magento installation was complete, not just the download.

 

The problem was Apache was not reading php. It worked after editing the http.config file by adding the following line. 

 

AddType application/x-httpd-php .php

 

Thanks.