Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

gsexton on "PHP Version Strangeness - Different versions in same host"

$
0
0

I have a plugin that needs PHP 5.3 or higher. A customer has reported a problem. In my code I have:

if ( !defined( "PHP_MAJOR_VERSION" ) || // PHP_MAJOR_VERSION came in 5.2.7
( PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3 )) {
// We need at least 5.3 to get the DateTime class.
$cdaily_version_check=false;
} else {
$cdaily_version_check=true;
}

later in the code I have:

if ( !$cdaily_version_check ) {
echo '<div class="error cdaily-error"><p>'.__('Your system is using PHP version '.phpversion( ).'. The minimum supported PHP version for this plugin is 5.3.0, released June 2009. Please ask your system administrator to upgrade your PHP version to at least 5.3.','cdaily_plugin').'</p></div>';
}

When I go to my configuration page it displays the version as 5.2.17. I shoved phpinfo() into my page and it reports 5.2.17 with server API being "CGI".

However when I go to a page that he has, it shows version 5.3.28 with server API being "CGI/FastCGI"

It really appears that the "wp-admin" path is running in a different version of PHP than other parts of the virtual host or even other paths like /wp-content/. Has anyone ever seen anything like this?

The hosting company is web-hosting. Has anyone ever seen this where parts of a host run in one version of PHP and other parts run in a different version?


Viewing all articles
Browse latest Browse all 8245

Trending Articles