Yii Framework Forum: a little PDO problem [Solved] - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

a little PDO problem [Solved] Rate Topic: -----

#1 User is offline   Saevan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 19-May 09

Posted 19 May 2009 - 04:26 PM

Hello,

I discovered Yii some days ago. I fallow "the definitive guide to Yii" but i encounter a little problem for "implementing CRUD operations" ("Creating first Yii application").

At the prompt, when i execute the sub-commands "model User" I have the fallowing message :

Fatal error : Class 'PDO' not found in ..frameworkdbCDbConnection.php on line 274


PDO extensions are enabled. (php_pdo , php_pdo_mysql). Phpinfo shows that the extensions are enabled.
I watched for the different php.ini files and extensions are enabled.
So, i tried to watch if it was the good php.ini file who was loaded when using command line and it is.


I wonder from where the problem can come. I am stuck. I search on the forum. I tried differents solutions like related to pdo troubles and but no one works.(like emulatePrepare).

Configuration : php 5.2.6 + mysql 5.0.51b

If someone can help. Thank you in advance.

0

#2 User is offline   will 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 179
  • Joined: 21-March 09

Posted 19 May 2009 - 05:18 PM

are you using pdo_sqlite or pdo_mysql in your app?
0

#3 User is offline   Saevan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 19-May 09

Posted 20 May 2009 - 04:24 AM

I am using pdo_mysql.

Edit :
I manage to make it work. I was not using the local yiic command for the application that's why the pdo class was not found.

Thank you.

0

#4 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 20 May 2009 - 05:06 AM

Still sounds like a problem with your php.ini. If you're on Linux, can you try this, just to make absolutely sure:

<?php
php -r 'phpinfo();' | grep -i pdo


You should find lines like these:
PDO
PDO support => enabled
PDO drivers => mysql
pdo_mysql
PDO Driver for MySQL, client library version => 5.0.51b

0

#5 User is offline   Saevan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 19-May 09

Posted 20 May 2009 - 05:09 AM

I just managed to make it work.

I was not using the local yiic command for the application that's why the pdo class was not found.

Thank you Will and Mike.


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users