By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,319 Members | 2,361 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,319 IT Pros & Developers. It's quick & easy.

OCI8 & PHP5 OCIEnvNlsCreate() failed.

P: n/a
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'>function.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?

Feb 7 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Tue, 07 Feb 2006 14:16:33 -0800, cyrano wrote:
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'>function.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 ...


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

Feb 9 '06 #2

P: n/a
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" <go****@sbcglobal.net> wrote in message
news:pa****************************@sbcglobal.net. ..
On Tue, 07 Feb 2006 14:16:33 -0800, cyrano wrote:
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'>function.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 ...


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


Feb 9 '06 #3

P: n/a
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" <go****@sbcglobal.net> wrote in message
news:pa****************************@sbcglobal.net. ..
On Tue, 07 Feb 2006 14:16:33 -0800, cyrano wrote:
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'>function.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 ...


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


Feb 10 '06 #4

P: n/a
On Fri, 10 Feb 2006 17:21:30 +0000, John Navratil wrote:
For more information you may wish to look into bugs.php.net at bug#
36355.


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.

--
http://www.mgogala.com

Feb 11 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.