Fatal error: Method Varien_Object::__tostring() cannot take arguments

I have got an error for Magento and PHP 5.3.2:
Fatal error: Method Varien_Object::__tostring() cannot take arguments

PHP 5.3.2-1ubuntu4 with Suhosin-Patch
Magento version:

Below solution of this issue:

1. Open lib/Varien/Object.php:484 and replace

public function __toString(array $arrAttributes = array(),


public function  __invoke(array  $arrAttributes = array(),

2. Open app/code/core/Mage/Core/Controller/Request/Http.php:199 and replace

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


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

Split has been DEPRECATED as of PHP 5.3.0.


  • guru |


    This is good post it worked for me
    but there is little problem

    line Open app/code/core/Mage/Core/Controller/Request/Http.php:199 and replace

    i got below code in line no 274

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

  • Cristy |

    I’m on a Mac too and would highly rnmmoceed the VMWare approach for a couple of reasons:1. Getting the LAMP stack right the fact that I can make different VM images for testing is great, the web hosting companies all have slightly different builds and this way I’ve been able to make a stack that emulates as closely as possible the production stack. In addition to case sensitivity things like file permissions/fcgi config/eAccelerator/suhosin/php & mySQL versions have all bitten me as I’ve moved Magento from my localhost to a production server, so having a stack that mimics the live site is indispensable.2. Backups, backing up whole machines and taking snapshots in VMWare is just awesome (just remember to exclude the VMs from Timemachine!) its great to even be able take a whole VM from my mac and put it on a clients local network.The downside of course is the disc space and performance issues running the Mac host and a Linux guest is fine, but throw in a windows guest at the same time for browser testing and it gets a bit painful, I really could do with another 4Gb of ram .

  • ssd |

    Thanks , I have recently been looking for information approximately this subject for ages and yours is the best I have came upon till now. But, what in regards to the conclusion? Are you positive about the source?|What i do not understood is in truth how you’re no longer actually a lot more well-liked than you might be right now. You’re very intelligent.

  • linux server |

    Nice post. I used to be checking continuously this weblog and I am impressed! Very useful information specially the remaining phase :) I deal with such info a lot. I used to be seeking this certain info for a long time. Thanks and best of luck.

  • servidores linux |

    Attractive portion of content. I simply stumbled upon your blog and in accession capital to claim that I acquire in fact loved account your weblog posts. Anyway I’ll be subscribing to your feeds or even I achievement you get right of entry to consistently fast.

  • Muhammad Rudy |

    hello!,I love your writing so so much! share we keep in touch extra approximately your post on AOL? I require a specialist on this space to resolve my problem. May be that’s you! Having a look ahead to peer you.

So, what do you think ?