PHP Fatal error: Class 'PDO' not found
8,926
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.
Related videos on Youtube
Author by
Tiffany Walker
Updated on September 18, 2022Comments
-
Tiffany Walker over 1 year
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
-
Ladadadada almost 12 yearsIs 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? (Aphp.ini
in your home directory will be picked up by CLI PHP.) -
Tiffany Walker almost 12 yearsfcgid. they all use the same PHP ini file. yes, using Apache. No php.ini in the home dir.
-
apinstein over 11 years@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.
-
Tiffany Walker over 11 yearsI 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 over 11 yearssounds about right. i think i ended up cpying files over because i ran chroot