Installer does not read config.inc.php, then fails
ghoffart opened this issue · 0 comments
When upgrading from 1.0.15 to 1.2.1 in the last step of the installer (easy mode), the database connection failed always. But in the step before the connection worked, and MODx 1.0.15 and the manager itself worked with this database connection, too.
So with the help of my friend PoC I logged all MySQL requests, and found:
170521 20:48:48 507 Connect www-data@localhost on ConnectAccess denied for user 'www-data'@'localhost' (using password: NO)
But my database user is not named "www-data". Obviously my config.inc.php has been ignored. After some tracing, I found this in instprocessor.php
//if ($installMode == 1) {
// include "../".MGR_DIR."/includes/config.inc.php";
//} else {
// get db info from post
$database_server = $_POST['databasehost'];
$database_user = $_SESSION['databaseloginname'];
$database_password = $_SESSION['databaseloginpassword'];
$database_collation = $ POST['database_collation'];
$database_charset = substr($database_collation, 0, strpos($database_collation, ''));
$database_connection_charset = $_POST['database_connection_charset'];
$database_connection_method = $_POST['database_connection_method'];
$dbase = "" . $_POST['database_name'] . "
";
$table_prefix = $_POST['tableprefix'];
$adminname = $_POST['cmsadmin'];
$adminemail = $_POST['cmsadminemail'];
$adminpass = $_POST['cmspassword'];
$managerlanguage = $_POST['managerlanguage'];
$custom_placeholders = array();
//}
But that means, that "installmode==1" is never recognized, and therefore the setup from config.inc.php is ignored!
Fix: uncomment the include line and delete the other quoted lines – and my installation process worked flawlessly.