MySQL configuration for Yii


I’m a newbie to yii. I first installed Yii in my PC using WAMP. Then I uploaded framework files and the web app I have generated to the server.

i)first i edited the protected/config/main.php file


 'connectionString' => 'mysql:host=localhost;dbname=ztestcms',

 'emulatePrepare' => true,

 'username' => 'myusername',

 'password' => 'mypassword',

 'charset' => 'utf8',


ii) In the local machine I’m having a PageContentController and it was working fine. But whwn I upload these all files to the server (model,controller and view files) the other functionalities (some varible passing from controller to view and accessing them in the view) are there other than the database communication. (those pages are not working)

*Please let me know if there are other configuration to be done? if the file are identical to what i have in the local machine and the remote server what could be the reason for this web app not working properly (I double checked the password and the user name)

Many Thanks,


Have you checked the yii requirements on the server?

Do you get any error?

not need configration, perhaps your PHP env is not good.

can you show your error?

Hi all,

Thanks you very much for your replies. First I was not getting any errors and I re generated the model view and the controller using "Gii" in the local machine and uploaded it to the remote server. Now it is giving out the following error.

include(PDO.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory 

Any help regarding this is much appreciated.

Many Thanks,


Seems you don’t have PDO installed…

as I commented above… first thing on a new server to do is to check the Yii requirements -

Since there is no PDO.php in the yii Package, check the use of Models/Controllers etc with case sensetive. My Local WAMP is non case sensetive but my server uses case sensetive.

So if PDO is a Model check if it is named PDO and not Pdo.

Hi all,

Thank you very much for all your help. I was able to resole the problem. The issue was PDO was not installed in the server. I got the help from server people and this is working fine.

Thanks again for the kind help.