⚠️ Urgent! Active Attacks on MODX Revolution Sites Below Revolution 2.6.5
Subscribe: RSS
  • It is a very strange problem. With fresh install of Modx 2.6.2 I am getting 500 Internal Server error on the website homepage but the manager is working fine.

    I don't know where to start investigating.

    Please help. Thanks!

    This question has been answered by ispasov. See the first response.

    • Is there an .htaccess file in the MODX root? An error there, or a non-modx .htaccess file is a common cause of 500 errors.

      If you're using PHP 7+, it has a tendency to throw a 500 error on hitting a PHP syntax error that would pass unnoticed in earlier versions.

      Check the MODX error log.

      If that doesn't help, sometimes, you can catch the error by watching the network tab in the developer console in Chrome or Firefox (Ctrl-shift-i) and see an error message when you click on a line and look at the response tab. It will be wrapped in some very ugly HTML but the message will be in there somewhere.
        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
      • Quote from: BobRay at Apr 10, 2018, 09:29 PM
        Is there an .htaccess file in the MODX root? An error there, or a non-modx .htaccess file is a common cause of 500 errors.

        If you're using PHP 7+, it has a tendency to throw a 500 error on hitting a PHP syntax error that would pass unnoticed in earlier versions.

        Check the MODX error log.

        If that doesn't help, sometimes, you can catch the error by watching the network tab in the developer console in Chrome or Firefox (Ctrl-shift-i) and see an error message when you click on a line and look at the response tab. It will be wrapped in some very ugly HTML but the message will be in there somewhere.

        I have a single non modx .htaccess file to specify php version. I have the same error with php 7.0 and 5.6.
        I have the same error even if I am using modx .htaccess.

        In /core/cache/logs I have found file install.config.2018-04-11T00.50.45.log with 2 types of errors in it:


        [2018-04-11 00:50:47] (ERROR @ /home/myserver/mydomain/core/xpdo/transport/xpdoobjectvehicle.class.php : 227) Could not copy /home/myserver/mydomain/core/packages/core/modContext/9ab2ee02030c3a306dd0a0b15eef7240/0/ to /home/myserver/mydomain/index.php

        [2018-04-11 00:50:47] (ERROR @ /home/myserver/mydomain/core/xpdo/transport/xpdofilevehicle.class.php : 40) Could not install files from /home/myserver/mydomain//core/packages/core/xPDOFileVehicle/acb2475a755a6a1eba6e8594e0df562e/ to /home/myserver/mydomain//connectors/

        In /core/error I have fount another 2 files which are attached to that post. (I have added .txt extension to both files to attach them).

        I really have no idea because I am new to php and this is the first time I have problems istalling modx.
        • I don't think it has anything to do with PHP. The error messages suggest a file permission or ownership issue with the root and connectors directories and/or an incorrect setting in the config files. I think the second one is more likely.

          Check the paths in the core/config/config.config.inc.php file, especially the connectors path.

          Also, check the core path in the config.core.php files in the MODX root and connectors directories.
            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
          • Quote from: BobRay at Apr 11, 2018, 06:28 AM
            I don't think it has anything to do with PHP. The error messages suggest a file permission or ownership issue with the root and connectors directories and/or an incorrect setting in the config files. I think the second one is more likely.

            Check the paths in the core/config/config.config.inc.php file, especially the connectors path.

            Also, check the core path in the config.core.php files in the MODX root and connectors directories.

            The paths seem to be correct.

            Is there a way the permissions to cause the problem? I also kept the core folder inside the website folder, just renamed its ht.access file to .htaccess because the serve couldn't find it outside the website folder.
            • Check the site_status System Setting in System (gear icon) -> System Settings.

              Also, try renaming your php.ini file. It may have a setting in it that your sever doesn't like.

              This line from your error message is very odd (unless it's a typo in your post):

              /home/myserver/mydomain//connectors/


              I don't know how the double slash would get there unless it's in the config.inc.php file.
                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
                Quote from: BobRay at Apr 11, 2018, 06:46 AM
                Check the site_status System Setting in System (gear icon) -> System Settings.

                Also, try renaming your php.ini file. It may have a setting in it that your sever doesn't like.

                This line from your error message is very odd (unless it's a typo in your post):

                /home/myserver/mydomain//connectors/


                I don't know how the double slash would get there unless it's in the config.inc.php file.

                The double slash is my mistake when I was rewriting my original server name and my domain name before posting them to the forum.

                So I think I have found the problem. I was caused by wrong Collation settings in the database. After the installation I was facing the error 500 caused by empty date_timezone value which I resolved by manually set the value. But modx also did not set the collation settings to utf8 during the installation and kept it to cp_1251. After I changed it to utf8_general_ci in phpmyadmin operations everything went back to normal.

                Thanks for the help. I will check if there are another problems but for now the homepage is working. [ed. note: ispasov last edited this post 6 months, 1 week ago.]
                • I'm glad you got it sorted. Thanks for reporting back.

                  I think PHP 7 has more trouble with character set and date/time mismatches than earlier version did.

                  I'll keep that in mind for the future.

                  FYI, I believe SiteCheck would have spotted both of those issues right away.
                    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