0
PHP Fatal error:  Class 'PDO' not found in /home/bd/public_html/app/webroot/Cake/Model/Datasource/Database/Mysql.php on line 177

PHP INFO:

PDO

PDO support => enabled
PDO drivers => sqlite, sqlite2, mysql

pdo_mysql

PDO Driver for MySQL => enabled
Client API version => 5.5.24

Directive => Local Value => Master Value
pdo_mysql.default_socket => /var/lib/mysql/mysql.sock => /var/lib/mysql/mysql.sock

pdo_sqlite

PDO Driver for SQLite 3.x => enabled
SQLite Library => 3.7.7.1

PHP INI:

extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.so

Ideas as to why I'm getting this error?

PHP 5.3.15 CloudLinux/CentOS 6 CPanel

Tiffany Walker
  • 6,681
  • 14
  • 56
  • 82
  • Is your PHP the Apache module or CGI? And if it's CGI, do you have Apache installed? Do you have any other `php.ini` files anywhere on your system that could cause the difference? (A `php.ini` in your home directory will be picked up by CLI PHP.) – Ladadadada Aug 05 '12 at 17:22
  • fcgid. they all use the same PHP ini file. yes, using Apache. No php.ini in the home dir. – Tiffany Walker Aug 05 '12 at 18:49
  • @TiffanyWalker did you ever resolve this? We've run into the exact same issue and can't figure it out. Even weirder, it happened on only one of two servers that were just freshly provisioned with chef so they have theoretically been configured the same way. – apinstein Dec 04 '12 at 22:44
  • I did resolve it... I just can't remember what I did. I think I killed off all the php processes and apache and then it worked when they came back up? – Tiffany Walker Dec 04 '12 at 23:03

1 Answers1

0

It may be due to namespace problems in which case you need to escape PDO like:

$indexes = $this->dbh->cubrid_schema(\PDO::CUBRID_SCH_CONSTRAINT, $table->getName());

For more details see this answer https://stackoverflow.com/a/6901395/556678.

esengineer
  • 148
  • 7