We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38117
    • 11 Posts
    Tried to move my site based on Modx Revolution 2.2-advanced on a production hosting but faced the famous Error 500.

    I used my own migration process which proved itself for other CMS.


    • Wiping all available ModX caches
    • Creating a DB dump
    • Copying all necessary files including DB dump to a special "migration directory"
    • Autoreplacing the /path/to/devel/files/ by /path/to/production/files/ for every file in "migration directory"
    • Compressing (and, if desired, TARing) the whole "migration dir" to a single zip file
    • Uploading that zip file to production server
    • Unzipping the archive and, if necessary, renaming some dirs (e.g. webroot->htdocs)
    • Changing file/dir permissions if necessary
    • Applying DB dump to production database

    This migration process usually works well even with no-so-logically-built CMS like Wordpress. But with ModX Revo 2.2 it's not the case.

    Yes I've read the migration guide. Did some corrections to config.inc.php, now all paths and hosts appear to be correct.

    Tried THREE different hostings including the Site5 claiming itself to be fully ModX Revo 2.2 compatible but still the error 500. This begins to be annoying...

    Revo gurus, please help. Thanks in advance!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      There are two places where the config.inc.php file needs to be edited for the database info. Not only do the database-related variables need editing, but there is another line
      $database_dsn = 'mysql:host=localhost;dbname=mydb;charset=utf8';

      If that isn't corrected to reflect your host and dbname it will cause a 500 error.
        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
        • 38117
        • 11 Posts
        The problem is more or less resolved due to Site5 brilliant support team.

        1. File permissions. ModX Revo appears to be very strict on them. The only working solution: 0755 for dirs and 0644 for files. It can be VERY important at Site5 because they use suPHP.

        2. zlib.output_compression in .htaccess. Like to use this feature but at Site5 it demands special tuning. Had the following lines in .htaccess:

        php_flag zlib.output_compression On
        php_value zlib.output_compression_level 5
        


        At Site5 no php_flag is allowed in .htaccess, users should make a custom php.ini instead.

        To Susan: yes Your guess was a pretty one but in my case it was not the wrong DSN who lead to the the error 500. Thanks nevertheless!

        P.S. Would like to underline that Site5 support guys are really smart. Hostgator is less user friendly.
          • 1343 ☆ A M B ☆
          • 2,213 Posts
          I'm glad to hear you got the issue resolved.

          In case anyone else comes across this thread...

          Typically 500 errors are caused by one of two issues:
          1. Permission issue (check that files/folders are 644/755 - as your host likely uses suphp)
          2. Incorrect/unsupported .htaccess code (as noted above, if suphp is in play you can't use php flags)

          If you wish to enable gzip tho, most hosting providers (haven't found one that doesn't yet) support this method: http://salscode.com/web-resources/gzip-htaccess
            Patrick | Server Wrangler
            About Me: Website | Tweets |  MODX Hosting