Fatal error: Class 'PDO' not found in /home/me.org/sites/all/modules/dbtng/database/database.inc on line 187

near that line:

/**
 * Base Database API class.
 *
 * This class provides a Drupal-specific extension of the PDO database
 * abstraction class in PHP. Every database driver implementation must provide a
 * concrete implementation of it to support special handling required by that
 * database.
 *
 * @see http://php.net/manual/en/book.pdo.php
 */
abstract class DatabaseConnection extends PDO {

Comments

yesct’s picture

Status: Active » Postponed (maintainer needs more info)

I'm guessing this is some setting I need to have my host (shared hosting) fix. I've filed a ticket with them, but wanted to also open an issue here, so people who have the same problem can hopefully get a hint about how to fix it.

mercclear’s picture

I've got same problem moving D7 site to hon hostingosting.

When I try to make clean install on my hosting I have this:

Your web server does not appear to support PDO (PHP Data Objects). Ask your hosting provider if they support the native PDO extension. See the system requirements page for more information.

Here is hosting php settins :
http://sv67.avahost.net/.php

It looks like everything should be OK, any ideas how to solve the problem?

Vlad.

astutonet’s picture

Status: Postponed (maintainer needs more info) » Active

Hi.

I'm trying to disable some modules (Migrate, Date, DBNTG) in my D6 online site, but I'm receiving this message:

Fatal error: Class 'PDO' not found in /home/MY_SITE/public_html/sites/all/modules/dbtng/database/database.inc on line 187

I'm also seeing the following error message when running update.php:

An error occurred. http://www.MY_SITE/update.php?id=2&op=do
Fatal error: Class 'PDO' not found in /home/MY_SITE/public_html/sites/all/modules/dbtng/database/database.inc on line 187

Because of these errors, I'm not able to complete all the operations with success. Anyone knows why?

How to solve this, to disable and remove all the above modules?

Tks.

Edit - Solved: I had to disable modules via cPanel.

tuthanh’s picture

You can go to CPanel of your hosting, choose PHP settings and enable the PDO Extension. That works for me.

mikey_p’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

I don't know if any of the PDO extensions that are built separately will work properly with DBTNG. There were some issues that came up during D7 development with older versions of PHP using the PDO extensions from PECL that were really out of date. You should be using the PDO that comes bundled with PHP 5.2 and higher and is compiled in when PHP is built, not a separate shared extension.

Anonymous’s picture

Version: 6.x-1.x-dev » 6.x-1.0-rc4
Component: Code » Miscellaneous
Category: support » bug

Specifically, I encountered this error when attempting to configure the Migrate module shortly after installing DBTNG and other modules - including Migrate. Adding these two lines to my php.ini file resolved this error for me:

extension="pdo.so"
extension="pdo_mysql.so"

miniwebs2’s picture

7 hrs of frustration and headache and finally this worked - just by inserting a small insert into a new php.ini file - thank you SOOOO much!!!!!

roxtaz’s picture

This also worked for me too. Added php.ini file in the root public_html folder and problem is solved. Thank you !!!

astutonet’s picture

Status: Postponed (maintainer needs more info) » Active

Hi. I also have this issue.

In my case, I use the Drupal 6.26, DBTNG 6.x-1.x-dev, Migrate 6.x-2.4+2-dev and Migrate Extras 6.x-2.3+1-dev.

In the Administer Panel, when I try to open the Migrate page, the following message are showed:

Fatal error: Class 'PDO' not found in /home/mysite/public_html/sites/all/modules/dbtng/database/database.inc on line 187

No problem in others admin pages.

The two lines in #6, with " or no, don't solve my problems.

Any idea?

Tks.

kevinchampion’s picture

In certain environments you may be able to solve the problem by loading pdo and pdo_mysql in your settings.php file. This is particularly handy in the case where you're in a shared hosting environment that has pdo installed but not loaded by default for your site (and you're unable to load them in a php.ini file). Just put the following in settings.php somewhere:

if (!extension_loaded('pdo')) {
  dl('pdo.so');
}
if (!extension_loaded('pdo_mysql')) {
  dl('pdo_mysql.so');
}
astutonet’s picture

I did a update in the site in question from D6 to D7 and I tried to put it in the air. It happens that in D7, the service .pdo is mandatory, and therefore, the D7 version did not work.

I contacted the hosting provider, and I was informed that they do not offer this service (the old company was merged by a new other and are forcing all customers to migrate their old contracts to a new structure).

I am renewing the contract to move the site to the new structure, which will have access to the service .pdo. But it will still take a while to this happen.

For this reason, I had to return to the D6 (thankfully I had a database file!) and disable all services with ".pdo".

I believe that any subterfuge that I want to use will not work (if friends say it's worth trying, I'll do the test, ok?).

Tks

Tks