We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45591
    • 18 Posts
    Hi,

    I’ve got an installation that got migrated from the early 0.9.2 days to 1.0.15. Now I wanted to upgrade to 1.2.1 but this fails in the installer, last step: “Connection to database failed”.

    “C’me on, check your login credentials”, you think. Sure, thought the same. But, in the installer’s previous step, all the login credentials for MySQL are happily accepted, and when I try "fresh install" instead of upgrade, it tells me that my table prefix is already in use, so the connection works.

    Any ideas? Debian 8, PHP 5.6.30, MySQL 5.5.

    When I just upgrade the PHP files, before running the install-Script, I get "- Table 'modx_active_user_sessions' doesn't exist - The details of the error could be seen in the MODX system events log."

    This question has been answered by beroprac. See the first response.

      • 38783
      • 571 Posts
      I haven't used Evo for a while now but this sounds familiar. I think it may be that you have to change mysql to mysqli in the config file.
        If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

        email: [email protected] | website: https://andytough.com
        • 45591
        • 18 Posts
        Quote from: andytough at May 13, 2017, 09:47 PM
        I haven't used Evo for a while now but this sounds familiar. I think it may be that you have to change mysql to mysqli in the config file.

        Thanks for digging in your memory. Unfortunately changing the connector type to mysqli didn’t help here …
        • discuss.answer
          • 45591
          • 18 Posts
          Okay, I found the problem - it is a defect in the installer:

          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();
          //}


          This obviously eliminates the case if installmode is indeed == 1 …

          Fix: uncomment (remove the double-slash) before the "include" above, and comment (insert double-slashes) all the lines following … - installer ran through, MODx got updated
            • 53576
            • 1 Posts
            Hello,

            I can't find the file you have mentioned, Instprocessor.php.

            My upgrade is failing the Connection to database step in the pre-check. Everything else looks good.

            PHP 7.1.6-centos7.17060817
            MySQL 5.5.52-1.el7
            Apache 2.4.6-45.el7.centos.4

            Thanks!