We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Here is a fix that seems to address the issue for fresh installs on 5.3.6.
      • 24041
      • 7 Posts
      Fantastic, this has fixed it for me under 5.3.6

      2.1.1 up and running soundly smiley

      A million thanks for all your hard work
        • 13373
        • 70 Posts
        I know this is an old thread, but I just wanted to post an update here, as changing the $database_connection_charset = ''; to $database_connection_charset = 'latin1'; worked for me (in the /core/config/config.inc.php file).

        The server had just been upgraded to PHP 5.3.19, and the site suddenly stopped working. I had the error messages about PDO etc, which lead me to this thread (thank goodness).

        Of course, if your DB tables are UTF8, then the string would probably be 'utf8', as per the fix above.

        Cheers,
        Jacob
          • 40321
          • 2 Posts
          The thread is old, but I also got this problem with db charset now. I was installing modx, so I had no /core/config/config.inc.php file yet, therefore the suggestion from Jacobkball was useless in my case.

          So I "fixed" the charset issue replacing a string inside core/xpdo/xpdo.class.php at line 2963 from

          $this->config['dsn']= $dsn;

          to

          $this->config['dsn']= $dsn . 'utf8';

          and gone through the 'Test database server connection and view collations' step.

          Additional info:
          MODX REVOLUTION VERSION 2.2.6-PL
          Ubuntu Server 12.04.1 LTS (all updates)
          PHP Version 5.3.10-1ubuntu3.4
          MySQL 5.5.28
          db character set - utf8
            • 42885
            • 5 Posts

            I'm having the same problem with the db charset during a fresh install (advanced):

            MODX Revolution 2.2.6-pl (advanced)
            RedHat Enterprise Linux 6.4
            mysql 5.5.30
            PHP 5.4.12
            Database charset utf8

            I fixed it with the same edit as voidius above, by:

            Editing core/xpdo/xpdo.class.php and replacing the string:

            $this->config['dsn']= $dsn;

            with

            $this->config['dsn']= $dsn . 'utf8';

            then click 'Test database server connection and view collations' link then immediately put the original xpdo.class.php file back before proceeding further.

            -Mike
              • 44375
              • 92 Posts
              Hi

              I've tried all solutions suggested on this thread to no avail - it is as if you're talking about a different CMS. I can't find any of the code segments people refer to, and when I try to force the character set I get a security error from mysqlnd.

              I search in xpdo.class.php and there is no line $this->config['dsn']= $dsn;

              I tried forcing the DSN to append latin1 or force latin1 wherever character set is mentioned (setup/controllers/database.php, modinstallsettings.class.php, setup/processors/database/connection.php, xpdo.class.php, etc) but it either makes no difference (ie, returns the error others mention above), or returns the following error:

              [2014-01-09 03:21:42] (ERROR in xPDOConnection::connect @ /home2/intiwara/core/xpdo/xpdo.class.php : 3031) SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file

              This was all working fine until my hosts upgraded PHP. Now the manager (for all my MODx sites) returns the error:

              Fatal error: Call to a member function get() on a non-object in /home2/example/core/model/modx/modmanagerresponse.class.php on line 41

              So I'm trying to re-run the setup and can't get past this database connection error.

              The phpinfo is attached (with identifying info obscured).

              Please please help! I'm out of ideas!
                • 44375
                • 92 Posts
                I'm using MODx 2.2.9 (adv) and 2.2.10 (adv), PHP 5.4.23, Apache 2.4.7 on a shared host. (These forums won't let me upload the phpinfo in a file.)
                  • 47282
                  • 2 Posts
                  Sorry for continuing an old post.I am a complete newbie.

                  I was getting no-where with the character set bit until I tried voidius bit from 3 posts above.

                  That seemed to work and I got through to the file checking stage (lots of ticks) but then after clicking next. I got the following error.


                  Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\modx\core\config\config.inc.php on line 13

                  I am trying to run modx locally so I can test it out. At the mo for an easy install it is proving worse than WP (which installed fine). I was hoping to use Modx as it seemed a better more understandable system. Has anyone had the same or similar issue?
                  • There was just a post from another user who had the same problem. He was using Google Chrome, and apparently it doesn't like the MODX installer. He reported success when using Firefox.

                    http://forums.modx.com/thread/90141/installation-error-unexpected-039-039#dis-post-495355
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 47282
                      • 2 Posts
                      Cheeers Sottwell,

                      Unfortunately I was using the Firefox to do the install. It all seemed to go ok till the very final 'next' button. (I assume it was the last) thanks for the help though will have a look at the other forum user.

                      Trying a day later and cannot even get it to that stage today. fails again at the character set test [ed. note: quicky last edited this post 10 years ago.]