We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38205
    • 11 Posts
    I am running two modx sites. Last night they both went blank. All files are still on my server and i can still acces any page that isnt running modx, all the modx pages however have gone blank, and in chrome they are giving http 500 error.

    I tried to post this last night but the modx.com site was down as well so i figured it was an issue with the api or something.. but it looks like you guys are back up and my sites are still blank.

    Im running revolution. I havent made changes to either site for at least a week and ive cleared the cache on both (i can still access the manager). I dont know what else to do. please help!

    thanks!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The MODx site has nothing to do with your site, except for the RSS feeds in the Manager.

      Usually such a sudden total loss of sites is due to changed made by the hosting to their servers. Have you asked your hosting tech support what they have done recently? Upgraded something? Changed security configurations?

      Check your .htaccess file; the fact that the Manager still works is suggestive of .htaccess problems.
        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
        • 38205
        • 11 Posts
        hmmm my hosting provider is saying nothing has changed... any other ideas? thanks for the help.
          • 38205
          • 11 Posts
          Also my error log is repeating these errors:
          [23-Jan-2012 10:33:03] PHP Strict Standards: Creating default object from empty value in (mydomain)/index.php on line 53
          [23-Jan-2012 10:33:03] PHP Fatal error: Call to undefined method stdClass::setLogLevel() in (mydomain)/index.php on line 56
            • 38205
            • 11 Posts
            so i replaced my index.php file with a fresh one from my original modx download and it seemed to fix the problem. Somehow a bunch of code got erased from it while it was on my server... on both sites... any idea how that could have happend?

            heres what it looked like before i replaced it with the fresh one:
            <?php
            /*
             * MODX Revolution
             *
             * Copyright 2006-2011 by MODX, LLC.
             * All rights reserved.
             *
             * This program is free software; you can redistribute it and/or modify it under
             * the terms of the GNU General Public License as published by the Free Software
             * Foundation; either version 2 of the License, or (at your option) any later
             * version.
             *
             * This program is distributed in the hope that it will be useful, but WITHOUT
             * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
             * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
             * details.
             *
             * You should have received a copy of the GNU General Public License along with
             * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
             * Place, Suite 330, Boston, MA 02111-1307 USA
             *
             */
            $mtime= microtime();
            $mtime= explode(" ", $mtime);
            $mtime= $mtime[1] + $mtime[0];
            $tstart= $mtime;
            
            error_reporting(E_ALL | E_STRICT);
            
            /* define this as true in another entry file, then include this file to simply access the API
             * without executing the MODX request handler */
            if (!defined('MODX_API_MODE')) {
                define('MODX_API_MODE', false);
            }
            
            /* this can be used to disable caching in MODX absolutely */
            $modx_cache_disabled= false;
            
            /* include custom core config and define core path */
            @include(dirname(__FILE__) . '/config.core.php');
            if (!defined('MODX_CORE_PATH')) define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');
            
            /* include the modX class */
            if (!@include_once (MODX_CORE_PATH . "model/modx/modx.class.php")) {
                $errorMessage = 'Site temporarily unavailable';
                @include(MODX_CORE_PATH . 'error/unavailable.include.php');
                header('HTTP/1.1 503 Service Unavailable');
                echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p><script type="text/javascript">
                    var DISModifyPost = $(function() {
                        DIS.config.attachments_max_per_post = 5;
                        DIS.DISModifyPost.init({
                            attachments: 1
                        });
                    });</script>
            </body></html>";
                exit();
            }
            
            /* Set the actual start time */
            $modx->startTime= $tstart;
            
            /* Set additional logging options including level and target: */
            $modx->setLogLevel(modX::LOG_LEVEL_ERROR);
            $modx->setLogTarget('FILE');
            
            /* Set debugging mode (i.e. error_reporting): */
            $modx->setDebug(E_ALL & ~E_NOTICE);
            
            /* Initialize the default 'web' context */
            $modx->initialize('web');
            
            /* execute the request handler */
            if (!MODX_API_MODE) {
                $modx->handleRequest();
            }



            and here is the fresh one:
            <?php
            /*
             * MODX Revolution
             *
             * Copyright 2006-2011 by MODX, LLC.
             * All rights reserved.
             *
             * This program is free software; you can redistribute it and/or modify it under
             * the terms of the GNU General Public License as published by the Free Software
             * Foundation; either version 2 of the License, or (at your option) any later
             * version.
             *
             * This program is distributed in the hope that it will be useful, but WITHOUT
             * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
             * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
             * details.
             *
             * You should have received a copy of the GNU General Public License along with
             * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
             * Place, Suite 330, Boston, MA 02111-1307 USA
             *
             */
            $mtime= microtime();
            $mtime= explode(" ", $mtime);
            $mtime= $mtime[1] + $mtime[0];
            $tstart= $mtime;
            
            error_reporting(E_ALL | E_STRICT);
            
            /* define this as true in another entry file, then include this file to simply access the API
             * without executing the MODX request handler */
            if (!defined('MODX_API_MODE')) {
                define('MODX_API_MODE', false);
            }
            
            /* this can be used to disable caching in MODX absolutely */
            $modx_cache_disabled= false;
            
            /* include custom core config and define core path */
            @include(dirname(__FILE__) . '/config.core.php');
            if (!defined('MODX_CORE_PATH')) define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');
            
            /* include the modX class */
            if (!@include_once (MODX_CORE_PATH . "model/modx/modx.class.php")) {
                $errorMessage = 'Site temporarily unavailable';
                @include(MODX_CORE_PATH . 'error/unavailable.include.php');
                header('HTTP/1.1 503 Service Unavailable');
                echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p><script type="text/javascript">
                    var DISModifyPost = $(function() {
                        DIS.config.attachments_max_per_post = 5;
                        DIS.DISModifyPost.init({
                            attachments: 1
                        });
                    });</script>
            </body></html>";
                exit();
            }
            
            /* start output buffering */
            ob_start();
            
            /* Create an instance of the modX class */
            $modx= new modX();
            if (!is_object($modx) || !($modx instanceof modX)) {
                @ob_end_flush();
                $errorMessage = '<a href="setup/">MODX not installed. Install now?</a>';
                @include(MODX_CORE_PATH . 'error/unavailable.include.php');
                header('HTTP/1.1 503 Service Unavailable');
                echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p><script type="text/javascript">
                    var DISModifyPost = $(function() {
                        DIS.config.attachments_max_per_post = 5;
                        DIS.DISModifyPost.init({
                            attachments: 1
                        });
                    });</script>
            </body></html>";
                exit();
            }
            
            /* Set the actual start time */
            $modx->startTime= $tstart;
            
            /* Set additional logging options including level and target: */
            $modx->setLogLevel(modX::LOG_LEVEL_ERROR);
            $modx->setLogTarget('FILE');
            
            /* Set debugging mode (i.e. error_reporting): */
            $modx->setDebug(E_ALL & ~E_NOTICE);
            
            /* Initialize the default 'web' context */
            $modx->initialize('web');
            
            /* execute the request handler */
            if (!MODX_API_MODE) {
                $modx->handleRequest();
            }



            looks like all this got removed somehow?
            /* start output buffering */
            ob_start();
             
            /* Create an instance of the modX class */
            $modx= new modX();
            if (!is_object($modx) || !($modx instanceof modX)) {
                @ob_end_flush();
                $errorMessage = '<a href="setup/">MODX not installed. Install now?</a>';
                @include(MODX_CORE_PATH . 'error/unavailable.include.php');
                header('HTTP/1.1 503 Service Unavailable');
                echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p></body></html>";
                exit();
            }
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I would be very suspicious of anything meddling with those files. Your sites may have been hacked, and something was trying to write malicious code to those files.

              Change your passwords, and make sure that your file permissions are all as restrictive as possible... files should be 644 and directories 755. I would also suspect the presence of some malicious scripts that try to write to these index.php files.
                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
                • 38205
                • 11 Posts
                Ya for sure thats my thought as well, the thing that boggles my mind is that my 2 modx sites were the only sites on my server that were effected.