2 Replies Latest reply: Sep 4, 2011 11:03 AM by stealthgun RSS

    Solaris PHP 5.2.12 Oracle Instant Client Error

    stealthgun
      We are testing a Oracle Solaris Express 11 Server with the standard Apache and PHP installation. But we need the Oracle Instant client and the oci8 module enabled for our company applications.

      We did this by using ./pecl install oci8 in /usr/php/5.2/bin. We set the LD_LIBRARY_PATH in /etc/apache2/2.2/envvars

      a 32bits solaris (x86) version of the Oracle Instant Client 11.2 is installed in /opt/oracle/instantclient_11_2 with the symbolic link made.

      envvars:
      LD_LIBRARY_PATH=/opt/oracle/instantclient_11_2
      ORACLE_HOME=/opt/oracle/instantclient_11_2
      ORACLE_BASE=/opt/oracle/instantclient_11_2

      he oci8 module installed and php loads it.

      phpinfo(); output:

      oci8
      OCI8 Support enabled
      Version 1.4.6
      Revision $Revision: 313688 $
      Active Persistent Connections 0
      Active Connections 0
      Oracle Run-time Client Library Version 11.2.0.2.0
      Oracle Instant Client Version 11.2
      Temporary Lob support enabled

      When we first view a site there is no problem but very randomly we get the following error:

      OCIEnvNlsCreate() failed. There is something wrong with your system - please check that LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries*

      but when we use echo getenv("LD_LIBRARY_PATH"); in php the output is "/opt/oracle/instantclient_11_2"

      now the strange this is as randomly as it appears it disappears we can load the web-page without problems and after a couple of clicks the error is back. if we wait a coupe of seconds you can reload the page and it loads normaly.
      The error appears to be random and we get it over and over agian, it comes and goes after a cpl of pages are viewed. It seems to appear more when there are multiple users browsing on the website.

      Is there a fix for this? is this an known bug? It seems strange the instant client works some times and fails a second later without a change in the system.
      Hope someone can help us.

      Edited by: user10978378 on Sep 3, 2011 4:20 AM
        • 1. Re: Solaris PHP 5.2.12 Oracle Instant Client Error
          rukbat
          Moderator Action:
          This post has been moved from the Solaris 11 forum to the OIC forum for closer topic alignment.
          Readers of the Solaris forum wouldn't have a clue as to the nuances of OIC.
          • 2. Re: Solaris PHP 5.2.12 Oracle Instant Client Error
            stealthgun
            Solved it by compiling apache 2.2.20 into 64bits using:
            CFLAGS="-m64" CXXFLAGS="-m64" LDFLAGS="-m64" ./configure enable-so enable-cgi enable-info enable-rewrite enable-deflate enable-ssl

            and compiling php 5.3.8 into 64bits:
            CFLAGS="-m64" CXXFLAGS="-m64" LDFLAGS="-m64" ./configure with-apxs2=/usr/local/apache2/bin/apxs with-gd with-zlib disable-ipv6 with-jpeg-dir=/usr/ with-png-dir=/usr/ with-freetype-dir=/usr/ with-pear with-openssl with-oci8=instantclient,/opt/oracle/instantclient_10_2

            and using the 10.2.0.4 instant client.

            there might be a bug in the 11.x ones, they dont seem to work on Oracle Solaris 11.