We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22835
    • 54 Posts
    My site has been running for a long time now no probs. Then I just noticed this error the other day. I don't know how long it has been there, maybe weeks.

    I've looked through the log in cache/log

    [2014-01-07 17:20:04] (ERROR @ /index.php) Error caching script elements/modsnippet/1
    [2014-01-07 17:20:04] (ERROR @ /index.php) Error caching script elements/modsnippet/1
    [2014-02-12 14:16:09] (ERROR in xPDOConnection::connect @ /content/shard2/sites3/d/a/danoneillmusic.com/web/core/xpdo/xpdo.class.php : 3051) SQLSTATE[HY000] [2002] Connection timed out
    [2014-02-12 14:16:39] (ERROR in xPDOConnection::connect @ /content/shard2/sites3/d/a/danoneillmusic.com/web/core/xpdo/xpdo.class.php : 3051) SQLSTATE[HY000] [2002] Connection timed out
    [2014-02-12 14:16:39] (ERROR @ /index.php) Error preparing statement for query: SELECT `modSession`.`id` AS `modSession_id`, `modSession`.`access` AS `modSession_access`, `modSession`.`data` AS `modSession_data` FROM `modx_session` AS `modSession` WHERE `modSession`.`id` = ?  - 
    [2014-02-12 14:17:10] (ERROR in xPDOConnection::connect @ /content/shard2/sites3/d/a/danoneillmusic.com/web/core/xpdo/xpdo.class.php : 3051) SQLSTATE[HY000] [2002] Connection timed out
    [2014-02-12 14:17:40] (ERROR in xPDOConnection::connect @ /content/shard2/sites3/d/a/danoneillmusic.com/web/core/xpdo/xpdo.class.php : 3051) SQLSTATE[HY000] [2002] Connection timed out


    Don't really understand most of this!

    There are some timeouts I notice. My [uneducated] guess is that Modx was trying to contact the database and couldn't probably because the upgrade* was happening?

    *Note: My hosting upgraded my web server from Zeus to Apache a few weeks ago. They say it wouldn't effect anything - a simple switch they said. [ed. note: pauloneill79 last edited this post 12 years, 5 months ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Definitely a problem connecting to the database. Double-check your database connection details in the core/config/config.inc.php file, and check to make sure you have the correct date.timezone settings in your php.ini
        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
        • 22835
        • 54 Posts
        Thanks sottwell. My hosting just replied, see below. They moved the server to a new location after the upgrade! grrr

        It appears from those logs that the document root for the website is defined incorrectly in the settings for modx or your CMS.

        The path "/content/shard2/sites3/d/a/danoneillmusic.com/web/" was correct for the Zeus server, however your new document root on Apache is simply:

        /var/www/web/

        So how do I reconfigure to point to the right location for the new server? I've just found a config.core.php at the top level which has line stating
        define('MODX_CORE_PATH', '/content/shard2/sites3/d/a/danoneillmusic.com/web/core/'); 

        so is this the line I need to change. I assume this filters down for any other instances

        What do they mean here by root? do i just change the address from

        /content/shard2/sites3/d/a/danoneillmusic.com/web/

        to
        /var/danoneillmusic.com/web/

        I think i just replace with
        /var/www/web/
        [ed. note: pauloneill79 last edited this post 12 years, 5 months ago.]
          • 22835
          • 54 Posts
          SOLVED: Changed the MODX_CORE_PATH variable value in config.core.php which was at the top level to new address
           /var/www/web/core/