Error in YiiBase.php ( GoDaddy - php 5.2

GODADDY Hosting and PHP 5.2

I’ve tried the the example from "GETTING STARTED _ Creating your first application - page 8

Please see bellow:

-bash-3.2$ ls

data html scc tmp

-bash-3.2$ cd html

-bash-3.2$ YiiRoot/framework/yiic webapp html/testdrive

[b]Content-type: text/html

<br />

<b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in <b>/home/content/54/8638454/html/YiiRoot/framework/YiiBase.php</b> on line <b>64</b><br />

-bash-3.2$

[/b]

Can anybody help with this issue?

Thanks,

Cezar

So you are in the "html" folder… and you want the new webapp to be created under it in the folder "testdrive"… yii is installed under it in the folder "YiiRoot"…

to do that issue this command


YiiRoot/framework/yiic webapp testdrive

I’m getting the same error:

-bash-3.2$ ls

data html scc tmp

-bash-3.2$ cd html

-bash-3.2$ YiiRoot/framework/yiic webapp testdrive

Content-type: text/html

<br />

<b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in <b>/home/content/54/8638454/html/YiiRoot/framework/YiiBase.php</b> on line <b>64</b><br />

-bash-3.2$

I checked the YiiBase.php and it looks OK.

can’t say what is the problem as this works for me… could be something with the server settings as you are on godaddy, can’t say for sure…

In any case it’s better to create the complete application localy and then just upload the finished application on the server…

some "general" ideas:


php -v

Hi,

Something is weird with Godaddy:

the requirements test passed

phpinfo() reports : PHP Version 5.2.17

however

-bash-3.2$ php -v

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

-bash-3.2$

I’m new to Linux so I’m a little bit confused and still need help.

Thanks,

Cezar

Finally, after I found whe godaddy has php5 for CLI:

/usr/local/php5/bin/php

-bash-3.2$ alias php=’/usr/local/php5/bin/php’

-bash-3.2$ php -v

PHP 5.2.17 (cli) (built: Jan 14 2011 10:43:06)

Copyright © 1997-2010 The PHP Group

Zend Engine v2.2.0, Copyright © 1998-2010 Zend Technologies

Then I modified the first line in yiic to:

#!/usr/local/php5/bin/php

AND EVERYTHING IS WORKING FINE NOW.

Thanks mdomba,

Thx, this is what I’m looking for!

I had the same problem! ;)