We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51717
    • 3 Posts
    Edited a Chunk and when saved the website went down

    Server error

    500

    The website encountered an error while retrieving http://mysite.co.uk/. It may be down for maintenance or configured incorrectly.

    Anyone got any idea what this might be? I removed the edits and re-saved but still not up.

    I'm still able to access the manager page fine.
      • 3749
      • 24,544 Posts
      The chunk is a coincidence. Your host upgraded PHP to a version that requires the date/timezone to be set.
        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
        • 51717
        • 3 Posts
        Resolved this by removing ampersands from the php

        eg.

        // Wrong way!
        myFunc(&$arg); # Deprecated pass-by-reference argument
        function myFunc($arg) { }

        Use:

        // Right way!
        myFunc($var); # pass-by-value argument
        function myFunc(&$arg) { }
          • 3749
          • 24,544 Posts
          I'm glad you got it sorted. Apparently, that triggers the date/timezone error when PHP tries to report the problem and throws a 500 error before the true error gets displayed.

          I still think you have a problem, though, since unless the date/timezone problem is fixed, you'll get an uninformative 500 error on every PHP syntax error.
            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
            • 51717
            • 3 Posts
            Quote from: BobRay at Jan 27, 2016, 12:59 PM
            I'm glad you got it sorted. Apparently, that triggers the date/timezone error when PHP tries to report the problem and throws a 500 error before the true error gets displayed.

            I still think you have a problem, though, since unless the date/timezone problem is fixed, you'll get an uninformative 500 error on every PHP syntax error.

            Ah really? Would you be kind enough to explain what I need to do to fix that? Thanks again for your help!
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              It depends on your server configuration. Check your hosting control panel (CPanel?) to see if it has a feature for editing at least some php.ini configuration settings. You may need to create a php.ini file to put in your root and your manager folder to set it. Or if you use an Apache web server you may be able to set it in the .htaccess file.

              http://php.net/manual/en/datetime.configuration.php
                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