Forum Stats

  • 3,826,051 Users
  • 2,260,592 Discussions


PHP OCI8 install solaris 11.2

pans_soul Member Posts: 9
edited Aug 12, 2015 8:11AM in PHP

I am a solaris sysadmin trying to assist a developer in getting PHP to connect to an existing Oracle 12c database. Initial research indicated I should start by installing OIC (oracle instant client?) which I did using the IPS solaris studio repository and solaris studio 12.3. This installed a directory in /opt/solarisstudio12.3/OIC but I dont necessarily see any library files in there. The next instruction seems to indicate I should configure PHP to include/install the oci8 extension but the configure command seems to be pretty outdated (./configure --with-oci8=shared,instantclient,/path/to/instant/client/lib) or I'm unable to find the path to the library files. There is a php-config command in the native version of php installed on solaris 11.2 so maybe that should be used but I'm not sure. The developer is using the following command as a measure of success:

# php -r "var_dump(function_exists('oci_connect'));"


Any help is greatly appreciated.


  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,648 Employee
    edited Jul 21, 2015 7:58AM

    Does anything in the chapter "INSTALLING PHP AND APACHE ON ORACLE SOLARIS" in help?

  • pans_soul
    pans_soul Member Posts: 9
    edited Aug 3, 2015 11:19AM

    Thanks, It was helpful in some sense but I still had to do some digging to come up with a working oci8. It did help in confirming which additional packages ie... system/headers were needed as pre-install steps. Also with the system variable settings (LD_LIBRARY_PATH) etc...

    Still ran into trouble with installing oci8 though because the only offered solution was the "pecl" install and I do not have access to the internet on this box. I ultimately had to download the source code for oci8 and unpack it. Once that was done I was a little confused about the ./configure command since it didn't exist. I was ultimately able to find information on "phpize" which was the key to unpacking the source code and led to a successful compile.

    The oracle client which was already installed on this box was a 64 bit client and the oci8 package seemed to require the 32 bit client libraries I wasn't comfortable trying to mess with the existing client so I went ahead and installed OIC instead and pointed to those libraries. I'm not sure if I'm just being too paranoid or if adding the 32 bit client libs to the existing oracle client is not that big of a deal. Thanks again.

  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,648 Employee
    edited Aug 12, 2015 8:11AM

    For anyone else coming across this thread, using phpize is shown on p77 of the book.

    OCI8 builds fine with 64bit but the architecture of PHP will have determined what was used for the extension.

This discussion has been closed.