Project:Drupal core
Version:7.x-dev
Component:base system
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

#1

If you run a PHP file with just

<?php
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

#2

Status:active» closed (fixed)

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

#3

Category:bug report» support request
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?

#4

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

#5

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)

#6

You're welcome and thanks for posting the solution.

- Arie

#7

Status:fixed» closed (fixed)

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

#8

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.

nobody click here