Install problem - the success page does not appear, instead I see the index.php file

Hi everyone,
In the installation section it says that a successful installation will lead to a grav page in the localhost - so I reach it through the adress http://localhost/grav-admin/

I don’t get an error but I definitely don’t see the page that should be there. Instead I see the index.php file as text:


 * @package    Grav.Core
 * @copyright  Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
 * @license    MIT License; see LICENSE file for details.

namespace Grav;

\define('GRAV_REQUEST_TIME', microtime(true));
\define('GRAV_PHP_MIN', '7.1.3');

if (version_compare($ver = PHP_VERSION, $req = GRAV_PHP_MIN, '<')) {
die(sprintf('You are running PHP %s, but Grav needs at least <strong>PHP %s</strong> to run.', $ver, $req));

if (PHP_SAPI === 'cli-server' && !isset($_SERVER['PHP_CLI_ROUTER'])) {
die("PHP webserver requires a router to run Grav, please use: <pre>php -S {$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']} system/router.php</pre>");

// Set timezone to default, falls back to system if php.ini not set

// Set internal encoding.
if (!\extension_loaded('mbstring')) {
die("'mbstring' extension is not loaded.  This is required for Grav to run correctly");
@ini_set('default_charset', 'UTF-8');

// Ensure vendor libraries exist
$autoload = __DIR__ . '/vendor/autoload.php';
if (!is_file($autoload)) {
die('Please run: <i>bin/grav install</i>');

// Register the auto-loader.
$loader = require $autoload;

use Grav\Common\Grav;
use RocketTheme\Toolbox\Event\Event;

// Get the Grav instance
$grav = Grav::instance(
    'loader' => $loader

// Process the page
try {
} catch (\Error $e) {
$grav->fireEvent('onFatalException', new Event(array('exception' => $e)));
throw $e;
} catch (\Exception $e) {
$grav->fireEvent('onFatalException', new Event(array('exception' => $e)));
throw $e;

I would appreciate any help :slight_smile:
btw - this is the first time I use grav CMS
Thank you

Do you have php installed on your machine?

Try checking your setup against this - don’t worry about multiple php versions, or whether you have Catalina or not, the principles are the same:

This page was vrey helpful
Eventually the thing that solved the problem was trying to open manually the index.php file. When I tried to open it it asked me to install xcode tools (or something like that) - after installing it the page appeared correctly :slight_smile:

Good to know - once you’ve got it all set up once it’ll work flawlessly but you can hit some speedbumps the first time around. Could you mark this as solved? Cheers.