Magento install error with php 5.3

When you install magento with php 5.3 then you have 3 problem.

1. installation problem
2. visiting problem in front end
3. login problem in admin panel.

Installation problem

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

Solution :

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

Change from

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

To this

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

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

Change from

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

To this

$host = explode(‘:’, $_SERVER[‘HTTP_HOST’]);
Visiting problem in front end
Problem : SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘765’ for key ‘PRIMARY’

Solution : Go “Cache Management” then disable all cache and run.

Login problem in admin panel

Problem :

Unknown error (8192): Function split() is deprecated in  File\app\code\core\Mage\Admin\Model\User.php on line 374

Solution :

Replace

$nodePath = ‘adminhtml/menu/’ . join(‘/children/’, split(‘/’, $startupPage)) . ‘/action’;

to

$nodePath = ‘adminhtml/menu/’ . join(‘/children/’, explode(‘/’, $startupPage)) . ‘/action’;

Visiting category problem

Problem:

Invalid method Varien_Object::__toString(Array
(
[0] => Array
(
) [1] => _
)
)

Solution:

// in : /magento/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php
//Change this :
$key.= $taxReq->__toString(array(), '_');

//To this :
$key.= $taxReq->__invoke(array(), ‘_’);

$nodePath = ‘adminhtml/menu/’ . join(‘/children/’, split(‘/’, $startupPage)) . ‘/action’;

4 thoughts on “Magento install error with php 5.3

  1. If you want to install Magento version 1.3.2 in PHP version 5.3

    You need to change the split() by explode() in

    /app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-install-0.1.0.php

    and

    /app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.0-0.1.1.php

    Take care

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s