We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2940
    • 17 Posts
    Hello everyone,

    Today we moved our site from developper server to the future production server. (modx ver. 1.0.3)
    We followed instructions from here http://wiki.modxcms.com/index.php/Moving_Site_To_Another_Location.

    Everything went ok, we can see the main page and some of subpages, but one of the templates fails giving following error:
    MODx encountered the following error while attempting to parse the requested resource: 
    « PHP Parse Error » 
      
    PHP error debug 
      Error:  mysqli::mysqli() [function.mysqli-mysqli]: (28000/1045): Access denied for user 'root'@'localhost' (using password: YES)   
      Error type/ Nr.:  Warning - 2   
      File:  /var/www/html/modx/manager/includes/[u]document.parser.class.inc.php[/u](770) : eval()'d code   
      Line:  1 
    
    


    What can cause that error? What we can do to avoid/prevent this from happening?

    As always, we’ll appreciate any help.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      That particular template has a snippet that directly accesses the database. It’s perhaps getting custom data from a different database? The database login is hard-coded in the snippet, and will need to be edited to accommodate your new server.

      Whenever you see an error with something like this:
      File: /var/www/html/modx/manager/includes/document.parser.class.inc.php(770) : eval()’d code
      Line: 1
      it’s referring to the line number of a snippet or perhaps a plugin; these have their code processed by the PHP eval() function. The (770) tells you that’s line 770 of the document.parser.class.inc.php file, and that line is
              $snip= eval ($snippet);
      

      so we know it’s a snippet causing the problem.
        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
        • 2940
        • 17 Posts
        Thanks Susan!

        We’ve changed the database root password for the one we have on the deploy server and that fixed every problems,

        In the template code there were snippets but none of them was using mysql, so that error was very strange. I will check the code tomorrow once again.