Can't acces localhost/moodle/index.php

Can't acces localhost/moodle/index.php

by Alex Vasi -
Number of replies: 1

Hello,

I am using Ubuntu 20.04 and I have installed moodle, I made the configuration file "config.php" with all setting but When I try to acces http://localhost/moodle I am automatically redirected to http://localhost/moodle/install.php.

This is config.php :

<?php  // Moodle configuration file

unset($CFG);
global $CFG;
$CFG = new stdClass();

$CFG->dbtype    = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost    = 'localhost';
$CFG->dbname    = 'moodle';
$CFG->dbuser    = 'moodle';
$CFG->dbpass    = 'Moodle21!';
$CFG->prefix    = 'mdl_';
$CFG->dboptions = array (
  'dbpersist' => 0,
  'dbport' => '',
  'dbsocket' => '',
  'dbcollation' => 'utf8mb4_unicode_ci',
);

$CFG->wwwroot   = 'http://localhost/moodle';
$CFG->dataroot  = '/var/www/moodledata';
$CFG->admin     = 'admin';

$CFG->directorypermissions = 0777;

require_once(__DIR__ . '/lib/setup.php');

// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!

Thank you

Average of ratings: -
In reply to Alex Vasi

Re: Can't acces localhost/moodle/index.php

by Nic Appleby -
Are you certain your config.php file is in the correct location? It should be alongside index.php and config-dist.php in the webroot.

Also make sure it is readable by your webserver user.