PHP Fatal error: Class 'PDO' not found in

tiff2342

Well-Known Member
Apr 20, 2012
140
0
66
cPanel Access Level
Root Administrator
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
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Are you putting up a phpinfo page in the /home/bd/public_html/app/webroot/Cake/Model/Datasource/Database directory itself? If you have a php.ini file set up somewhere before that folder without the proper extensions set, it will use that php.ini instead of the global one under suPHP. As such, what configuration file is it showing being used if you put a phpinfo into /home/bd/public_html/app/webroot/Cake/Model/Datasource/Database folder?
 

zeta1600

Member
Mar 25, 2011
11
0
51
We recently upgraded to a newer release of MySql. And we recieved the error: "Fatal error: Class 'PDO' not found in ..."

WHM 11.34.1
Apache 2.2.23
PHP 5.3.21

We went to EasyApache to rebuild the profile. In the Exhaustive Options List, and PDO and PDO MySQL was not ticked, so we selected both. Went through the rebuild.

Then, we found out that in Home » Service Configuration » PHP Configuration Editor » Advanced
Core | extension, the text was written this way:
timezonedb.so, pdf.soextension=pdo.so, pdo_sqlite.so, sqlite.so, pdo_mysql.so, pdo.so

I edited it to add a comma and space after pdf.so, like so:
timezonedb.so, pdf.so, extension=pdo.so, pdo_sqlite.so, sqlite.so, pdo_mysql.so, pdo.so

I hope that this helps someone...
 

dualmonitor

Active Member
Dec 3, 2012
31
0
6
cPanel Access Level
Root Administrator
WHM 11.36.0 (build 14)
Apache 2.2.24
PHP Version 5.4.12

From my php.info

'--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--enable-pdo=shared'
And my php.ini includes:

extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.so
I was really hoping that your advice:

I edited it to add a comma and space after pdf.so, like so:
timezonedb.so, pdf.so, extension=pdo.so, pdo_sqlite.so, sqlite.so, pdo_mysql.so, pdo.so
...was going to help but unfortunately I'm still getting the message:

Fatal error: Class 'PDO' not found in /home/...

I've looked around and taken all the steps I thought I needed but unfortunately I'm still getting that error. :(

Anyone have any suggestions?