We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6531
    • 154 Posts
    About 5 years ago I set up a Modx website for a client. I don't even remember which version it was.

    The good news: it held up for 5 years without a hitch, and basically zero maintenance. Amazing!

    The bad news: now their hosting has gone and upgraded PHP to version 5. Site is broken. It just shows "

    « 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:	/home/hybridtv/public_html/manager/includes/document.parser.class.inc.php	 
      Line:	844	 
      Line 844 source:	$tempSnippetParams= split($splitter, $tempSnippetParams);


    What is our most cost/time-effective option here?

    Do we need to rebuild the site with a new ModX?
    Can it be 'converted' ?
    How do I find out which version it was? I know it was from before all the chunk/snippet tags got changed.

    Or move to a host that still supports PHP 4?

    Client obviously wants to get back up and running as quickly as possible.

    Thanks!
      • 9995
      • 1,613 Posts
      fourroses666 Reply #2, 12 years ago
      Best thing to do is update to the latest version.
      Backup your files and database first.

      I have no php skills but you could track down the split() function on the line 844.

      explode is an alternative. However, if you meant to split through a regular expression, the alternative is preg_split instead.

      source: http://stackoverflow.com/questions/2813241/php-split-alternative
        Evolution user, I like the back-end speed and simplicity smiley
        • 13428 ☆ A M B ☆
        • 1,031 Posts
        You have been very lucky that your installation was not defaced/hacked in the last 5 years.

        Backup your installation and update it as soon as possible to 1.0.14 (latest bugfix version from here: https://github.com/modxcms/evolution/archive/bugfix.zip). That one is compatible to PHP 5.4 (5.5 if warnings are disabled).

        I would suggest the alternate method.
          • 6531
          • 154 Posts
          How can I figure out which version exactly is installed? Is it in any of the modx files on the server?

          And does upgrading to 1.0.14 involve re-writing all my custom snippets? Will old snippets work?
          Very nervous ....

          thanks
            • 13428 ☆ A M B ☆
            • 1,031 Posts
            Quote from: danzg at Oct 09, 2014, 01:15 PM
            How can I figure out which version exactly is installed? Is it in any of the modx files on the server?
            Could maybe been found in system_settings table.
            Quote from: danzg at Oct 09, 2014, 01:15 PM

            And does upgrading to 1.0.14 involve re-writing all my custom snippets? Will old snippets work?

            That is one reason for the backup …
              • 6531
              • 154 Posts
              The SQL has:

              INSERT INTO `modx2_system_settings` 
              VALUES ('manager_theme','MODx'),
              ('settings_version','0.9.6.1B')


              So that means it's version 0.9.6.1B, right?
                • 13428 ☆ A M B ☆
                • 1,031 Posts
                Yes, very old …

                Clear manager and system logs in the backend (will reduce the database size), backup and maybe run the installation twice.
                  • 6531
                  • 154 Posts
                  Quote from: Jako at Oct 09, 2014, 02:01 PM
                  Yes, very old …

                  Clear manager and system logs in the backend (will reduce the database size), backup and maybe run the installation twice.

                  'in the backend' -- you mean from manager? Impossible, since site won't even load. Or should I manually delete them from the mysql dump?

                  The only way I can backup is with mysql dump...
                    • 13428 ☆ A M B ☆
                    • 1,031 Posts
                    Sorry, forgot that is does not load. Truncate modx_event_log and modx_manager_log with mysql.
                      • 6531
                      • 154 Posts
                      Thanks! The upgrade seems to have worked.