Magento PHP 5.3 error

Filed Under (Blog) by Brian Keith on 23-10-2010

Tagged Under : , ,

For those who have noticed this error

Fatal error: Method Varien_Object::__tostring() cannot take arguments in /magento/lib/Varien/Object.php

when trying to install Magento on PHP 5.3, do not fear, here is the fix:

File: /lib/Varien/Object.php (Line 484)

Change from

1 public function ___toString(array $arrAttributes = array(), $valueSeparator=’,')

To this

1 public function __invoke(array $arrAttributes = array(), $valueSeparator=’,')

File /app/code/core/Mage/Core/Controller/Request/Http.php (Line 274)

Change from

1 $host = split(‘:’, $_SERVER['HTTP_HOST']);

To this

1 $host = explode(‘:’, $_SERVER['HTTP_HOST']);

There are several other files with the same problem but you get the idea.

Pasted from <>