Why WordPress and some of my plugins require PHP 5.2

WordPress 3.2 will require PHP 5.2 or higher, as a result of which I’ve decided that my WordPress SEO plugin, currently still in beta, will also require PHP 5.2 and I will probably start having the same requirements for future version of my other plugins. This saves me time coding and testing against a version of PHP that is broken, slow and generally not always easy to work with.

It’s not that my plugin requires it per se right now to do what it does, although, knowing that for instance json_encode is always there is a great improvement. It’s really the fact that it saves me testing time on older systems. As of the last release, because of that, my WordPress SEO plugin will automatically disable itself when it detects that you’re running a PHP version lower than 5.2, linking to this post.

Let me say this: if you’re hosting with a hosting company, and they still offer you PHP4 as a default, they’re daft and I wouldn’t trust them. I’ve written extensively about what I think about WordPress Hosting, it might be a good idea for you to review that and switch hosting to WestHost or VPS.net now if you encounter that issue.

Tags: , ,


Yoast.com runs on the Genesis Framework

Genesis theme frameworkThe Genesis Framework empowers you to quickly and easily build incredible websites with WordPress. Whether you're a novice or advanced developer, Genesis provides you with the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go.

Read our Genesis review or get Genesis now!

45 Responses

  1. Ed HarrisBy Ed Harris on 11 April, 2011

    That is a very smart approach Joost.

    While there’s a common practice of “If it works don’t fix it” among many website owners I can never realize how can people struggle to migrate to PHP 5.x.

    If nothing else, the security and features that PHP 5.x offers in contrast with 4.x, is like comparing a Mercedes SLR with a rusty old Yugo.

  2. Chris WiegmanBy Chris Wiegman on 11 April, 2011

    I wish more would require the later versions. I’ve seen so many issues in various organizations due to legacy versions of the AMP stack. Hopefully many more will follow your lead.

  3. Andy TowlerBy Andy Towler on 11 April, 2011

    Good plan. I have done something similar for a while now – all my publicly-released plugins will only run on PHP 5 or newer, whether or not they actually use PHP 5 technology. I should probably update this requirement to PHP 5.2 :-)

  4. donnacha of WordSkillBy donnacha of WordSkill on 11 April, 2011

    I couldn’t agree more – while the stated goal of making WordPress accessible to as many people as possible is, on the face of it, laudable, the reality is that holding back the platform and placing an additional burden on plugin creators has wasted potential that could be benefitting everyone.

    Instead of creating an artificial environment in which lazy webhosts are under no real pressure to update their servers, WordPress should be forging ahead and forcing the tardy minority to keep up with the far larger majority who are doing their job properly.

  5. André ScholtenBy André Scholten on 11 April, 2011

    What about the people that run websites that can’t be moved to another host because of company rules? It’s not that all webmasters are free to decide such a thing. And not all webmasters are capable of moving their site from their old host to another. Wouldn’t it be better to tell people you will drop support in 6 months?

    • Joost de ValkBy Joost de Valk on 11 April, 2011

      WordPress 3.2 is the reason I did this, I won’t do it for my stable plugins, but I do have a policy of only supporting the two latest major versions of WordPress. It’s just too cumbersome to do more.

      Also, if you have a company policy that keeps you on PHP4, which is now 10+ years old, your sysadmin and/or management deserve to be fired.

  6. Jurrell KempBy Jurrell Kemp on 11 April, 2011

    If I upgrade will I have to replace all of plugin that I already have that work for 3.1 and older versions or will it be just certain ones?

  7. NileshBy Nilesh on 11 April, 2011

    Yes nice approach. Always want new plugin compatible with latest versions of wordpress and PHP.

  8. DaveNBy DaveN on 11 April, 2011

    5.2 series is NOT supported anymore by php… 5.3 fixed a big security hole !! when you upgrade to 5.3 maybe I will look at it again :)
    Dave

    • Joost de ValkBy Joost de Valk on 11 April, 2011

      Hey I’m with you mate, but I thought I’d give people some time, after all, it’s only been 4,5 years since PHP 5.2 was released :D My servers are all 5.3+ :)

    • RamoonusBy Ramoonus on 12 April, 2011

      You should blaim providers, not yoast

  9. EricBy Eric on 11 April, 2011

    Maybe say, “Why WordPress and some of my plugins require PHP 5.2 or higher

    My servers were just upgraded to 5.3.6, which caused some problems with WordPress (still using ereg). We fixed the problems in the php.ini error settings, but when I read that you were only going to support 5.2, I was a little afraid! Glad to see I’ll be OK running PHP 5.3

  10. NicoleBy Nicole on 11 April, 2011

    Gosh, I’m just an artist so not good at this stuff. I called my host, who I like A LOT and they upgraded me to php 5. Is that good enough? That’s all they have, according to them, is that possible? Will the plugin work now? If not, thank you very much for the span it worked in, and wishing you all the best – it’s out of my hands from here! -Nicole

    • Joost de ValkBy Joost de Valk on 11 April, 2011

      That would probably be enough, you’ll see soon enough when you upgrade!

      • NicoleBy Nicole on 11 April, 2011

        It worked! Yahoooo! Yippeee-I-Ooooooh! THANK YOU!

        • YasserBy Yasser on 12 April, 2011

          Joost the Best :)

  11. chooseBy choose on 12 April, 2011

    I am kind of shock when I heard you said that wordpress is still allows plugin under 5.3 to be used there, is that mean php 6.0 will need to wait for another decade before showing up? Sorry about those money making stuff on your blog yesterday, I will start to talk technical with you from now on in your technical article and talk money with you on money related article, how does that sound to your goodself?

    • RamoonusBy Ramoonus on 12 April, 2011

      PHP 6 is a different story

      • chooseBy choose on 12 April, 2011

        PHP 6, yes I have a peek at it but most of the server still at 5.3 so it will take time…

        • RamoonusBy Ramoonus on 12 April, 2011

          where is php 6?
          nowhere!

          • chooseBy choose on 12 April, 2011

            it is interesting to read about php 6 but will it
            be here soon? I wonder…

          • RamoonusBy Ramoonus on 14 April, 2011

            You don`t seem to know the story about PHP 6 ……

  12. Kasper BergholtBy Kasper Bergholt on 12 April, 2011

    Does anyone know what the expected performance gain will be? 10%? 30%?

    • RamoonusBy Ramoonus on 12 April, 2011

      On WordPress, this plugin or total?

      • chooseBy choose on 12 April, 2011

        hi, if you have any plugin with php 5.x let me know, I will review it and post on my blog.

      • Kasper BergholtBy Kasper Bergholt on 12 April, 2011

        @Ramoonus — total.

        • RamoonusBy Ramoonus on 13 April, 2011

          that depends on which features/functions you use

  13. AdrianBy Adrian on 12 April, 2011

    I will be checking mine.

  14. CameronBy Cameron on 12 April, 2011

    Hey Joost,

    Thanks for addressing this issue. I actually checked out my server a little more and realized that I had the option to update the PHP version I’m using after all, so I’m on PHP 5.2.17 now.

    Love your work! Thanks!

  15. chooseBy choose on 13 April, 2011

    Hi Joost, thanks for reviewing my video plugin and telling me you don’t understand how to use it plus not encouraging people to use it, here is the sample page, hope you can take a look
    http://todayprofits.gadgets-code.com/2011/01/14/my-beautiful-tubes-putting-all-together/
    does it works?

    As for PHP 5.3, this should not be a problem for most of the wordpress users around the world, I think.

  16. Kasper BergholtBy Kasper Bergholt on 13 April, 2011

    That’s pretty obvious! ;)

    Let’s take a fresh intall with no plugins activated as an example then. What’s the expected optimization gain?

  17. TedBy Ted on 14 April, 2011

    I am running PHP 5.2.14, but the plugin does not detect it properly. Back to Headspace, I suppose. Too bad, because I really liked the features of yours.

    • ChandraBy Chandra on 18 April, 2011

      I’m having the same problem. I am running 5.2.17, but no dice. I really wanted to have a good SEO setup.

    • TedBy Ted on 21 April, 2011

      And, yes, I am running WP 3.1

  18. MarcusBy Marcus on 14 April, 2011

    adding to your thoughts on hosts that won’t switch, I like to remind users that PHP 5 was released in mid-2004, I think 7 years is enough upgrade time for a good hosting company :)

  19. Rhys WigginsBy Rhys Wiggins on 20 April, 2011

    Standardizing to the latest and greatest technology is a good move IMO. It forces people to advance, and not let laziness hinder our forward progression.

    Good article as always!

  20. MarcusBy Marcus on 21 April, 2011

    I upgraded to PHP 5.3.6 (and verified it) but Yoast still doesn’t want to work..any ideas anyone?

    • Joost de ValkBy Joost de Valk on 21 April, 2011

      You’re not running WP 3.1 ?

  21. MarcusBy Marcus on 21 April, 2011

    seemed to work after multiple apache restarts. I found this useful for non-tecs like myself

    http://www.how2centos.com/installing-php-5-3-3-on-centos-5-5-tutorial/

  22. marcusBy marcus on 21 April, 2011

    While I am here. Joost…how do we upgrade Yoast, to include the paid MRss features etc.

    • Joost de ValkBy Joost de Valk on 21 April, 2011

      There are no paid features yet at the moment.

  23. Heikki HBy Heikki H on 28 April, 2011

    Well. I guess you’re right about the updates, but I’m not a fan of acts like this. Now I have to move the WordPress update earlier and hope that the Yoast SEO will start working again. Or perhaps contact the hosting company. Or something.

    If this was for a solid technical reason, then I do apologize, and wish that some day WordPress’ update would warn me about possible conflicts like this.

    • Heikki HBy Heikki H on 28 April, 2011

      The server was indeed in 5.1.x, which is actually pretty weird. Sorry for soiling your wall.

Trackbacks

  1. [...] Check for PHP 5.2 – The plugin requires PHP 5.2, as it now makes use of json_decode. The plugin has required PHP 5 for a long time, so this shouldn’t affect many, if any, existing users. There’s now a check to ensure that PHP 5.2+ is installed, if not, the plugin won’t activate and will display a message explaining why not. WordPress itself will also require PHP 5.2 (5.2.4 to be exact) as of version 3.2. I got the idea and implementation for this from Yoast. [...]