Requirements ok - error message creating shell

Any help is appreciated. Install on shared Unix host running PHP 5.2.8. Requirements as follows:

PHP version Passed Yii Framework PHP 5.1.0 or higher is required.

$_SERVER variable Passed Yii Framework

Reflection extension Passed Yii Framework

PCRE extension Passed Yii Framework

SPL extension Passed Yii Framework

DOM extension Passed CWsdlGenerator

PDO extension Passed All DB-related classes

PDO SQLite extension Passed All DB-related classes This is required if you are using SQLite database.

PDO MySQL extension Passed All DB-related classes This is required if you are using MySQL database.

PDO PostgreSQL extension Warning All DB-related classes This is required if you are using PostgreSQL database.

Memcache extension Warning CMemCache

APC extension Warning CApcCache

Mcrypt extension Passed CSecurityManager This is required by encrypt and decrypt methods.

SOAP extension Passed CWebService, CWebServiceAction

GD extension Passed CCaptchaAction

When I attempt to create a shell I get the following error:

<b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in <b>/path/yii/framework/YiiBase.php</b> on line <b>59</b><br />

Is this a permissions problem? Am I using an incorrect terminal command? Thanks in advance for your comments.


If i remember well, that’s when the command line version is PHP 4. Check with

php -v

PHP is 5.2.8. Thanks.

Please do the check on command line ;). I’m pretty sure, that’s the problem. PHP versions can differ for webserver module and command line version. Depends on your hosters setup.

Mike, guess what… your right. I was checking version through phpinfo and not the command line. Your command line check reveals:

PHP 4.4.9 (cgi-fcgi) (built: Dec 22 2008 11:30:09)

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

My question is now what? This is a shared host. I requested they install php 5 and they apparently did but the command line is only seeing PHP version 4.4.9. I don’t know how to direct Yii to use it. Is it a simple command line request or something different. I’m excited about using yii for a new project as it will give me the opportunity to learn the framework and create something. Your help is greatly appreciated.



I apologize, I’m assuming too much. I just followed the link you suggested with someone having the same problem. I’ll follow that through and see if it works for me. I need to report back to real life for a few hours. Then I’ll report back to this thread after trying for a solution. Thanks again for your help.


It’s possible that also a PHP 5 version of the php executable is available. If you want to play a little more, you can try to search for all files named “php”:

find / -type f -name php

This can take some minutes. But the executable file doesn’t necessarily have to be named like that. So even if you don’t find anything PHP 5 still might be available. That’s what only your hoster will be able to tell.


I got right to it and first ran the command line:

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

followed by

php yiic webapp ../directory_you_want_shell_in

BAM… shell was created!

This was my first experience using the forum. If all my future problems go as easy, I’m thrilled to be part of the yii community. Thanks again to Mike!