We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29030
    • 27 Posts
    « MODx Parse Error »
    When I go to a page that I know is "clearly" there...ie has been created and published, I am getting this error...

    Recently we performed a major server upgrade and have multiple sites with modx installed on it. However this seems to be the only site that is not working correctly.

    Any ideas on what causes this problem? Permissions maybe? db corruption?(i’ve run mysql repairs on the db already without any result)

    ----------------------
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ’/tmp/mysql.sock’ (2)
    Error type/ Nr.: Warning - 2
    File: /home/users/glossit/public_html/manager/includes/document.parser.class.inc.php(748) : eval()’d code
    Line: 5

    Parser timing
    MySQL: 0.0060 s (4 Requests)
    PHP: 0.0131 s
    Total: 0.0191 s
    -----------------------

    Thanks In advance.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Here’s a possible cause
      Someone has removed the Unix socket file that mysqld uses (/tmp/mysql.sock by default). For example, you might have a cron job that removes old files from the /tmp directory. You can always run mysqladmin version to check whether the Unix socket file that mysqladmin is trying to use really exists. The fix in this case is to change the cron job to not remove mysql.sock or to place the socket file somewhere else. See Section B.1.4.5, “How to Protect or Change the MySQL Unix Socket File”.
        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