Hi I have been working on creating a model for a couple of days and I keep running into the problem that the php.ini file used on my shared hosting server doesn’t have PDO enabled by default.
Working with my hosting company they let me know I can use the -c flag to specify the php.ini file I wish to load when I run my script (see command they supplied):
Far below is the recurring error message. PDO is available in my shared hosting environment, and I have created a php.ini file with this codeblock as supplied by my host:
extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.so
I am using mysql, and the line in my controller where I call in the database is
<b>Warning</b>: include(PDO.php) [<a href=‘function.include’>function.include</a>]: failed to open stream: No such file or directory in <b>/home1/resolut1/public_html/yii/framework/YiiBase.php</b> on line <b>324</b><br />
<br />
<b>Warning</b>: include() [<a href=‘function.include’>function.include</a>]: Failed opening ‘PDO.php’ for inclusion (include_path=’.:/home1/resolut1/public_html/yii/jobsearch/protected/components:/home1/resolut1/public_html/yii/jobsearch/protected/models:/usr/lib/php’) in <b>/home1/resolut1/public_html/yii/framework/YiiBase.php</b> on line <b>324</b><br />
<br />
<b>Fatal error</b>: Class ‘PDO’ not found in <b>/home1/resolut1/public_html/yii/framework/db/CDbConnection.php</b> on line <b>282</b><br />