Hi, I'm trying to install Drupal 8 using Oracle 12.1c database that is sitting in a separate server. After installing the Drupal Oracle Driver using composer (following instruction on https://www.drupal.org/docs/8/modules/oracle-driver), I am able to see the "Oracle" option during installation. However, when I entered all the database details and tried to go to the next step, the installation crashed. I checked the apache server log and the following error was logged:

PHP Fatal error: Declaration of Drupal\\Driver\\Database\\oracle\\Statement::fetchObject($class_name = 'stdClass', array $ctor_args = Array) must be compatible with PDOStatement::fetchObject($class_name = NULL, $ctor_args = NULL) in /var/www/html/web/drivers/lib/Drupal/Driver/Database/oracle/Statement.php on line 10, referer: http://xxx.xxx.xxx.xxx/web/core/install.php?rewrite=ok&langcode=en&profi...

This looks like the Drupal Oracle Driver is incompatible with the PHP's PDO library. Can anyone point me to what may be the cause?

My system setup:
OS: RHEL 7.5 (Maipo)
PHP: 7.2.8, installed from remi-php72 repository (version 7.2.8-1.el7.remi)
PHP info:
PDO drivers oci, sqlite, sqlsrv
PDO Driver for OCI 8 and later enabled
OCI8 Support enabled
OCI8 DTrace Support enabled
OCI8 Version 2.1.8
Revision $Id: 4543974aab26d8a3d85257ab18d0dca4503ff9e7 $
Oracle Run-time Client Library Version 12.2.0.1.0
Oracle Compile-time Instant Client Version 12.2

Drupal is prepped using drupal-composer:

composer create-project drupal-composer/drupal-project:8.x-dev drupal_install --stability dev --no-interaction

Comments

yktan created an issue. See original summary.

tomogden’s picture

@yktan , I found a similar-sounding issue at https://github.com/jimbojsb/pseudo/issues/4 . I wonder if the solution they found there will help you?

yktan’s picture

@tomogden Thanks for much for sharing that information! I managed to solve the problem by following the tips given in the link that you provided. For future reference, the change that I made to fix the problem that I was facing was:

/drivers/lib/Drupal/Driver/Database/oracle/Statement.php:

public function fetchObject($class_name = "stdClass", array $ctor_args = array()) {

to

public function fetchObject($class_name = "stdClass", $ctor_args = array()) {

Thanks so much for your help

cameron prince’s picture

StatusFileSize
new500 bytes

I ran into this problem too... Thanks for the fix. Here's a patch.

cameron prince’s picture

Status: Active » Needs review
jaydee1818’s picture

Patch works for me

jaydee1818’s picture

Status: Needs review » Reviewed & tested by the community

  • bohart committed b7f1b04 on 8.x-1.x authored by cameronprince
    Issue #2988592 by cameronprince, yktan, jaydee1818, tomogden, bohart:...
bohart’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +LutskGCW20

Committed to 8.x-1.x dev.
Thanks!

Status: Fixed » Closed (fixed)

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