Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Magento PHP 5.3
 
dgrove153
Jr. Member
 
Total Posts:  2
Joined:  2009-12-11
 

megento sucks and wasted much of my time with this foolishness, time to move to a new cart

that is all.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lamer4o
Jr. Member
 
Total Posts:  4
Joined:  2009-12-20
 
naujasdizainas.lt - 06 August 2009 10:54 AM

Phil Freo - 03 July 2009 09:03 AM
Another bug report about it: http://www.magentocommerce.com/bug-tracking/issue/?issue=6662
This one is currently “assigned”

does not the whole code, but try to change in file /lib/Varien/Object.php on line ~ 484

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

To this (change ___toString to __invoke

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

And in file /app/code/core/Mage/Core/Controller/Request/Http.php on line 274

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

to

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

split to explode

Yes i did this and now i get this error can some one help??

Parse error: syntax error, unexpected T_VARIABLE in E:\XAMPP\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Session\Abstract\Varien.php on line 81

 
Magento Community Magento Community
Magento Community
Magento Community
 
demonkoryu
Guru
 
Avatar
Total Posts:  328
Joined:  2008-11-26
Dortmund, Germany
 

Yes i did this and now i get this error can some one help??

Unless you post the offending code, no. There are no psychics here (at least not that I know). rasberry

 
Magento Community Magento Community
Magento Community
Magento Community
 
snowman58
Member
 
Total Posts:  54
Joined:  2009-04-09
 
naujasdizainas.lt - 06 August 2009 10:54 AM

Phil Freo - 03 July 2009 09:03 AM
Another bug report about it: http://www.magentocommerce.com/bug-tracking/issue/?issue=6662
This one is currently “assigned”

does not the whole code, but try to change in file /lib/Varien/Object.php on line ~ 484

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

To this (change ___toString to __invoke

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

And in file /app/code/core/Mage/Core/Controller/Request/Http.php on line 274

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

to

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

split to explode

Thanks, this saved my bacon!

For others following this advice, note that I found the second patch at line 251 instead of 274. If you don’t find it using a specific line number, you can always search for the code to be changed.

Thanks Again!

 
Magento Community Magento Community
Magento Community
Magento Community
 
mercedess
Jr. Member
 
Total Posts:  5
Joined:  2010-01-01
 

Using a Remi repo to install the latest version gets you to v5.3. It’s obvious that the benchmarking practices for Varien need to change.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cirilo
Jr. Member
 
Total Posts:  2
Joined:  2008-12-14
 

Hi,

Can you send me a php.ini file that really works, please?

Best regards,
Ed

http://www.yogashop.com.pt

 
Magento Community Magento Community
Magento Community
Magento Community
 
Walrus
Jr. Member
 
Total Posts:  2
Joined:  2008-10-07
Perth Australia
 
ilib - 02 September 2009 02:15 AM

See attached file. Please backup all the files of magento installation and unzip this file into magento directory

Thanks for the file - it fixed my problems - your effort and contribution is very much appreciated!

 
Magento Community Magento Community
Magento Community
Magento Community
 
modir
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2010-02-01
Zurich, Switzerland
 

I solved the problem in a little bit different way than all the others did. Because if you change the settings only in php.ini it will not work under all circumstances. I did the following:

In /var/www/html/app/code/core/Mage/Core/Model/App.php I changed the following function like this:

public function setErrorHandler($handler)
{
set_error_handler
($handlerE_ALL E_DEPRECATED);
return 
$this;
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
amartinez
Guru
 
Avatar
Total Posts:  347
Joined:  2008-11-14
Spain
 

I do the next steps:

find lib/ app/ -type f -exec sed ‘s/\ split(/\ explode(/g’ -i {} \;
find lib/ app/ -type f -exec sed ‘s/\.split(/\.explode(/g’ -i {} \;

cp -a lib/Varien/Object.php lib/Varien/Object.php.bak
vi lib/Varien/Object.php

search and replace:

/**
     * Convert object attributes to string
     *
     * @param  array  $arrAttributes array of required attributes
     * @param  string $valueSeparator
     * @return string
     */
    /*
    public function __invoke(array $arrAttributes = array(), $valueSeparator=',')
    {
        $arrData = $this->toArray($arrAttributes);
        return implode($valueSeparator, $arrData);
    }

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

cp -a app/code/core/Mage/Core/Model/App.php app/code/core/Mage/Core/Model/App.php.bak
vi app/code/core/Mage/Core/Model/App.php

search and replace:

/**
     * Redeclare custom error handler
     *
     * @param   string $handler
     * @return  Mage_Core_Model_App
     */
    public function setErrorHandler($handler)
    
{
        
// set_error_handler($handler);
        
set_error_handler($handlerE_ALL E_DEPRECATED);
        return 
$this;
    
}

I hope it helps

 
Magento Community Magento Community
Magento Community
Magento Community
 
amartinez
Guru
 
Avatar
Total Posts:  347
Joined:  2008-11-14
Spain
 

ah! to solve the php 5.3 short tag problem:

find libapp/ -type f -exec sed 's/<?$/<?php /g' -i {} \;
find libapp/ -type f -exec sed 's/<? /<?php /g' -i {} \;

it’s better to go up and prepare our code for future versions smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
ronniee
Jr. Member
 
Avatar
Total Posts:  3
Joined:  2009-10-27
Dhaka, Bangladesh
 

Thanks naujasdizainas, it works for me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
zbyte
Jr. Member
 
Total Posts:  6
Joined:  2010-03-23
 

Thanks all for these tips.

To get the suggestions from amartinez to work on Mac OS X 10.6, I had to tweak the sed commands, like so

find libapp/ -type f -exec sed -'s/split(/explode(/g' -'' {}  \;
find libapp/ -type f -exec sed -'s/\.split(/\.explode(/g' -'' {}  \;

Note the inclusion of ‘-e’ in the sed command. Mac’s sed seems to be finicky about that.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cyrus.antonius
Jr. Member
 
Total Posts:  1
Joined:  2010-08-04
 
naujasdizainas.lt - 06 August 2009 10:54 AM

Phil Freo - 03 July 2009 09:03 AM
Another bug report about it: http://www.magentocommerce.com/bug-tracking/issue/?issue=6662
This one is currently “assigned”

does not the whole code, but try to change in file /lib/Varien/Object.php on line ~ 484

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

To this (change ___toString to __invoke

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

And in file /app/code/core/Mage/Core/Controller/Request/Http.php on line 274

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

to

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

split to explode

 
Magento Community Magento Community
Magento Community
Magento Community
 
danpop
Jr. Member
 
Total Posts:  4
Joined:  2009-08-31
 

thanks ilib

you saved me from a terrible headache.

 
Magento Community Magento Community
Magento Community
Magento Community
 
emmenko
Sr. Member
 
Total Posts:  96
Joined:  2010-10-20
 

Hi,

I just found this topic but I don’t really understand....is there a problem using PHP5.3???

Because I’m using MAMP server with php5.3 and the magento ver. 1.4.1.1 (and I’m still working in localhost) and I’m getting problems with the script for the cron...the import in backend works without problems but I’m stucked setting up the cron...I’m using the scripts provided by amartinez!

So maybe my problems are caused by this version of php??? Or it has nothing to do with that?

Nicola

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top