PDO Issue

I’ve created a new Yii app on a shared host, and the yiic is having trouble with finding the PDO class. I am pointing the yiic to the right ini file using:

#!/usr/bin/php -c /home/authentr/public_html/php.ini

The ini file contains the directives:




extension=pdo.so

extension=pdo_sqlite.so

extension=sqlite.so

extension=pdo_mysql.so



I’ve checked and re-checked my connection setup:




                                'db'=>array(

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

                                             'emulatePrepare' => true,

                                             'username' => 'myusername',

                                             'password' => 'mypassword',

                                             'charset' => 'utf8',

                                             ),



I am still getting the errors:




<b>Warning</b>:  include(PDO.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in <b>/home/authentr/public_html/pantry/yii-\

1.1.0.r1700/framework/YiiBase.php</b> on line <b>338</b><br />

<br />

<b>Warning</b>:  include() [<a href='function.include'>function.include</a>]: Failed opening 'PDO.php' for inclusion (include_path='.:/home/authentr/public_html/pantry/yii-1.1.0.\

r1700/framework/pantry/protected/components:/home/authentr/public_html/pantry/yii-1.1.0.r1700/framework/pantry/protected/models:/usr/lib/php') in <b>/home/authentr/public_html/pa\

ntry/yii-1.1.0.r1700/framework/YiiBase.php</b> on line <b>338</b><br />

<br />

<b>Fatal error</b>:  Class 'PDO' not found in <b>/home/authentr/public_html/pantry/yii-1.1.0.r1700/framework/db/CDbConnection.php</b> on line <b>296</b><br />



Any idea on what else to try?

Hello queej,

We had a similar problem with one of our applications and it took a while to figure out that the pdo-module was not enabled on the server. Maybe this is the problem in your case aswell?

Thanks, but it shows up in the phpinfo() output as installed.

Solved. The path to the PECL extensions in the php.ini file was incorrect.