Magento on PHP upgrade from 5.2.11 to 5.2.17

I’ve got a VPS which was running PHP 5.2.11 and I decided to upgrade it as;

  • A: There wasn’t any massive changes between those versions and
  • B: The Magento minimum system requirements as of right now are 5.2.13 to 5.3.15

Ideally I would have upgraded the whole box to 5.3 but there is an old 1.3 Magento installation on it with a good client who has no scope to upgrade things right now. I’ve been advised by the hosts Nublue that it just won’t work on 5.3 so for the moment we have an interim upgrade.

Wasn’t really expecting any massive problems but this is Magento we are talking about here. I’ve actually got a right array of Magento versions on that package – 1.3, 1.4, 1.5, 1.6, 1.7 and 1.7.0.2

Two installs threw a wobbly. The 1.3 version crashed out with an error, the fix is using the quelizinha post in the thread below;

http://www.magentocommerce.com/boards/viewthread/56007/P0/

For link rot reasons I will copy it out here;

(to fix backend) Find in lib/Zend/Db/Select.php;

$correlationName = current(array_keys($this->_parts[self::FROM]));

Change to;

$arrayKeys = array_keys($this->_parts[self::FROM]);
$correlationName = current($arrayKeys);

(to fix frontend) Find in app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php;

return current(array_keys($this->_availableMode));

Change to:

$arrayKeys = array_keys($this->_availableMode);
        return current($arrayKeys);

And weirdly even though I have a few 1.7.0 and 1.7.0.2 installs on that VPS (some in development) one of them threw an error that was fixed using this post;

https://storeya.zendesk.com/entries/21029171-magento-error-strict-standards-only-variables-should-be-passed-by-reference-on-line-2658

Again, in case that link disappears – In file lib/Varien/Db/Adapter/Pdo/Mysql.php’ in line 2602 change:’

$key = key(array_intersect_key($condition, $conditionKeyMap));

Change to:

$tmp = array_intersect_key($condition, $conditionKeyMap);
$key = key($tmp);