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
Comment #1
dave reidIf you run a PHP file with just
phpinfo();, what is the result in the 'PDO' category?This is mine:
Comment #2
nikemen commentedProblem resolved: PDO was available but not enabled.
Sorry!
Comment #3
ff1 commentedI 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?
Comment #4
ainigma32 commentedYou probably need to uncomment the PDO entries in your php.ini
Please post back how that works out for you.
- Arie
Comment #5
ff1 commentedThanks 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:
And it worked perfectly :o)
Comment #6
ainigma32 commentedYou're welcome and thanks for posting the solution.
- Arie
Comment #8
chicagomom commentedJust 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.