pdo_oci

Discussion in 'Web Design and Development' started by SrWebDeveloper, May 12, 2010.

  1. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #1
    Having problems compiling PHP 5.3.2 pdo_oci.

    I have the Oracle instant client installed and it compiled fine along with pdo_mysql and a few others PDO drivers. When I check phpinfo() pdo_oci is listed as being installed along with the others in the PDO section, but under PDO_OCI it's blank where I expect to see driver name and version.

    No errors during any process in compiling. PHP works fine otherwise for all the other drivers and extensions I opted to use for the compile. Nothing else is broken, is the point.

    When testing pdo_oci in my PHP code to access my Oracle database, none of the PDO commands even exist. I also compiled OCI8 access and it works great, as an FYI.

    My platform:

    RHEL5
    PHP 5.3.2
    Oracle Instant Client 11.2

    ./configure --with-mcrypt --enable-zip --enable-soap --with-freetype-dir --with-gd --with-jpeg-dir --with-apxs2=/usr/sbin/apxs --with-zlib --enable-bcmath --with-mysql --with-mysqli --enable-mbstring --enable-sigchild --with-pdo-mysql --with-oci8=instantclient,/opt/instantclient --with-pdo-oci=instantclient,/opt/instantclient,11.2

    (Path's are correct otherwise .configure would bomb)

    Note: I do not want to use the PECL 1.0 version of PDO_OCI it's an older version. I know PHPs native version is experimental.
     
  2. Cabbit macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #2
    Have you asked at PHP builder, sorry i can't provide more help i have yet to link up PHP with a Oracle database.
     
  3. SrWebDeveloper thread starter macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #3
    Yep, waiting for one someone to test the compile options I used, or anyone else to intervene here.
     
  4. Cabbit macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #4
    I'll try on my test server tonight when i get home and see if it compiles.
     
  5. Cabbit macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #5
    Can't get it working myself, but keep your eyes on PHPBuilder there really friendly and helpful.
     
  6. SrWebDeveloper thread starter macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #6
    Same symptoms as mine? If not, what did you experience?

    Yep, I always keep my eye on all the topics I'm involved with.

    I'm thinking at this point to attempt compiling it manually so I can create a pdo_oci.so myself and enable the extension in my php.ini. The problem is, I only could find info on how to compile the thirdparty PECL 1.0 version, which I believe is older and more buggy than the experimental PHP 5.3.2 version. So if you have any insight on how to compile the one that ships with PHP manually, let me know!

    -jim
     
  7. Cabbit macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #7
    It would not let me compile it complained about missing dependences despite me having these installed.
    This was tested on Centos 5 x86_64, I am sorry i did not think to copy the output. I have posted a email to my lecturer regarding the problem he is quite comfortable with oracle databases and i know our intranet for course submissions is on PHP 5.x with a oracle database.

    This may be a PHP 5.3.x issue, i know for a while things like ioncube did not work and perhaps some of the database drivers are not updated yet.
     
  8. SrWebDeveloper thread starter macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #8
    I finally got it to compile as external module (.so) - and it works, even though no version information is supplied in phpinfo() for that extension. Now I have my PHP supporting PDO for MySQL and Oracle, plus OCI8 as well (due to Drupal and some legacy DB support for this client, it's odd, I know).

    Thanks so much for your help! Marking this one resolved.

    -jim
     
  9. Cabbit macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #9
    Would be interested to see your solution, though rare would i ever be asked to work with a Oracle database.
     
  10. SrWebDeveloper thread starter macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #10
    ./configure --with-config-file-path=/etc --with-mcrypt --enable-zip --enable-soap --with-freetype-dir --with-gd --with-jpeg-dir --with-apxs2=/usr/sbin/apxs --with-zlib --enable-bcmath --with-mysql --with-mysqli --enable-mbstring --enable-sigchild --with-oci8=instantclient,/opt/instantclient --enable-pdo=shared --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-sqlite=shared --with-pdo-oci=shared,instantclient,/opt/instantclient,11.2

    Add to /etc/php.ini:

    extension=pdo.so
    extension=pdo_sqlite.so
    extension=sqlite.so
    extension=pdo_mysql.so
    extension=pdo_oci.so
     
  11. Cabbit macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #11
    Interestingly looks about the same process i had to do to get PDO MySQL working on 5.3.2. Once again making me wonder if it is a PHP 5.3 issue that it did not work right the first time.
     

Share This Page