When I try to open my site I get:

Fatal error: Class 'PDO' not found in /home/public_html/7/includes/database/database.inc on line 137

I have PDO installed. The site was running Drupal 7 properly, this started happening after an update last week.
I paste here some content of phpinfo:

PHP Version 5.2.6

System Linux host300.hostmonster.com 2.6.26-3_5.BHsmp #1 SMP Fri Aug 29 12:43:21 MDT 2008 x86_64
Build Date Sep 20 2008 16:44:38
Configure Command './configure' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-fastcgi' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-maintainer-zts' '--enable-mbstring' '--enable-pdo=shared' '--enable-soap' '--enable-sockets' '--enable-zip' '--prefix=/usr' '--with-bz2' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/opt/openssl' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/' '--with-mime-magic' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/opt/openssl' '--with-openssl-dir=/opt/openssl' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pgsql=/usr' '--with-pic' '--with-png-dir=/usr' '--with-pspell' '--with-sqlite=shared' '--with-tidy=/opt/tidy/' '--with-ttf' '--with-xmlrpc' '--with-xpm-dir=/usr/X11R6' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr'

Comments

dave reid’s picture

If you run a PHP file with just phpinfo(); , what is the result in the 'PDO' category?

This is mine:

PDO
PDO support	enabled
PDO drivers 	mysql

pdo_mysql
PDO Driver for MySQL, client library version	5.0.51a
nikemen’s picture

Status: Active » Closed (fixed)

Problem resolved: PDO was available but not enabled.
Sorry!

ff1’s picture

Category: bug » support
Priority: Critical » Normal
Status: Closed (fixed) » Active

I get the same error as nikeman. I checked my phpinfo() page and it doesn't contain a section for PDO. The only references to PDO are: '--enable-pdo=shared' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' within the 'Configure Command' section.

What do I need to do now to get Drupal 7 running?

ainigma32’s picture

Status: Active » Postponed (maintainer needs more info)

You probably need to uncomment the PDO entries in your php.ini

Please post back how that works out for you.

- Arie

ff1’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks Arie. I couldn't find any PDO entries in my php.ini file, but a bit of googling revealed the following 2 lines should be added to php.ini to enable PDO for MySql:

extension=pdo.so
extension=pdo_mysql.so

And it worked perfectly :o)

ainigma32’s picture

You're welcome and thanks for posting the solution.

- Arie

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

chicagomom’s picture

Just a note that if you want to enable these on an existing IIS7 php distro (the Web Platform Installer does not enable these by default) you will need to go to control panel | programs | programs and features, click on php and "Change" to install these extensions. I tried via editing php.ini directly/copying the dll files to the php/ext directory and it didn't work.