We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6705
    • 79 Posts

    I’m trying to upgrade a MODx 0.9.6.3 site to MODx 1.0.4 by transferring a copy of the site (with MODx 0.9.6.3) to a test server, and then sliding in the MODx 1.0.4 files and running the upgrader.

    The new server has a newer OS version (a deliberate part of the plan), running PHP 5.3.2. When trying to load up the ’new’ 0.9.6.3 site just to check that the site transfer is OK, I get caught by the Function split() is deprecated problem.

    However, I’m thinking that since I’m imminently about to overwrite the 0.9.6.3 files with 1.0.4 files, I probably don’t really need to worry about whether 0.9.6.3 works all that much. Is 1.0.4 affected by the same E_DEPRECATED problem, or is all of its code ’safe’ for PHP 5.3.x? Even though it’s just a test copy, I don’t want to fire up the upgrader and then find it gets stuck!

    Thanks for any advice.
      Please don't PM me unless it's absolutely essential: if a technical question is worth asking, it's worth asking in public, so that others can share their experience, and so that all can learn from the answers.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      MODx itself is not affected. Some third-party snippets may be. You shouldn’t have a problem upgrading.
        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
        • 25132
        • 129 Posts
        Bumping this one up again as I am having the same problem. I am running MODx 1.0.4 on a host server that was just upgraded to PHP 5.3 and now I suddenly get the added slash problem around my quotation marks.

        I checked this thread: http://modxcms.com/forums/index.php/topic,40996.msg247047.html#msg247047 but don’t know how to solve it with the instructions there as the site is on an external host. Can I access this php.ini file somehow? Apologies for my ignorance.

        If I need to resort to contacting the hosting company to put the site back on a 5.2 server, will I have the same issue with other sites in future? I currently have only one client site with this host but I assume my primary host will start to upgrade as standard at some stage too. This is worrying me!!!
          • 3749
          • 24,544 Posts
          That sounds like your host turned on magic_quotes_gpc when upgrading.

          If there is a php.ini file in the MODx root, add this:

          magic_quotes_gpc = Off


          If there is no php.ini file, just add one with that single line.
            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
            • 3749
            • 24,544 Posts
            Quote from: david55 at Sep 13, 2010, 10:13 AM


            I’m trying to upgrade a MODx 0.9.6.3 site to MODx 1.0.4 by transferring a copy of the site (with MODx 0.9.6.3) to a test server, and then sliding in the MODx 1.0.4 files and running the upgrader.

            The new server has a newer OS version (a deliberate part of the plan), running PHP 5.3.2. When trying to load up the ’new’ 0.9.6.3 site just to check that the site transfer is OK, I get caught by the Function split() is deprecated problem.

            However, I’m thinking that since I’m imminently about to overwrite the 0.9.6.3 files with 1.0.4 files, I probably don’t really need to worry about whether 0.9.6.3 works all that much. Is 1.0.4 affected by the same E_DEPRECATED problem, or is all of its code ’safe’ for PHP 5.3.x? Even though it’s just a test copy, I don’t want to fire up the upgrader and then find it gets stuck!

            Thanks for any advice.


            You can just put this in a php.ini file in the MODx root if you run into trouble (I know SPForm still has causes trouble with this -- haven’t had time to fix it):

            error_reporting = E_ALL &  ~E_DEPRECATED

              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
              • 25132
              • 129 Posts
              Hi BobRay

              Thanks so much for your reply. This might be a silly question but does that text go into the php.ini file without any other enclosing code? I’ve tried to add it (into the MODx root of my installation) but it’s unfortunately made no difference.
                • 3749
                • 24,544 Posts
                Quote from: rivendell48 at Oct 29, 2010, 03:39 AM

                Hi BobRay

                Thanks so much for your reply. This might be a silly question but does that text go into the php.ini file without any other enclosing code? I’ve tried to add it (into the MODx root of my installation) but it’s unfortunately made no difference.

                I forgot that it’s being set dynamically in index.php. That’s overriding your php.ini setting. Sorry about the confusion.

                Undo what you did with the php.ini file. In the index.php file in the MODx root, change:

                error_reporting(E_ALL & ~E_NOTICE);


                to

                error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);


                  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
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Actually Evo itself is not affected by this; the problem is that some commonly used third-party add-ons use the split() function instead of explode() or some other method of breaking up a string. It’s usually pretty simple to just replace the offending split() function with explode() or possibly preg-split().

                  http://php.net/manual/en/function.split.php
                  http://www.php.net/manual/en/function.explode.php
                  http://www.php.net/manual/en/function.preg-split.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
                    • 3749
                    • 24,544 Posts
                    SPForm uses eregi(), which is also deprecated. I haven’t had time to change it and don’t know when I will.
                      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
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Looks like it’s just a matter of replacing eregi() with stristr() on line 144 of spformproc.inc.php. I’ll give it a try a little later; still catching up after moving and two weeks offline!

                      http://www.php.net/manual/en/function.eregi.php
                      http://www.php.net/manual/en/function.stristr.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