Problem creating a skeletion yii app in MAC using MAMP

Hi,

Was trying to learn yii and as per the guide setup the yii app on my MAC using the command

%php YiiRoot/framework/yiic.php webapp /myrootweb/

However, i encountered the error below

Parse error: parse error, expecting T_OLD_FUNCTION' orT_FUNCTION’ or T_VAR' or‘}’’ in /Applications/MAMP/htdocs/yiicms/yii/framework/YiiBase.php on line 63

My account has the permission to execute yiic.php

I am running yii 1.1.7.r3135, fresh download from yii website.

My server pass the yii

Can someone advise?

Thanks.

what is the PHP version?

have you checked the Yii requirements - http://www.yiiframework.com/doc/guide/1.1/en/quickstart.installation#requirements ?

Try this command in terminal:




which php



Response should be something like this:




/Applications/MAMP/bin/php5.3/bin/php



If you get something else, your system probably uses a different (older) php version for command line.

the yii/requirements/index shows php version pass :(

i think you are right, the result was /usr/bin/php

Any idea how to change it?

To see the PHP command line version… run from command line


php --version

Add “/Applications/MAMP/bin/php5.3/bin” to the PATH environment variable of your system. Lots of info and tutorial on this subject can be found on the web, if you don’t know how to do it.

I called the php5 on the direct path and it works

Applications/MAMP/bin/php5/bin/php /directoryto/yiic webapp /wwwroot/blog

Thank you all for your advice :)