Yii PDO.php error: failed to open stream – Two Solutions [Solved]

There are two options for you when you suffer the following error,
include(PDO.php): failed to open stream: No such file or directory

1. recompile the php build
2. Use PDO equivalent module of Yii framework

recompile the php build
Use phpinfo() to check if the compile parameter –enable-pdo and –with-pdo-mysql is enable. If they are disabled, you have to recompile your php.

Use PDO equivalent module of Yii framework
a) download http://www.yiiframework.com/extension/phppdo
b) configure in main.php

'db'=>array(
    'connectionString' => 'mysql:host=localhost;dbname=YouDBname',
    'class'=>'application.extensions.PHPPDO.CPdoDbConnection',
    'pdoClass' => 'PHPPDO',
    'emulatePrepare' => true,
    'tablePrefix' => 'xxx_',
    'username' => 'xxxx',
    'password' => 'xxxx',
    'charset' => 'utf8',
),