Problem with emulatePrepare

Im fairly new with Yii framework and during testing Im getting this error:

constant() [<a href='function.constant'>function.constant</a>]: Couldn't find constant PDO::ATTR_EMULATE_PREPARES

I suspect that it can be problem with my versions of PHP/MySQL:

MySQL + client libraries: 5.0.51

PHP: 5.2.5

But when I set sessions to be DB based, YiiSessions table is correctly updated.

Can anyone suggest a solution for my problem? Cant I use activerecord in my app? Is possible to disable AR in framework?

Also when I commented emulatePrepare variable in configuration file, I got following error:

CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 2030 This command is not supported in the prepared statement protocol yet

PDO::ATTR_EMULATE_PREPARES is a constant defined in PDO extension (since PHP 5.1.3). How did you encounter this problem? If in CLI mode, you may need to check your CLI php's version.

First it was in CLI mode, I have updated PDO package on the box and EMULATE_PREPARES = true solved the problem.

Later I faced it again when Ive generated User model and tried to access it from web. Something was wrong, because when I've updated PDO again (with all 4 sub packages - not only pdo-mysql and pdo as I did before), it suddenly started working. I was afraid that I cant make it work with my older mysql client libraries.

Now its all working fine.

Hmm, strange thing is, that now it is working through web, but not in CLI mode…