We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44375
    • 92 Posts
    My hosts just upgraded to PHP 5.4.23 and both my MODx installs (2.2.9 adv and 2.2.10 adv) now display the following when I navigate to the manager login page:

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

    The "non-object" is the welcome action, and the line throwing the error is $action->get('id'). The code context in modxmanagerresponse is:

            $theme = $this->modx->getOption('manager_theme',null,'default');
            $this->modx->lexicon->load('dashboard','topmenu','file','action');
            if ($action == 0 || !isset($this->modx->actionMap[$action])) {
                /** @var modAction $action */
                $action = $this->modx->getObject('modAction',array(
                    'namespace' => 'core',
                    'controller' => 'welcome',
                ));
                $action = $action->get('id');
            }
    


    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. Any ideas at all? I'm having trouble running setup but I believe that is a separate character collation issue. Everything was working fine until my hosts upgraded the PHP version. Any ideas at all please?
    • Sounds like the host messed up the site during the upgrade, or made a mistake in the deployment of 5.4.23 somehow. Check to make sure PHP has permission to access your cache directories and any files within them.
        • 44375
        • 92 Posts
        Thanks hugely for the rapid feedback. I've tested and the website does successfully create the log subdirectory within cache and write to the file, so I don't think it is write permissions.

        The message being written is:

        [2014-01-13 19:59:31] (ERROR in xPDOConnection::connect @ /home2/banacekn/core/xpdo/xpdo.class.php : 3051) 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

        Any ideas? I've tried everything on the thread about setup issues (http://forums.modx.com/thread/28550/rc4-install-fails-can-t-connect-to-db?page=4), although I'm not sure it is the same issue as this is with a fully populated config.inc.php specifying the latin1 character set.
        • This is a server problem. An upgrade of the MySQL database caused your passwords to fail because they were created and the old-style hash stored under the old database server's rules.

          If this is CPanel hosting, you can go into the MySQL manager and create a new password for your database user, actually using the same plain-text password that is in your MODX config.inc.php file. It will be processed according to the new rules, and should solve your problem.

          If it won't let you use the same plain-text password, just use a new one and edit the MODX config.inc.php file to use the new one.
            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
            • 44375
            • 92 Posts
            This was very exciting, thanks, but unfortunately didn't work. One of the first things I did was try to create a brand new user. I have since tried changing the password in CPanel MySql Manager as you suggest, and creating another new user (in case something was upgraded since the problem first appeared) but I still get the error below.

            And rather stupidly I deleted the cache directory so have killed the public site now too..

            [2014-01-16 02:59:34] (ERROR in xPDOConnection::connect @ /home2/banacekn/core/xpdo/xpdo.class.php : 3051) 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
            [2014-01-16 02:59:34] (ERROR in xPDOConnection::connect @ /home2/banacekn/core/xpdo/xpdo.class.php : 3051) 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
            [2014-01-16 02:59:34] (ERROR @ /index.php) Error preparing statement for query: SELECT `modSystemSetting`.`key` AS `modSystemSetting_key`, `modSystemSetting`.`value` AS `modSystemSetting_value`, `modSystemSetting`.`xtype` AS `modSystemSetting_xtype`, `modSystemSetting`.`namespace` AS `modSystemSetting_namespace`, `modSystemSetting`.`area` AS `modSystemSetting_area`, `modSystemSetting`.`editedon` AS `modSystemSetting_editedon` FROM `bnck_system_settings` AS `modSystemSetting` -
            [2014-01-16 02:59:34] (ERROR in xPDOConnection::connect @ /home2/banacekn/core/xpdo/xpdo.class.php : 3051) 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
            [2014-01-16 02:59:34] (ERROR in xPDOConnection::connect @ /home2/banacekn/core/xpdo/xpdo.class.php : 3051) 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
            [2014-01-16 02:59:34] (ERROR @ /index.php) Error preparing statement for query: SELECT `modSystemSetting`.`key` AS `modSystemSetting_key`, `modSystemSetting`.`value` AS `modSystemSetting_value`, `modSystemSetting`.`xtype` AS `modSystemSetting_xtype`, `modSystemSetting`.`namespace` AS `modSystemSetting_namespace`, `modSystemSetting`.`area` AS `modSystemSetting_area`, `modSystemSetting`.`editedon` AS `modSystemSetting_editedon` FROM `bnck_system_settings` AS `modSystemSetting` -
            [2014-01-16 02:59:34] (FATAL) Could not load core MODX configuration!
              • 44375
              • 92 Posts
              PS. I have another site on the same server using a CMS I built myself, and it is connecting to the database fine without any change, so I believe it is something specifically related to how XPDO is attempting to connect.
                • 44375
                • 92 Posts
                PPS. Please now I've killed the public site this is an emergency, any suggestions or ideas very gratefully received.
                  • 44375
                  • 92 Posts
                  If I run setup it successfully loads the correct connection details. If I create a fresh MODx database (giving it connection details for a newly created empty database, as the user doesn't have create database permissions), or if I specify the correct connection details for the existing database, setup reports just:

                  Connecting to database server:
                  Could not connect to the existing database for upgrade. Check the connection properties and try again.

                  If I try to run setup without re-specifying the database connection I get the HTTP 500 error.

                  Yet my own CMS is still connecting to the database without a glitch. What is specific about MODx/XPDO?

                  At this stage any hack however awful gratefully considered.
                    • 44375
                    • 92 Posts
                    Is XPDO self-contained or does it require libraries on the server?

                    Might it require any new libraries to connect with the new mysql hash? Or new php mysql drivers?

                    What is different to a CakePHP database connection, which has worked fine throughout without a glitch?

                    Can I manually replace the connection code with something more standard? Or are there particular XPDO needs/functions that require this special means of connecting?


                    Really, really desperate now - got four MODx sites all dead, (and one MODx site the subject of another thread that throws a 500 error for editing particular templated resources causing commercial problems), and I can't replicate anything outside the live servers. Massively grateful for any thoughts at all.
                      • 44375
                      • 92 Posts
                      When I connect with a fresh extract of the core directory, I get the following mysql hash error again. I don't get this when running setup against the already configured core install (with dsn and character set specified). So I suspect that this error message is a consequence of the character or collation issue discussed here: http://forums.modx.com/thread/?thread=64171&i=1&page=4

                      Unfortunately I have already tried all solutions suggested on this thread, and only get the same error as below.



                      Connecting to database server:
                      Could not connect to the database server. Check the connection properties and try again.

                      [2014-01-16 03:45:17] (ERROR in xPDOConnection::connect @ /home2/examplen/example.com/core/xpdo/xpdo.class.php : 3051) 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

                      [2014-01-16 03:45:17] (ERROR in xPDOConnection::connect @ /home2/examplen/example.com/core/xpdo/xpdo.class.php : 3051) 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