Fresh Install Pimcore5 won't run


I just installed the Pimcore5 stable build.
However, when I go to the website (htttp://, it returns a php file to me.
Why does this happen, and how can I solve it?

Thank you

 * Pimcore
 * This source file is available under two different licenses:
 * - GNU General Public License version 3 (GPLv3)
 * - Pimcore Enterprise License (PEL)
 * Full copyright and license information is available in
 * which is distributed with this source code.
 * @copyright  Copyright (c) Pimcore GmbH (
 * @license     GPLv3 and PEL

use Pimcore\Tool;
use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

if (!defined('PIMCORE_PROJECT_ROOT')) {
            ?: getenv('REDIRECT_PIMCORE_PROJECT_ROOT')
            ?: realpath(__DIR__ . '/..')

require_once PIMCORE_PROJECT_ROOT . '/pimcore/config/bootstrap.php';

$request = Request::createFromGlobals();

// set current request as property on tool as there's no
// request stack available yet

// redirect to installer if pimcore is not installed
if (!is_file(\Pimcore\Config::locateConfigFile('system.php'))) {
    if (file_exists(__DIR__ . '/install.php')) {
        (new RedirectResponse('/install', Response::HTTP_FOUND))->send();

    Debug::enable(E_ALL, true);
    throw new RuntimeException('Pimcore is not installed and the installer is not available. Please add the installer or install via command line.');

/** @var \Pimcore\Kernel $kernel */
$kernel = require_once PIMCORE_PROJECT_ROOT . '/pimcore/config/kernel.php';

// reset current request - will be read from request stack from now on

$response = $kernel->handle($request);

$kernel->terminate($request, $response);


Probably because of not full configuration of your web server (apache/nginx)

What I would recommend is that at start you can check your web server configuration

If you still won’t be able to fix your problem please let us know is it apache or nginx.