We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • discuss.answer
    • 38783
    • 571 Posts
    I think it would be worth trying a newer version of PHP. Some people have had problems installing certain extras with PHP versions below 5.4.
      If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

      email: [email protected] | website: https://andytough.com
      • 3749
      • 24,544 Posts
      running PHP 5.3.29

      This is almost certainly your problem. As of PHP 5.4, you can use [] notation for arrays (instead of the traditional array() notation).

      Either MODX or one of your extras is using [] notation and PHP 5.3 doesn't know what to do with it. PHP 5.6 would solve your immediate problem, though PHP 5.6 is no longer supported and was released almost five years ago.

      If I were in your situation I'd upgrade to at least PHP 7.1, which was released in 2016.

      [Update] I didn't see Andy's message before writing this. He definitely got there first with the solution.
        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
        • 38142
        • 91 Posts
        cottagestuff Reply #13, 5 years ago
        Quote from: andytough at Mar 07, 2019, 12:23 PM
        I think it would be worth trying a newer version of PHP. Some people have had problems installing certain extras with PHP versions below 5.4.

        Andy, you have rescued me from a very dark place (especially dark after the demise of Keith Flint). I was just seconds away from clicking the "Buy Now" on the Beaver Builder page, which would have meant scrapping MODX and going over to WP. No need now. The sun is shining. The birds are singing in the trees. The caterpillars have stopped eating all our cabbages.

        Switched over to PHP 7, ran the install again with no problems. Sorted.

        I owe you a coffee, a beer, or a whole barrel of beer.

        Thanks also to you, Bob, for your earlier, tireless assistance.
          • 38783
          • 571 Posts
          I am glad it is all working well for you now. It would have been a sad thing for us all if you had gone over to WP. I also wish that Keith Flint was still with us.
            If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

            email: [email protected] | website: https://andytough.com
          • Mark Hamstra Reply #15, 5 years ago
            FYI, in 2.7.2, that offending line has been switched back to be 5.3 compatible: https://github.com/modxcms/revolution/pull/14461

            That line was introduced in 2.7.0 (by yours truly... sorry) and because I'm so used to not supporting anything before 5.5 in my extras (which is going up to 7.1 in July 2019) that short array notation accidentally made it into the core. Because it has been catching people off guard it's now been changed to be 5.3 compatible again.

            Definitely keep making sure your sites get switched to PHP 7 though. wink
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 3749
              • 24,544 Posts
              @Mark Hamstra -- Mark, aren't there some short array notations in the MODX core? I don't understand why anyone is using them because the old notation is not deprecated and there are a whole lot of people still on PHP 5.3. They certainly should upgrade to PHP 7, but I'm not sure we should be making MODX crash to encourage that.
                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
              • Mark Hamstra Reply #17, 5 years ago
                To my knowledge, no, there are no other short array notations anywhere else in the core. (Note that $foo = array(); $foo[] = 'bar'; does not count as short array syntax; only $foo = [] does).

                Like I said, it wasn't a deliberate minimum version bump, but an oversight on my part that nobody else caught in time. If it would've been a deliberate increase in the minimum version, the setup would've also been updated to tell the user their PHP version is out of date so it wouldn't crash.

                There's very little point in changing existing code just to use short array syntax, agreed. It's Syntactic sugar and 4 saved bytes at best. Easy habit to get into though. wink
                  Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                  Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                  • 3749
                  • 24,544 Posts
                  TBH, I made the same mistake myself in an extra. And Guzzle6 has lots of them, so any extra that uses Guzzle6 will have the same problem, including a couple of my extras.

                    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