Having problems compiling PHP 5.3.2 pdo_oci.

I have the Oracle instant client installed and even a few other 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 oddly blank -- where I expect to see driver name and version. Via command line, php -m shows it listed in upper case as if it was installed as well. There is no instance of pdo_oci.so in the extensions directory or anywhere else on the server or that matter, so obviously it didn't compile/install nor is it conflicting with an existing version.

No errors during compilation.
All other installed/compiled modules work fine (including OCI8 to Oracle 11g)
Checked in /opt/php-5.3.2/ext/pdo_oci -- source files are there

My platform:

RHEL5
PHP 5.3.2
Oracle Instant Client 11.2 (downloaded linux i386 .zip's and installed client/sdk in /opt/instantclient)
Apache 2.2.3

./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

(Paths and version info is correct otherwise configure would have bombed)

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.

Hope I gave you enough info to assist. Thank you!

-jim

    Jim,

    While I don't have RHEL5 anywhere I can test, I do have CentOS 5 (basically RHEL5 minus the RedHat logos? :p) so I might be able to test this out personally when I get home this evening.

    Just to be clear, is this where you downloaded the instant client? If so, which package did you get (Basic, Basic Lite, etc. etc.)?

      Yes, that's the page.

      instantclient-basic-linux32-11.2.0.1.zip
      instantclient-sdk-linux32-11.2.0.1.zip

      Both installed in /opt/instantclient and remember OCI8 compiled fine and works great in test code connecting to Oracle 11g, it uses the Instant Client as well.

      Thank you much.

      -jim

        bradgrafelman;10952411 wrote:

        Jim,... I might be able to test this out personally when I get home this evening.

        What were your results?

          Sorry I didn't post back with an update...

          SrWebDeveloper;10952589 wrote:

          What were your results?

          My only results so far are jaw-dropping surprise when I learned that the Oracle 11g server was a 2GB download. :p

          I didn't get a chance to try it out yet. I'll try downloading all the files today and install everything tonight.

            You don't need to actually install Oracle 11g but feel free if you wish :p

            All I need you to test is if pdo_oci.so is created and php_info() shows version info for PDO OCI. Problem is I can't get it to even compile! Don't actually need to connect and in my case our Oracle 11G is remotely accessed. But thanks, of course, for the extra effort. If you get any errors, let me know, or if no errors and same result, let me know. I run a 32bit RHEL5 btw.

            -jim

              SrWebDeveloper wrote:

              I run a 32bit RHEL5 btw.

              Yeah, I noticed that... my CentOS 5 is a 64-bit install (and that damn "lib64" dir has been nothing but problems for me :p), but I'll stick with the 32-bit versions since they should work fine as well.

              SrWebDeveloper wrote:

              You don't need to actually install Oracle 11g

              I thought I'd install it to verify that the compile/extension worked by trying to connect to an actual Oracle server. I also didn't know what all I needed to install in order to compile the PDO extension.

              So all I really need to install is the instant client (basic & dev/SDK)?

                So all I really need to install is the instant client (basic & dev/SDK)?

                Yep. Then compile PHP 5.3.2 as I did from my original post and check phpinfo() in the PDO OCI section and see if version information is displayed like the other PDO extensions. Or if you try to connect to a database in PHP using the PDO method PHP will bomb and return "Command not find" for any PDO related method. If you see version info and don't get that specific error in test code, it compiled fine.

                -jim

                  Alright, sounds like I can give that a shot tonight (won't be until late tonight, though).

                  Out of curiosity, do you get any errors/warnings related to PDO when compiling?

                  In fact, would you mind posting your entire compile output as an attached .txt file? In case you're not sure how, you should be able to dump the compile output to a log file by adding ">compile.log 2>&1" (minus the quotes) onto the end of your ./configure command.

                    Yep, as I noted in my original post, no errors during compile. This includes all steps, ./configure, make and make install. Remember, all other PDO extensions and everything else compile and work fine, I'm using the build actually.

                    I setup the environment and ran ./configure as follows:

                    export LD_LIBRARY_PATH=/opt/instantclient
                    export TNS_ADMIN=/opt/instantclient
                    export ORACLE_HOME=/opt/instantclient

                    ./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

                    Please see attached for the output that resulted. I had to file attach as the content exceeded the post size in this forum.

                    -jim

                      While waiting for your response I tried to compile it as an external module (pdo_oci.so) and it worked that way. I also compiled PDO and a few more extensions as well. After doing that all I had to do was add the extension directives to php.ini and restart the web server. Being this is an experimental driver, it's not surprising all this happened, plus the version information for the pdo_oci extension doesn't show in phpinfo() still.

                      But I go it working, and my client is happy.

                      Thank you, bradgrafelman, for all your help. Marking as resolved.

                      -jim

                        Glad you got it resolved... I apparently fubar'ed something on my CentOS 5 box... I kept getting a compile error in one of the glob files. Sorry I wasn't of much help!

                          Write a Reply...