We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48842
    • 37 Posts
    I have installed MODX 2.3.1 running as noted in title.

    MODX Setup page seems to work fine (all checks green, although "Checking if we should disable CSS/JS compression:" answers "Not selected, skipping test" )

    Clicking the install button at the bottom of the mydomain.com/setup/index.php?action=summary
    resolves to "502 Bad Gateway"

    Checking the error log at /core/cache/logs/install.config.2014-09-13T08.53.17.log
    shows that 4 tables can NOT be created

    example:
    Could not create table `modx_access_policies` SQL: CREATE TABLE `modx_access_policies` (`id` INTEGER unsigned NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `description` MEDIUMTEXT NULL, `parent` INT(10) unsigned NOT NULL DEFAULT '0', `template` INT(10) unsigned NOT NULL DEFAULT '0', `class` VARCHAR(255) NOT NULL DEFAULT '', `data` TEXT NULL, `lexicon` VARCHAR(255) NOT NULL DEFAULT 'permissions', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), INDEX `parent` (`parent`), INDEX `class` (`class`), INDEX `template` (`template`)) ENGINE=MyISAM ERROR: Array ( [0] => 42000 [1] => 1071 [2] => Specified key was too long; max key length is 1000 bytes


    I have tried with a blank MariaDB database and ALSO have tried letting MODX create the DB. Same result in each case.


    I'm *so* CLOSE!!

    How can I solve this? Thanks in advance!

    This question has been answered by multiple community members. See the first response.

      • 48842
      • 37 Posts
      Quote from: fbachofner at Sep 13, 2014, 11:39 AM

      I have tried with a blank MariaDB database and ALSO have tried letting MODX create the DB. Same result in each case.

      One more detail:

      I thought this problem might be related to using utf8mb4 vs utf8

      (I strongly prefer UTF8mb4, see deceze's answer here: http://stackoverflow.com/questions/16893035/using-utf8mb4-with-php-and-mysql)

      Unfortunately, BOTH character sets (and collations) fail to create 4 tables . . .

      Still stuck.
        • 48842
        • 37 Posts
        I found Bug #9912: http://tracker.modx.com/issues/9912

        Which seems to indicate my problem DOES comes from using a multibyte character set i.e. uft8 or utf8mb4 (utf8mb4 uses at least as much storage space)

        However, that tracker indicates the bug is fixed as of 2.2.8-pl

        Even so, I changed character set / collation to latin1 / latin1_general_ci

        and I still get the "Specified key was too long; max key length is 1000 bytes" error.

        What gives?!
          • 48842
          • 37 Posts
          I simplified my attempts to use MODX's suggested DB name "modx"

          I no longer get the "Specified key was too long" error (I had been using an unwise DB name on top of UTF8 and variants).

          Unfortunately I STILL get the "502 Bad Gateway" error after running the startup script.

          Worse, now there is NOTHING in the log, indeed, /core/cache/logs/ didn't even get created, and when I create it there is NO log generated!

          Help, please!
          • discuss.answer
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            You will need to examine your server's logs. It sounds like there is something wrong with your PHP/FPM configuration and/or the nginx configuration.
              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
              • 1343 ☆ A M B ☆
              • 2,213 Posts
              I'm going to agree with Susan, there is definitely something wrong with your server configuration. I can confirm that NGINX/PHP-FPM does work with MODX along with MariaDB.
                Patrick | Server Wrangler
                About Me: Website | Tweets |  MODX Hosting
              • discuss.answer
                • 48842
                • 37 Posts
                Hi sottwell and AMDbuilder:


                Thanks for your replies.

                I too had thought something was amiss and nuked my entire php5 stack earlier this evening.

                I installed it back withOUT caching (I thought php5-xcache might be creating problems) and lo and behold, MODX can complete setup of a site hosted on Nginx!

                I'll try adding a caching method tomorrow and see what happens!
                  • 48842
                  • 37 Posts
                  By the way, the problem does not seem to have been with configuration (unless caching was the culprit) but rather the actual install of the php5 stack.

                  At some point after my various nearly successful installs of MODX, PHP5 somehow even managed to delete php5-fpm.sock

                  When that disappeared I really started thinking I had some sort of install problem rather than a configuration problem.
                    • 48842
                    • 37 Posts
                    I just installed php5-xcache and the MODX application seems to still be working both after php5 restart and server reboot.

                    It looks like I am good to go!

                    Thanks again sottwell and AMDbuilder!
                      • 1343 ☆ A M B ☆
                      • 2,213 Posts
                      I'm glad to hear you got things working. The issue with the php5-fpm.sock file can sometimes be caused by actual updates to php, as MODX itself shouldn't have permission to remove the file. The one recommendation I would make is switching to APC instead of xcache, as MODX should leverage it better (and it's more performant).
                        Patrick | Server Wrangler
                        About Me: Website | Tweets |  MODX Hosting