We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32654
    • 26 Posts
    My IPS has just moved my website to a new datacentre.
    Trouble is when I now try to access the website I get the following message:


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

    PHP error debug
    Error: mysql_connect() [function.mysql-connect]: Access denied for user ’xyz_m1’@’ns2.nhgdns.com’ (using password: YES)
    Error type/ Nr.: Warning - 2
    File: /home/xyz/public_html/manager/includes/extenders/dbapi.mysql.class.inc.php
    Line: 87
    Line 87 source: if (!$this->conn = ($persist ? mysql_pconnect($host, $uid, $pwd) : mysql_connect($host, $uid, $pwd, true))) {

    Parser timing
    MySQL: 0.0000 s (0 Requests)
    PHP: 0.0135 s
    Total: 0.0135 s
    Error while inserting event log into database.

    Can anyone shed some light.
    Many thanks

    W
      • 25830
      • 19 Posts
      Update your config file to match the new database credentials, and make sure you clear the MODx cache.
        • 16620
        • 3 Posts
        Hi I am having the same problem, can you be a bit more specific as to what config file?

        cheers
          • 3749
          • 24,544 Posts
          That would be:

          manager/includes/config.inc.php


          smiley

          The error message you’re getting is telling you that the username/password for the MODx database is not correct, so either the host changed the database name, username, and/or password or forgot to move the MODx database.

          Some hosts add a prefix to the DB name or user name so one possibility is that the prefix has changed.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 33410
            • 14 Posts
            Hello,

            Check if your database and users are assigned corrected on the server server.

            Most of the times while transfer of site database user are missed if its cpanel.

            Recheck the user permissions as well.

              • 2449
              • 11 Posts
              Quote from: ryanlwh at Aug 13, 2008, 04:39 PM

              Update your config file to match the new database credentials, and make sure you clear the MODx cache.

              Where do you clear cache?
                • 8609
                • 607 Posts
                Quote from: austin at Jun 17, 2010, 03:33 PM

                Quote from: ryanlwh at Aug 13, 2008, 04:39 PM

                Update your config file to match the new database credentials, and make sure you clear the MODx cache.

                Where do you clear cache?

                Can you log into the manager? If yes, then you would clear the site cache from the backend, it’s under the Site tab, the main one that loads when you log in.

                Also make sure your db settings are still correct in the config file as stated before
                  • 2449
                  • 11 Posts
                  My issue is that my manager wouldn’t have even loaded O_O so I was hoping there was a manual way of doing this.
                  either deleting cache/ directories, or running a clearCache() function.
                    • 3749
                    • 24,544 Posts
                    Your best bet, at this point, is to upload the original install directory and do an upgrade install -- that will clear the cache and use the DB credentials from config.inc.php. Be sure *not* to install the sample site or any snippets or plugins.

                    It’s important that the install directory comes from a version of MODx that exactly matches the one used on your site.

                    If you can’t be sure of that, I’d do a full upgrade to version 1.0.4.
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 37538
                      • 14 Posts
                      Hi

                      I have just found this thread and thought someone might be able to help. I too have a Parse error message coming up. It's a bit different though:

                      Warning: Cannot modify header information - headers already sent by (output started at /home/sunfjam/public_html/index.php:1) in /home/sunfjam/public_html/index.php on line 59

                      Warning: Cannot modify header information - headers already sent by (output started at /home/sunfjam/public_html/index.php:1) in /home/sunfjam/public_html/index.php on line 60

                      Warning: Cannot modify header information - headers already sent by (output started at /home/sunfjam/public_html/index.php:1) in /home/sunfjam/public_html/manager/includes/config.inc.php on line 74

                      Warning: Cannot modify header information - headers already sent by (output started at /home/sunfjam/public_html/index.php:1) in /home/sunfjam/public_html/manager/includes/document.parser.class.inc.php on line 2793
                      « MODx Parse Error »
                      MODx encountered the following error while attempting to parse the requested resource:
                      « PHP Parse Error »

                      PHP error debug
                      Error: Cannot modify header information - headers already sent by (output started at /home/sunfjam/public_html/index.php:1)
                      Error type/ Nr.: Warning - 2
                      File: /home/sunfjam/public_html/manager/includes/document.parser.class.inc.php
                      Line: 514
                      Line 514 source: header('Content-Type: ' . $type . '; charset=' . $this->config['modx_charset']);

                      Parser timing
                      MySQL: 0.0038 s (0 Requests)
                      PHP: 0.0262 s
                      Total: 0.0300 s

                      The last alteration that was made to the website was made on Thursday after which it was working fine with no problems. It was also working the day after perfectly OK as well but today I just keep getting this message on every page.

                      I am therefore wondering if the hosting company has moved the website to a new server and somehow that is causing problems like the original poster? I can log into the manager OK.

                      Does anyone have any ideas or pointers to what might have happened?

                      Many thanks.