Magento не работает на PHP 5.3

Столкнулся с тем что надо было поставить Magento на свой локальный сервер. При попытке запустить выдавал ошибку – Fatal error: Method Varien_Object::__tostring() cannot take arguments in /magento/lib/Varien/Object.php.

Решение проблемы. Заходим в этот проблемный файл /magento/lib/Varien/Object.php и изменяем функцию __toString()

Было:

public function __toString(array $arrAttributes = array(), $valueSeparator=',')
    {
        $arrData = $this->toArray($arrAttributes);
        return implode($valueSeparator, $arrData);
    }

Стало:

function __toString()
{
    return $this->__invoke( func_get_arg(0), func_get_arg(1) );
}

После этого нужно изменить еще один файл – /app/code/core/Mage/Core/Controller/Request/Http.php

Находим строку – $host =

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

и изменяем на – $host =

explode(':', $_SERVER['HTTP_HOST'])

После этих плясок с бубном у меня все работает :) Надеюсь в следующих версиях ее пофиксят

This entry was posted in php. Bookmark the permalink.

2 Responses to Magento не работает на PHP 5.3

  1. андре says:

    респект тебе и уважение!!! спасибо

  2. Роман says:

    Огромаднейшее спасибо! сэкономил тучу времени

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>