Urgent! accidentally checked HTTPS and now can't access the Moodle

Urgent! accidentally checked HTTPS and now can't access the Moodle

by Narit B -
Number of replies: 4

Urgent! accidentally  to checked HTTPS and now can't access the Moodle.

Please everyone help me how to fix this problem.


Thank you

Average of ratings: -
In reply to Narit B

Re: Urgent! accidentally checked HTTPS and now can't access the Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

In your config.php add the line....

$CFG->loginhhtps = false;
Average of ratings: Useful (4)
In reply to Howard Miller

Re: Urgent! accidentally checked HTTPS and now can't access the Moodle

by Narit B -

Hi Howard Miller

Thank you for your reply but  I'm a new for moodle. please see the code as below 

Where should i add the new line?


<?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    = 'root';

$CFG->dbpass    = '******';

$CFG->prefix    = 'mdl_';

$CFG->dboptions = array (

  'dbpersist' => 0,

  'dbport' => '',

  'dbsocket' => '',

  'dbcollation' => 'utf8_bin',

);


$CFG->wwwroot   = 'http://*****/moodle';

$CFG->dataroot  = '/*****/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

(Edited by Howard Miller - original submission Thursday, 15 February 2018, 11:43 AM)

In reply to Narit B

Re: Urgent! accidentally checked HTTPS and now can't access the Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Almost anywhere, but right after $CFG->directorypermissions = 0777; will do nicely. So you end up with.... 

<?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    = 'root';
$CFG->dbpass    = '*****';
$CFG->prefix    = 'mdl_';
$CFG->dboptions = array (
  'dbpersist' => 0,
  'dbport' => '',
  'dbsocket' => '',
  'dbcollation' => 'utf8_bin',
);
$CFG->wwwroot   = 'http://*****/moodle';
$CFG->dataroot  = '/****/moodledata';
$CFG->admin     = 'admin';
$CFG->directorypermissions = 0777;
$CFG->loginhttps = false;
require_once(__DIR__ . '/lib/setup.php');


BTW... don't post files with passwords in them. Or anything else that might be security sensitive wink


Average of ratings: Useful (1)
In reply to Howard Miller

Re: Urgent! accidentally checked HTTPS and now can't access the Moodle

by Narit B -

Hi  Howard Miller

Very big thanks for your help me and quickly responded to fixing my problem and also I will be aware about posting files with password.


Thank you once again.