Yii Framework Forum: PDO warning yet its installed? - Yii Framework Forum

Jump to content

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

PDO warning yet its installed? Rate Topic: -----

#1 User is offline   digid 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 28-July 10

Posted 28 July 2010 - 02:01 AM

>> model Employee

Warning: include(PDO.php): failed to open stream: No such file or directory in /home/oo/public_html/yii/framework/YiiBase.php on line 338

Warning: include(PDO.php): failed to open stream: No such file or directory in /home/oo/public_html/yii/framework/YiiBase.php on line 338

Warning: include(): Failed opening 'PDO.php' for inclusion (include_path='.:/home/oo/public_html/test/protected/components:/home/oo/public_html/test/protected/models:/usr/lib/php:/usr/local/lib/php') in /home/oo/public_html/yii/framework/YiiBase.php on line 338

Fatal error: Class 'PDO' not found in /home/oo/public_html/yii/framework/db/CDbConnection.php on line 301
-bash-3.2$

--------------------------

I'm not sure really sure why it isn't working now could it just be the info for my db is incorrect? I have checked to verify pdo is configured and i did have a database setup at one point...

http://opticoverload.com/phpinfo.php

There is my phpinfo anyone have any suggestions? Thanks
0

#2 User is offline   Mike 

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

Posted 28 July 2010 - 02:11 AM

Read the note about PDO in the red box on this page:
http://www.yiiframew....first-app-yiic
0

#3 User is offline   digid 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 28-July 10

Posted 28 July 2010 - 03:49 AM

That's silly they would deprecate such a feature... I mean why not have both ways? I often use my shell to accomplish task quickly.

And this should still work...

I get the same error through gii as well...

PHP Error

Description

include(PDO.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

Source File

/home/oo/public_html/yii/framework/YiiBase.php(338)
0

#4 User is offline   Mike 

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

Posted 28 July 2010 - 04:27 AM

I was talking about the second box:


Quote

Note: You may encounter errors like "...could not find driver", even though the requirement checker shows you have already enabled PDO and the corresponding PDO driver. If this happens, you may try to run the yiic tool as follows,

% php -c path/to/php.ini protected/yiic.php shell
where path/to/php.ini represents the correct PHP ini file.

0

#5 User is offline   digid 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 28-July 10

Posted 28 July 2010 - 04:59 AM

View PostMike, on 28 July 2010 - 04:27 AM, said:

I was talking about the second box:


yea i tried that, i even updated my php with pdo support, no dice.
0

#6 User is offline   Mike 

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

Posted 28 July 2010 - 06:14 AM

Check again. If you're on linux, try this:


[web0 yiilatest]# php -i | grep PDO
PDO
PDO support => enabled
PDO drivers => mysql, sqlite, sqlite2
PDO Driver for MySQL, client library version => 5.0.90
PDO Driver for SQLite 3.x => enabled


If you're on windows, you can also do a "php -i" and inspect the output for PDO drivers. You'll very probably find, that they are missing for you. So you need to check the php.ini file used for PHP on CLI. To find the right file, use "php --ini":


[web0 yiilatest]# php --ini
Configuration File (php.ini) Path: /etc/php/cli-php5
Loaded Configuration File:         /etc/php/cli-php5/php.ini
Scan for additional .ini files in: /etc/php/cli-php5/ext-active
Additional .ini files parsed:      /etc/php/cli-php5/ext-active/apc.ini,
/etc/php/cli-php5/ext-active/xdebug.ini


Then edit this file and enable PDO + drivers.
0

#7 User is offline   digid 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 28-July 10

Posted 28 July 2010 - 02:20 PM

View PostMike, on 28 July 2010 - 06:14 AM, said:

Check again. If you're on linux, try this:


[web0 yiilatest]# php -i | grep PDO
PDO
PDO support => enabled
PDO drivers => mysql, sqlite, sqlite2
PDO Driver for MySQL, client library version => 5.0.90
PDO Driver for SQLite 3.x => enabled


If you're on windows, you can also do a "php -i" and inspect the output for PDO drivers. You'll very probably find, that they are missing for you. So you need to check the php.ini file used for PHP on CLI. To find the right file, use "php --ini":


[web0 yiilatest]# php --ini
Configuration File (php.ini) Path: /etc/php/cli-php5
Loaded Configuration File:         /etc/php/cli-php5/php.ini
Scan for additional .ini files in: /etc/php/cli-php5/ext-active
Additional .ini files parsed:      /etc/php/cli-php5/ext-active/apc.ini,
/etc/php/cli-php5/ext-active/xdebug.ini


Then edit this file and enable PDO + drivers.


root@opt [~/install/php-5.3.3/pear]$ php -i | grep PDO
PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in Unknown on line 0
PDO
PDO support => enabled
PDO drivers => sqlite, sqlite2
PDO Driver for SQLite 3.x => enabled
root@opt [~/install/php-5.3.3/pear]$

I think upgraded may have fixed it but caused a problem with the date cause when i attempt to run the shell at all i get this


<div class="version">
PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/oo/public_html/yii/framework/views/exception.php on line 71

as well... Not sure if this is a conflict between latest php and yii or just my configuration... I'll investigate further...
0

#8 User is offline   digid 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 28-July 10

Posted 28 July 2010 - 02:29 PM

Sweet, i fixed it just had to put a timezone in the php.ini file....
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