error on YiiBase.php on line 55

hi …

i have hosting di dreamhost i try using yii for my framework and when a start create aplication something wrong show off like this bellow :

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/.sanders/mydomain/mydomaindotcom/yii/framework/YiiBase.php on line 55

where i can find solution for my problem.

Hi!!

Could you please post your command and i’ll try to help you. I’ve some websites hosted at dreamhost too.

If i remember well some had this problem when the CLI version still was PHP 4. You can check with


php -v

strangger i check in php -v show

[enzo]$ php -v

PHP 4.4.9 (cli) (built: Sep 17 2008 11:04:03)

Copyright © 1997-2008 The PHP Group

Zend Engine v1.3.0, Copyright © 1998-2004 Zend Technologies

with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies


with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

[enzo]$

i check with phpinfo() show php5.

So you should ask your hosting provider wether they also has a PHP 5 binary for the command line available or if they could update it to PHP 5.

Hi,

On Dreamhost hosting you can choose php-cli version:

in command line type:

export PATH=/usr/local/php5/bin/:$PATH

and now you can run yii on command line.

Bye.

I´m sorry for my english

I know this is an old thread, but it gave me a clue as to what my problem was also. thought maybe what I write might help someone else. This maybe 1and1 specific but maybe it’ll help someone else with a similar problem.

When I ran a "php -v" it gave me => PHP 4.4.9

So I remembered that there may also be a php5 executable, so

When I ran a "php5 -v" it gave me => PHP 5.2.17

I could then invoke it like this:

php5 yiic webapp ../../myNewWebApp

and it created my app.

Since the default was to use php4 then at my host, I had to add this to .htaccess also

AddType x-mapp-php5 .php

Which processes the php in the current and subdirectories as php 5.

thanks for the help

Thanks for your tip - but i think “x-mapp-php5” is 1&1 specific (a german provider). So don’t wonder if this doesn’t work elsewhere.

I just got Yii set up on my 1and1 hosting. All i did was open yiic and make this change




#!/usr/bin/env php5  <-- added the 5

<?php

/**

 * Yii command line script for Unix/Linux.

 *

 * This is the bootstrap script for running yiic on Unix/Linux.

 *

 * @author Qiang Xue <qiang.xue@gmail.com>

 * @link http://www.yiiframework.com/

 * @copyright Copyright &copy; 2008 Yii Software LLC

 * @license http://www.yiiframework.com/license/

 * @version $Id: yiic 702 2009-02-18 19:29:48Z qiang.xue $

 */


require_once(dirname(__FILE__).'/yiic.php');



I have not done much more, but that makes the 1and1 php interpreter use the PHP5 binaries.