We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53390
    • 42 Posts
    Thanks Bob but I couldn't find anything for my situation. I have run out of ideas. XAMPP works even worse than easyPHP. EasyPHP at least allows me to install MODx.
      • 3749
      • 24,544 Posts
      My first install on XAMPP took me several days to work out. I needed to enable the rewrite engine, and I needed an .htaccess file with the RewriteBase line set to the subdirectory I installed MODX in under htdocs. This isn't necessary on a "real" server, but for some reason it is on XAMPP on Windows. The RewriteBase line needs to have a trailing slash:

      RewriteBase /subDirName/


      This isn't necessary if you install MODX *in* htdocs.

      I may have had some other problems as well, but I can't remember them. Now, I install MODX sites all the time under htdocs with no trouble.

      Are you seeing an error when you run Setup?

      There may be an install log in core/cache/logs.



      [ed. note: BobRay last edited this post 6 years, 11 months ago.]
        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
      • discuss.answer
        • 53390
        • 42 Posts
        1. In my XAMPP which is the latest version, rewrite module is ON for loading by default in httpd.conf.
        2. In my case, RewriteBase in .htaccess and .htaccess itself is not needed since it doesn't change anything. MODx setup starts successfully with and without it. I just noticed that when I set RewriteBase incorrectly - without slash in front of the subdirectory name it generates server error 500. It just proves that localhost url is working fine.
        3. I can run setup until the point where I need to enter database details. The page called "Connection Information". When I enter already created DB details and already created user details and click on "Test database server connection and view collations." and get this error:

        Connecting to database server:  
        Could not connect to the database server. Check the connection properties and try again.
        
        [2017-05-13 14:01:43] (ERROR in xPDOConnection::connect @ C:\xampp\htdocs\mywebsite\core\xpdo\xpdo.class.php : 3116) SQLSTATE[HY000] [1045] Access denied for user 'dbuser'@'localhost' (using password: YES)
        
        [2017-05-13 14:01:43] (ERROR in xPDOConnection::connect @ C:\xampp\htdocs\mywebsite\core\xpdo\xpdo.class.php : 3116) SQLSTATE[HY000] [1045] Access denied for user 'dbuser'@'localhost' (using password: YES) 


        Sometimes instead of this error I get charset related error message.

        At this point no core/cache/logs generated yet - no such directory or file.

        I tried first to allow modx to create DB and user but it didn't work so I create it manually via phpMyAdmin.
          • 3749
          • 24,544 Posts
          Is there a character set specified in config.inc.php? If so, check it against the database. I wouldn't think a mismatch would prevent the DB connection, but it's worth checking.

          You did give the DB user full rights to the DB, right?

          You can try this on the SQL tab in PhpMyAdmin to show the username:

          select Host, User from mysql.user;


          Click on Edit to see if all the permissions are checked.

          I imagine you've done this already, but if not, double-check the exact DB name in PhpMyAdmin, and make sure to use localhost for the Database Host field, when you enter the DB details in Setup.
            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
            • 53390
            • 42 Posts
            I couldn't find any character set specified in config.inc.php (phpMyAdmin)
            I gave all rights and by running the SQL command that you wrote, clicking Edit shows the same - all rights 'Y'.
            The DB is always 'localhost' in both: phpMyAdmin and the MODx installation page.
              • 3749
              • 24,544 Posts
              I have this in config.inc.php:

              $database_type = 'mysql';
              $database_server = 'localhost';
              $database_user = 'MyDbUser';
              $database_password = 'MyDbPassword';
              $database_connection_charset = 'utf8';
              $dbase = 'myDataBasename';
              $table_prefix = 'modx_';
              $database_dsn = 'mysql:host=localhost;dbname=MyDatabaseName;charset=utf8';


              Notice that the dbname and the charset are in there twice.

              Maybe that doesn't get written until you get further in setup.

                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
                • 53390
                • 42 Posts
                In my case, the config.inc.php file even has a bit different format and no info about my manually created user. Root is coming with XAMPP installation and is looking like this (no charset info anyway):
                $cfg['Servers'][$i]['auth_type'] = 'config';
                $cfg['Servers'][$i]['user'] = 'root';
                $cfg['Servers'][$i]['password'] = '';
                $cfg['Servers'][$i]['extension'] = 'mysqli';
                $cfg['Servers'][$i]['AllowNoPassword'] = true;
                $cfg['Lang'] = '';
                  • 3749
                  • 24,544 Posts
                  That could explain your problem. That's not the MODX config.inc.php file and I don't see how MODX would put a file under the MODX core directory (which wouldn't have existed when you installed XAMPP. Are you sure you're looking in core/config/config.inc.php? By default, it would be under the core directory at the root of your MODX install (under xampp/htdocs/).

                    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
                    • 53390
                    • 42 Posts
                    Ahh no, sorry Bob. This one is coming from XAMPP Apache server. I thought you were talking about this one. I imagined my manually created DB user should have appeared in this file.
                    Anyway, my MODx core/config is empty and no such php file inside the directory. No any file actually in there. Even in the installation package there're no files in core/config.
                      • 3749
                      • 24,544 Posts
                      That seems to boil down to the Database name and/or user credentials not being correct, but I'm sure you've checked that many times. Beyond that, I'm stumped.
                        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