OCI8 & PHP5 OCIEnvNlsCreate() failed.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cyrano

    #1

    OCI8 & PHP5 OCIEnvNlsCreate() failed.

    I am having issues maintaining an oracle connection in my apache/php
    web application. I am able to succesfully connect to an Oracle 9i
    dbase using oci() and retrieve expected results for the first couple of
    attempts - then it dies with a msg in the apache error_log that looks
    like:

    PHP Warning: ocilogon() [<a
    href='function. ocilogon'>funct ion.ocilogon</a>]: OCIEnvNlsCreate ()
    failed. There is something wrong with your system - please check that
    ORACLE_HOME is set and points to the right directory in ...

    ===

    PHP Version 5.0.4

    Apache/2.0.54 (Fedora)

    below is phpinfo:

    './configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux'
    '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr'
    '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin'
    '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include'
    '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var'
    '--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
    '--infodir=/usr/share/info' '--cache-file=../config.cache'
    '--with-libdir=lib' '--with-config-file-path=/etc'
    '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic'
    '--disable-rpath' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin'
    '--with-freetype-dir=/usr' '--with-png-dir=/usr'
    '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp'
    '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png'
    '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr'
    '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp'
    '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem'
    '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars'
    '--enable-trans-sid' '--enable-yp' '--enable-wddx'
    '--with-pear=/usr/share/pear' '--with-kerberos'
    '--enable-ucd-snmp-hack' '--with-unixODBC=shared ,/usr'
    '--enable-memory-limit' '--enable-shmop' '--enable-calendar'
    '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic'
    '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml'
    '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd'
    '--without-odbc' '--disable-dom' '--disable-dba'


    Any suggestions?

  • Mladen Gogala

    #2
    Re: OCI8 &amp; PHP5 OCIEnvNlsCreate () failed.

    On Tue, 07 Feb 2006 14:16:33 -0800, cyrano wrote:
    [color=blue]
    > I am having issues maintaining an oracle connection in my apache/php
    > web application. I am able to succesfully connect to an Oracle 9i
    > dbase using oci() and retrieve expected results for the first couple of
    > attempts - then it dies with a msg in the apache error_log that looks
    > like:
    >
    > PHP Warning: ocilogon() [<a
    > href='function. ocilogon'>funct ion.ocilogon</a>]: OCIEnvNlsCreate ()
    > failed. There is something wrong with your system - please check that
    > ORACLE_HOME is set and points to the right directory in ...[/color]

    It's an old and buggy OCI8. What you should do is relink without OCI8
    and link in OCI8 as a PECL extension.

    --
    大红鹰娱乐平台采用顶级加密技术,确保用户数据与交易的安全无虞,让玩家能够放心畅玩。


    Comment

    • John Navratil

      #3
      Re: OCI8 &amp; PHP5 OCIEnvNlsCreate () failed.

      Mladen,

      I've been beating my head against this for the last two days and saw
      your exchange with bugs.php.net :(

      Can you please elaborate on your suggestion and point me in the right
      direction for installing OCI8 as a PECL extension? I've never claimed
      to be much of an admin, I'm just a dumb programmer trying to get these
      pieces to play together.

      Many thanks!

      -- John Navratil

      "Mladen Gogala" <gogala@sbcglob al.net> wrote in message
      news:pan.2006.0 2.09.01.08.41.5 90711@sbcglobal .net...[color=blue]
      > On Tue, 07 Feb 2006 14:16:33 -0800, cyrano wrote:
      >[color=green]
      >> I am having issues maintaining an oracle connection in my apache/php
      >> web application. I am able to succesfully connect to an Oracle 9i
      >> dbase using oci() and retrieve expected results for the first couple
      >> of
      >> attempts - then it dies with a msg in the apache error_log that looks
      >> like:
      >>
      >> PHP Warning: ocilogon() [<a
      >> href='function. ocilogon'>funct ion.ocilogon</a>]: OCIEnvNlsCreate ()
      >> failed. There is something wrong with your system - please check that
      >> ORACLE_HOME is set and points to the right directory in ...[/color]
      >
      > It's an old and buggy OCI8. What you should do is relink without OCI8
      > and link in OCI8 as a PECL extension.
      >
      > --
      > http://www.mgogala.com
      >[/color]

      Comment

      • John Navratil

        #4
        Re: OCI8 &amp; PHP5 OCIEnvNlsCreate () failed.

        Greetings,

        I've been all over this PHP 5.1.2 OCI8 connection issue for the last
        couple of days and believe the problem is that the OCI8 extension
        requires more access to the oracle installation than it should. I was
        able to get past this by adding the 'oinstall' group to the 'apache'
        user. Obviously this is not a very secure solution, but it is as far as
        I was able to take it given that I am a terrible sysadmin and by no
        means and oracle DBA.

        For more information you may wish to look into bugs.php.net at bug#
        36355.

        -- John Navratil

        "Mladen Gogala" <gogala@sbcglob al.net> wrote in message
        news:pan.2006.0 2.09.01.08.41.5 90711@sbcglobal .net...[color=blue]
        > On Tue, 07 Feb 2006 14:16:33 -0800, cyrano wrote:
        >[color=green]
        >> I am having issues maintaining an oracle connection in my apache/php
        >> web application. I am able to succesfully connect to an Oracle 9i
        >> dbase using oci() and retrieve expected results for the first couple
        >> of
        >> attempts - then it dies with a msg in the apache error_log that looks
        >> like:
        >>
        >> PHP Warning: ocilogon() [<a
        >> href='function. ocilogon'>funct ion.ocilogon</a>]: OCIEnvNlsCreate ()
        >> failed. There is something wrong with your system - please check that
        >> ORACLE_HOME is set and points to the right directory in ...[/color]
        >
        > It's an old and buggy OCI8. What you should do is relink without OCI8
        > and link in OCI8 as a PECL extension.
        >
        > --
        > http://www.mgogala.com
        >[/color]

        Comment

        • Mladen Gogala

          #5
          Re: OCI8 &amp; PHP5 OCIEnvNlsCreate () failed.

          On Fri, 10 Feb 2006 17:21:30 +0000, John Navratil wrote:
          [color=blue]
          > For more information you may wish to look into bugs.php.net at bug#
          > 36355.[/color]

          John, thanks for pointing that out to me. It seems that you are right,
          something is wrong with the Oracle 10.2 environment but I am unable to
          pinpoint what exactly it is. So far, I discovered that this applies not
          only to PHP, but also to CGI scripts (using DBD). Now the number of files
          that are protected is huge:


          find $ORACLE_HOME \( -perm 750 -o -perm 640 \) -print|wc -l
          7890

          Now, doing something like chmod -R o+rx $ORACLE_HOME would probably solve
          the problem, but it might introduce few other problems as well. I'm
          considering downloading 10.1 client and linking PHP against it to see
          whether the problem persists.

          --
          大红鹰娱乐平台采用顶级加密技术,确保用户数据与交易的安全无虞,让玩家能够放心畅玩。


          Comment

          Working...