Page 1 of 1

"You need PHP v5.2+" error even with PHP 5.2.13 installed

PostPosted: June 25th, 2010, 6:51 pm
by PaulieP
I just installed Quick Cache on my WP 3.0 site hosted on a VPS with KnownHost. CentOS.

Checking with my server config and verified by their techs, I have php 5.2.13-1.el5.art active.

However I still get the "You need PHP v5.2+" etc. error no matter what and cannot use Quick Cache.

Is there any way around this problem? Thanks.

Re: "You need PHP v5.2+" error even with PHP 5.2.13 installe

PostPosted: June 26th, 2010, 12:28 am
by Jason Caldwell
Hi Paulie. Thanks for reporting this. The PHP version_compare() function looks at ( -1.el5.art ), and considers that a pre-release version. Pre-release versions, such as 5.2.0-dev, are considered lower than their final release counterparts (like 5.2.0).

What you can do is pop this line into your /wp-config.php file:
Code: Select all
define ("WS_PLUGIN__QCACHE_MIN_PHP_VERSION", "5.2.13-1.el5.art");

Re: "You need PHP v5.2+" error even with PHP 5.2.13 installe

PostPosted: June 26th, 2010, 11:14 am
by PaulieP
Hi, thanks for the reply. Right now that is the latest version that KnownHost has on their servers.

I placed the line in wp-config and I still get the error message about PHP 5.2+ unfortunately..

Re: "You need PHP v5.2+" error even with PHP 5.2.13 installe

PostPosted: June 27th, 2010, 4:11 am
by PaulieP
Actually this is the message:

"You need PHP v5.2.13-1.el5.art+ to use the Quick Cache plugin."

Any ideas? Thanks

Re: "You need PHP v5.2+" error even with PHP 5.2.13 installe

PostPosted: June 27th, 2010, 7:08 am
by Jason Caldwell
Hi Paulie. So you added this to your /wp-config.php file, and it's still not working.
Code: Select all
define ("WS_PLUGIN__QCACHE_MIN_PHP_VERSION", "5.2.13-1.el5.art");

That's interesting.
I tested this locally against two strings and version_compare() handles this OK.

You might try changing it to this, and see if that does the trick for you:
Code: Select all
define ("WS_PLUGIN__QCACHE_MIN_PHP_VERSION", "5.2");

If all else fails, open /plugins/quick-cache/quick-cache.php

At line # 53, change this:
Code: Select all
if (version_compare (PHP_VERSION, WS_PLUGIN__QCACHE_MIN_PHP_VERSION, ">=") && version_compare (get_bloginfo ("version"), WS_PLUGIN__QCACHE_MIN_WP_VERSION, ">=") && basename (dirname (__FILE__)) !== basename (WPMU_PLUGIN_DIR) && !isset ($GLOBALS["WS_PLUGIN__"]["qcache"]))
   {

to just this:
Code: Select all
if (version_compare (get_bloginfo ("version"), WS_PLUGIN__QCACHE_MIN_WP_VERSION, ">=") && basename (dirname (__FILE__)) !== basename (WPMU_PLUGIN_DIR) && !isset ($GLOBALS["WS_PLUGIN__"]["qcache"]))
   {

In other words, you need to remove this portion of the code:
Code: Select all
version_compare (PHP_VERSION, WS_PLUGIN__QCACHE_MIN_PHP_VERSION, ">=") &&

Re: "You need PHP v5.2+" error even with PHP 5.2.13 installe

PostPosted: June 28th, 2010, 2:12 am
by PaulieP
Yes, I entered the first suggestion but it simply generated that newer error message. Your second change, below, did the trick however. Thanks.

define ("WS_PLUGIN__QCACHE_MIN_PHP_VERSION", "5.2");

Re: "You need PHP v5.2+" error even with PHP 5.2.13 installe

PostPosted: June 28th, 2010, 2:45 am
by Jason Caldwell
Thanks for the followup. Glad to hear that worked for you.