Is Yii For Me?

Hi all,

I’ve been looking for a framework mostly to help with a big project I am working on. I had a quick go with CI, and then found Yii which looks really good.

I have a couple of questions really. I first tried using Yii on a shared hosting account, but couldn’t run yiic or yiic.php as the host had limited SSH usage. I have a dedicated server that it will work on, and I have got it to work under wamp on localhost, but some of the work I have to do is on shared hosting. So I need to know if a site developed using Yii and setup with yiic under local host can be moved to a shared hosting account after development and still work?

Q2: I am working on a big project that I started off by hand coding in demo quality! The site relies a lot on geo location which I assume I can code in yii too. However, the geo side uses quite a complicated MySQL query to work out distances accounting for the curvature of the earth etc. Is it possible to do non standard queries in Yii? Also I have integrated vBulletin forums in the site so that when user logs into the main site they are logged into the forums too. To do that I based my login system on that of vBuletin’s so it uses the same sessions etc. Would I be able to do that with Yii too?

Excuse the silly questions, but I need to try and know which framework is best for me before I spend ages learning it!


I have just uploaded the testdrive application to the shared host, and I get a connection connecting to the MySQL database.

The database config in config file is set right. What might the issue be?

I also had to change the path to yii.php in the index.php to the full server path as FILE was pointing to the side directory and subdirectory.

Can you post the Database configurations defined in config.php ? (mask the user name & password) also what is the database your trying to connect with ?

Thanks for your reply. The database issue was that I needed to add the path to the mysql sock in the config as it wasn’t able to find it without.

Hi 35mm,

Absolutely. The console usage is fully optional but quite useful, especially to execute database migrations. The generation of CRUD files or models (if needed) is more comfortable to achieve with gii (see the guide for more informations)

Yes, you can rely on the active record implementation for standard stuff, but you also can manipulate a query in whatever way you want (or simply create a RAW SQL Query)

Yes - by default yii also uses the sessionid to store all user relevant informations - which is basicly what you need I guess. Anyways: You are also free to use cookies or even the IP Adress of the user or whatever is suiteable to identify a user by overriding the CHttpSession class (or using an existing implementation).

These questions are far from silly.

If you need concrete examples of how to implement/achive a feature - don’t hesitate to ask