Behind the Site »

Zend - The PHP Company

Connections to Oracle databases fail.

Article #188
Product: Zend Core for Oracle


Summary



Connecting to an Oracle database fails with a message:

ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed


Cause



This problem is caused by the absense of the LD_LIBRARY_PATH in the environment. This environmental variable is required to load the Oracle Instant Client libraries.


Resolution



Please start Apache using the apachectl script as this was modified by the Zend Core for Oracle installer to set the LD_LIBRARY_PATH variable.


More Info




several users who have oracle installed needed some extra parameters to be added to the
apachectl script.

alert: zend core users with bundled apache installed, should also add similar lines to /usr/local/Zend/apache2/bin/envvars.

Please modify the locations to the proper location in your system.
=========--------------==============----------------==============
LD_LIBRARY_PATH=/usr/local/Zend/apache2/lib:/u01/oracle/lib

TNS_ADMIN=/u01/oracle/network/admin

ORACLE_HOME=/u01/oracle

ORACLE_SID=PLAY

NLS_LANG=AMERICAN

export LD_LIBRARY_PATH TNS_ADMIN ORACLE_HOME ORACLE_SID NLS_LANG

=---------==============----------------=============------

Workaround



If you do not wish to use the apachectl script you may also add the LD_LIBRARY_PATH variable setting to your /etc/profile. Please be aware that this will affect all applications which rely on the LD_LIBRARY_PATH variable. It should be set to the /lib


The information in this article applies to



Zend Core for Oracle on Linux & Solaris.


Keywords



ZCO, Zend Core for Oracle, apachectl, Oracle Instant Client, OCIEnvNlsCreate, ocilogon()

Last Updated: 2007-01-08 11:46:46

 

» Send us feedback