WordPress developers and Theme and Plugin authors use the current PHP version 5.2 for some time, staying current with improvements in coding technology. Current and updated versions should be compliant and you should not run into any problems when you upgrade your hosting to a recent PHP version like PHP 5.2.x or 5.3.x.

In fact, WordPress runs better on PHP 5 than it does on PHP 4. PHP 4 is outdated and WordPress is not much tested to run on it any longer (not as much as PHP 5 by far at least). And for many plugins and themes this is the same, PHP 5.2 is supported right now on most hosts.

Some bugs do only exist when you run WordPress on PHP 4 but they do not exist when you run it on PHP 5. In these cases not PHP 5 but PHP 4 is the problem.

Some WordPress Plugin and Theme authors are working on versions that are only compatible with PHP 5 and its improved features and capabilities. So these do not even work with PHP 4 or older PHP 5 versions.

However, older Themes and Plugins may have PHP code that eventually might not work with every PHP 5 version. Check with the Theme and Plugin authors for the specific requirements of the plugins you're using. PHP 4 is officially end of life since August 2008 (that means no security patches since longer than a year ago). If your plugin has not been updated in years, please look for updated versions, or consider changing to an alternative option.

If you are using non-WordPress-specific code such as JavaScript, gadgets, widgets, or other custom or third-party PHP scripts, check with the original source for updated versions, just in case. Because PHP 5 is mostly backwards compatible you should not run into any problems normally.

Switching from PHP 4 to PHP 5.2 is known to cause an issue wherein gibberish appears above the WordPress blog header related to "open_basedir restriction." It usually runs like this:

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect.
File(/) is not within the allowed path(s):
/usr/local/php4/lib/php:/tmp) in /home/MY_ACCOUNT/wp-includes/functions.php
on line 1942

This can easily be corrected by editing the MySQL table. Search for wp_options and find "option_name = ‘upload_path’" and shorten the value in the column. For example, if the value in it is ‘/home/MY_ACCOUNT/wp-content/uploads,' change it to ‘wp-content/uploads’.

Posted in: PHP, WordPress

Related FAQ's

Marius Ion ANGEL HOT SOFT LLC (800) 316-7677