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.





by Ed Harris on 11 April, 2011 at 15:20
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.
by Chris Wiegman on 11 April, 2011 at 15:30
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.
by Andy Towler on 11 April, 2011 at 15:30
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 :-)
by donnacha of WordSkill on 11 April, 2011 at 15:32
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.
by André Scholten on 11 April, 2011 at 15:48
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?
by Joost de Valk on 11 April, 2011 at 16:13
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.
by Jurrell Kemp on 11 April, 2011 at 15:56
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?
by Nilesh on 11 April, 2011 at 15:59
Yes nice approach. Always want new plugin compatible with latest versions of wordpress and PHP.
by DaveN on 11 April, 2011 at 16:56
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
by Joost de Valk on 11 April, 2011 at 17:08
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+ :)
by Ramoonus on 12 April, 2011 at 11:34
You should blaim providers, not yoast
by Eric on 11 April, 2011 at 16:58
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
by Nicole on 11 April, 2011 at 18:02
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
by Joost de Valk on 11 April, 2011 at 18:18
That would probably be enough, you'll see soon enough when you upgrade!
by Nicole on 11 April, 2011 at 18:23
It worked! Yahoooo! Yippeee-I-Ooooooh! THANK YOU!
by Yasser on 12 April, 2011 at 06:11
Joost the Best :)
by choose on 12 April, 2011 at 02:14
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?
by Ramoonus on 12 April, 2011 at 11:33
PHP 6 is a different story
by choose on 12 April, 2011 at 12:11
PHP 6, yes I have a peek at it but most of the server still at 5.3 so it will take time...
by Ramoonus on 12 April, 2011 at 13:14
where is php 6?
nowhere!
by choose on 12 April, 2011 at 13:46
it is interesting to read about php 6 but will it
be here soon? I wonder...
by Ramoonus on 14 April, 2011 at 10:46
You don`t seem to know the story about PHP 6 ......
by Kasper Bergholt on 12 April, 2011 at 12:02
Does anyone know what the expected performance gain will be? 10%? 30%?
by Ramoonus on 12 April, 2011 at 12:09
On WordPress, this plugin or total?
by choose on 12 April, 2011 at 12:15
hi, if you have any plugin with php 5.x let me know, I will review it and post on my blog.
by Kasper Bergholt on 12 April, 2011 at 14:26
@Ramoonus -- total.
by Ramoonus on 13 April, 2011 at 14:15
that depends on which features/functions you use
by Adrian on 12 April, 2011 at 15:12
I will be checking mine.
by Cameron on 12 April, 2011 at 17:39
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!
by choose on 13 April, 2011 at 14:28
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.
by Kasper Bergholt on 13 April, 2011 at 16:38
That's pretty obvious! ;)
Let's take a fresh intall with no plugins activated as an example then. What's the expected optimization gain?
by Ted on 14 April, 2011 at 16:21
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.
by Chandra on 18 April, 2011 at 05:45
I'm having the same problem. I am running 5.2.17, but no dice. I really wanted to have a good SEO setup.
by Ted on 21 April, 2011 at 12:36
And, yes, I am running WP 3.1
by Marcus on 14 April, 2011 at 17:27
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 :)
by Rhys Wiggins on 20 April, 2011 at 16:16
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!
by Marcus on 21 April, 2011 at 09:54
I upgraded to PHP 5.3.6 (and verified it) but Yoast still doesn't want to work..any ideas anyone?
by Joost de Valk on 21 April, 2011 at 10:21
You're not running WP 3.1 ?
by Marcus on 21 April, 2011 at 10:08
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/
by marcus on 21 April, 2011 at 10:10
While I am here. Joost...how do we upgrade Yoast, to include the paid MRss features etc.
by Joost de Valk on 21 April, 2011 at 10:21
There are no paid features yet at the moment.
by Heikki H on 28 April, 2011 at 15:14
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.
by Heikki H on 28 April, 2011 at 15:35
The server was indeed in 5.1.x, which is actually pretty weird. Sorry for soiling your wall.
Pingback: Google Calendar Events, 0.6
Pingback: Why WordPress and some of my plugins require PHP 5.2 « kianvelde