Hi,

I'm trying to run drupal/update.php with the Oracle driver installed. However there is a problem with the update scripts which shows an error like:


A PDO database driver is required!

You need to enable the PDO_ORACLE database driver for PHP 5.2.4 or higher so that Drupal 7 can access the database.

See the system requirements page for more information.

I have looked in the code for the reason of this error as the install.php worked without any problem at all. In the includes/update.inc, line 130 there is this:

//Some more code here...
elseif (isset($databases['default']['default']['driver']) && !in_array($databases['default']['default']['driver'], PDO::getAvailableDrivers())) {
    $message = '<h2>A PDO database driver is required!</h2><p>You need to enable the PDO_' . strtoupper($databases['default']['default']['driver']) . ' database driver for PHP ' . DRUPAL_MINIMUM_PHP . ' or higher so that Drupal 7 can access the database.</p>';
  }
  if ($message) {
    print $message . '<p>See the <a href="' . $pdo_link . '">system requirements page</a> for more information.</p>';
    exit();
  }

The cause of the problem is this check, where PDO's Oracle driver is called PDO_OCI, while the driver name defined in the settings.php is "oracle". Changing the driver name from "oracle" to "oci" did not helped at all (I don't know if changing the folder's name might help or not, I did not tried that).

Silencing these lines:

    print $message . '<p>See the <a href="' . $pdo_link . '">system requirements page</a> for more information.</p>';
    exit();

will prevent the errors and updating mechanism will work flawlessly (considering updates work without problems).

I don't know how this check can be bypassed other then a direct patch as I haven't seen any hooks etc, in the code around.

Comments

Renee S’s picture

Priority: Normal » Major

Confirmed. Renaming the folder doesn't work because all of the functions use the module name (hook_oracle). Fixing this would mean either 1) renaming the module and all its functions (to _odbc or _oci) or getting a patch in to change update.inc. 1) seems more likely to be successful, but this definitely needs a mod's eyeballs.

brianV’s picture

In practice, we've been commenting out that check prior to running update.php.

The 'proper' solution would probably be to add a patch to database.inc to allow db drivers to specify their PDO plugin name, rather than divining it from the folder name automatically.

The next best option is renaming the module as adding special cases in core (ie, hacking update.php) to accommodate a specific contrib deficiency is not a good practice to start with.

brianV’s picture

yesmathew’s picture

Its not a driver issue its a core and oracle issue

yesmathew’s picture

Title: Cannot running Drupal update.php with Oracle Driver. » Cannot run Drupal update.php with Oracle Driver.
yesmathew’s picture

Status: Active » Needs review
bohart’s picture

Status: Needs review » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

Everyone can apply the patches/suggestions above (not tested by the maintainers, tested by the community) to their D7 projects.
If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.

Thanks!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.