I'm running version 7.x-1.x-dev of the Oracle driver against Oracle 10g Express on Drupal 7.0. On admin/reports/status and all sublevels of admin/config/.... I get the following error message:
PDOException: SQLSTATE[IM001]: Driver does not support this function: driver does not support getting attributes in system_requirements() (line 201 of /var/www/drupal7/modules/system/system.install).
The line in system.install which the statement refers is:
'value' => Database::getConnection()->version(),
Is anyone else seeing this? I'd appreciate any input on how to go about correcting the problem.
Comments
Comment #1
aaaristo commentedjust installed drupal 7.0 with latest version of oracle driver and i cannot reproduce it.
wait tomorrow to see if with the last dev snap it works
Comment #2
barrett commentedI've tried with both 7.x-1.0 and 7.x-1.x-dev versions and get the same result. I also noticed on update.php I get a white screen and the message...
My phpinfo() output shows:
Is this not the same as the PDO_ORACLE driver? PDO_OCI is what you told me I needed when I was first trying to get things setup (http://drupal.org/node/803618).
I don't see how it's relevant but I'm running PHP 5.3.2 and Apache 2 on Ubuntu.
Comment #3
aaaristo commentedLooks like a PDO_OCI bug in 5.3.2... i'm using php 5.2.12... and it works.
There is no PDO_ORACLE, this is a bug in the includes/update.inc of drupal 7...
Comment #4
aaaristo commentedComment #5
aaaristo commentedcreated this bug on the core:
http://drupal.org/node/1029080
Comment #6
aaaristo commentedI've got a conversation with the guy who follows PDO, and it looks like they added support for the version attribute from 5.2.5... Reading your error it looks like you think you are using PHP 5.3.2, but you still use 5.2.4!
http://drupal.org/node/1028054#comment-3955716
Check you paths... try to run php --version, or look at the header of your phpinfo()...
Comment #7
barrett commentedThanks for following up, Andrea. I don't know what's going on. Over the weekend I purged and reinstalled oracle, removed my old drupal site and did a fresh install, and updated php to 5.3.3 in hopes some combination of those would rectify things.
Unfortunately it seems to have made things worse. When I try to install with Oracle selected as the database, I get a segmentation fault error in my apache error log and the install.php is delivered as a download.
Even just connecting directly through PHP is creating an error:
I know you said you thought it was an issue with the PDO driver in PHP 5.3, but I've been able to find no reports of such a problem. If you can point me at anythign that might help, I'd appreciate it, but it looks like this isn't a problem with the oracle integration with drupal but something deeper on my end.
Comment #8
aaaristo commentedadd export ORACLE_HOME= to /etc/sysconfig/httpd
so that the pdo_oci knows where is your client installation.
this fixed the problem for me in a similar situation. it really depends on how you compiled pdo_oci.
may be you also have to export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH,
checkj also that apache can access your client directory (permissions).
Comment #9
aaaristo commentedi've actually found that pdo_oci for php 5.3.5 have a problem with varchar2 length... probably you will need to change my database.inc and set ORACLE_MAX_VARCHAR2_LENGTH TO 1000:
define('ORACLE_MAX_VARCHAR2_LENGTH',1000);
read this:
http://drupal.org/node/787276#comment-2971758
Comment #10
oshelot commentedI think this is a bug with PDO_OCI - some getAttribute() features are are gone. I am running PHP 5.3.3 from a default openSUSE install with PDO_OCI 1.0. Running the following script:
Returns the desired result:
# php ico.php
oci
But trying "SERVER_INFO", "SERVER_VERSION" or other attributes fails (PDO::ATTR_SERVER_INFO) fails with the error some of us are seeing:
# php ico.php
PHP Warning: PDO::getAttribute(): SQLSTATE[IM001]: Driver does not support this function: driver does not support getting attributes in /tmp/ico.php on line 5
Commenting out line 201 in system.install at least lets you get to the Configuration page although I'm not crazy about doing that.
Comment #11
aaaristo commentedyes it is definitely a pdo_oci bug. Can you upgrade to 5.3.5?
otherwise i can override the version() method...
Comment #12
aaaristo commentedthis code works perfectly on 5.3.5...
Comment #13
oshelot commentedI think an override of version() is a good idea. Most linux distos aren't going to be at 5.3.5 anytime soon, IMO. Last I checked, RHEL 6 was slated to be released with 5.3.2 and I don't see them pushing an update for a small PDO_OCI bug, also IMO. Personally, at this point, upgrading to 5.3.5 would require compiling from source. Usually, I'm all for this, but it would be a headache. I also think that a small code change would save a lot of potential users from dealing with this issue.
# php ico.php
PHP Warning: PDO::getAttribute(): SQLSTATE[IM001]: Driver does not support this function: driver does not support getting attributes in /root/ico.php on line 4
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
On a side note, manually setting the version as string in system.install doesn't seem to produce any undesirable results that I can see. I can still get to the Configuration page. But I don't know Drupal well enough to say that it won't cause problems.
I'm also not in favor of hacking up core Drupal files. In addition, manually setting 'value' to a string didn't resolve the update.php error referenced above (I'm seeing it also).
Comment #14
aaaristo commentedAbout the update.php it is a drupal core bug: comment out line 131 in includes/update.inc (it is a core bug http://drupal.org/node/1029080)
About the version method i've implemented it so should work even on 5.3.3.
You'll find it in 1.4
Comment #15
oshelot commentedAndrea, I updated to Oracle driver 7.x-1.4 but am still seeing the same error. Can you tell me where in the driver you put the override code?
Comment #16
aaaristo commenteddatabase.inc line 305