tags:

views:

199

answers:

2

I am trying to install magento (e-commerce platform)

I am following a tutorial that tells me to run this command using ssh: ./pear mage-setup

but i'm getting this error:

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/domainname.com/downloader/pearlib/php/System.php on line 400

Line 400 is commented in the code snippit from the system.php file:

   /* Magento fix for set tmp dir in config.ini
     */
    if (class_exists('Maged_Controller',false)) {
        /*line 400 */
        $magedConfig = Maged_Controller::model('Config',true)->load();**
        if ($magedConfig->get('use_custom_permissions_mode') == '1' && 
            $mode = $magedConfig->get('mkdir_mode')) {
            $result = System::mkDir(array('-m' . $mode, $tmpdir));
        } else {
            $result = System::mkDir(array('-p', $tmpdir));
        }

        if (!$result) {
            return false;
        }
    }

Can anyone help my demystify this error?

A: 

I'm wondering what the double-stars are on the fifth line:

                         #                             here - v
$magedConfig = Maged_Controller::model('Config',true)->load();**

Edit: You are attempting to use "chaining" ($obj->func()->otherFunc()) which is only supported in PHP5:

$magedConfig = Maged_Controller::model('Config',true)->load();

Change the line to this:

$magedConfig = Maged_Controller::model('Config',true);
$magedConfig = $magedConfig->load();

Your other option is to upgrade to PHP 5, but at this point in the game, it might break your code.

amphetamachine
oops... that was my attempt to comment that line for the purpose of the question... they are not actually in the file
Jane
Thanks so much for your help. I changed the code as per your suggestion, and there are other errors happening. Also, my dreamhost accound says that i'm using php5-fastCGI. Is this ok? Is there something else that I should do to make sure i'm running PHP5?
Jane
If you can install Magento you're running PHP 5. Magento won't run on anything below 5.2
Alan Storm
A: 

Verify that you meet the following requirements:

http://www.magentocommerce.com/system-requirements

Magento only runs on php 5.2.x, not 5.3. Also make sure the extensions listed on the requirements page are enabled.

Might be different for you, but I can check the php version using

php -v
dardub