We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27160
    • 50 Posts
    I am getting the following error in my browser when I try to access my domain. "Serverpath" is my account, but the rest is exactly as it appears.

    « MODx Parse Error »

    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: Function split() is deprecated
    Error type/ Nr.: - 8192
    File: /serverpath/htdocs/shyflower/manager/includes/document.parser.class.inc.php(814) : eval()'d code
    Line: 2

    Parser timing
    MySQL: 0.0080 s (3 Requests)
    PHP: 0.0181 s
    Total: 0.0261 s

    When I try to access the manager, I get this after I input my username and password. I've uploaded the image since 1) all of the text doesn't display and there is no scroll bar and 2) it's a lot of text!


      Linda Jenkinson
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      It looks as if your server got a PHP upgrade. If you're not up to digging through your snippets and correcting the outdated code, you can change the error-reporting setting in the index.php files.

      Try changing line 62 of your index.php file to this:
      error_reporting(E_ALL ^ (E_NOTICE | E_WARNING | E_DEPRECATED));


      The same thing is in line 70 of the /manager/index.php file.
        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
        • 40447
        • 165 Posts
        Did your host upgrade to php 5.3.x ? Function split() has been deprecated as of php version 5.3.0.
        Downgrade your php version on your local server and look if the error message disappears. If so, replace function split() with function explode()
          • 27160
          • 50 Posts
          Thanks guys. I'll try that and let you know how it works, but don't wait by the phone! It might take me awhile. smiley
            Linda Jenkinson
            • 3749
            • 24,544 Posts
            Do you have the current version of MODX Evolution? Just upgrading MODX might solve your problem.


            ------------------------------------------------------------------------------------------
            PLEASE, PLEASE specify the version of MODX you are using.
            MODX info for everyone: http://bobsguides.com/modx.html
              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
              • 27160
              • 50 Posts
              Hi all. I would love to tell you that one of your ideas worked, but the truth is that I gave up working on it yesterday before terminal frustration set in and today "poof" it magically appeared again. I can get into the manager and the site is back online.

              However, I have copied/pasted your ideas for "next time". I always wait for the other shoe to drop. smiley

              Thank you all for your help. Even if it didn't work today, it may work tomorrow and I learned something as well!
                Linda Jenkinson
                • 3749
                • 24,544 Posts
                Possibly your hosting service got around to updating the error reporting level. wink


                ------------------------------------------------------------------------------------------
                PLEASE, PLEASE specify the version of MODX you are using.
                MODX info for everyone: http://bobsguides.com/modx.html
                  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
                  • 30023
                  • 172 Posts
                  The PHP error reporting level should have no effect as the MODx DocumentParser class sets an error handler for E_ALL (see DocumentParser::executeParser()).

                  From the PHP manual (http://php.net/manual/en/function.set-error-handler.php):
                  It is important to remember that the standard PHP error handler is completely bypassed for the error types specified by error_types unless the callback function returns FALSE. error_reporting() settings will have no effect and your error handler will be called regardless

                  As such, regardless of server settings the MODx error handler is always invoked for E_ALL - which unfortunately includes E_DEPRECATED.

                  A possible fix for the deprecated functions issue (other functions are also affected, most commonly - in my own experience - the ereg functions) is here https://github.com/ClipperCMS/ClipperCMS/commit/8ed34c799d861d7701d68749502163023c96fa18

                  -- Tim.


                  [ed. note: TimGS last edited this post 14 years ago.]
                    • 27160
                    • 50 Posts
                    Thanks, I'll bookmark it for next time! laugh
                      Linda Jenkinson