php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41184 NOT CONNECT to DATABASE
Submitted: 2007-04-25 08:20 UTC Modified: 2007-04-25 10:24 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: sasha at it-energy dot ru Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 5.2.1 OS: SUSE 10
Private report: No CVE-ID: None
 [2007-04-25 08:20 UTC] sasha at it-energy dot ru
Description:
------------
Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME is set and points to the right directory in /opt/apache2/htdocs/dbtest01.php on line 24


Reproduce code:
---------------
 $ORACLE_HOME = getenv("ORACLE_HOME");
 echo "ORACLE_HOME=$ORACLE_HOME<br>\n";
 $NLS_LANG = getenv("NLS_LANG");
 echo "NLS_LANG=$NLS_LANG<br>\n";
 $LD_LIBRARY_PATH = getenv("LD_LIBRARY_PATH");
 echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH<br>\n";
 $ORA_NLS33 = getenv("ORA_NLS33");
 echo "ORA_NLS33=$ORA_NLS33<br>\n";
 $username = "*******"; $paswd    = "******";
 $dbstring = "******************";
 $db_conn = ocilogon($username, $paswd, $dbstring );
 if (!$db_conn){
   echo "...FAILED</p>";
 }

Expected result:
----------------
Connect to database.

Actual result:
--------------
ORACLE_HOME=/opt/oracle/oracle/product/10.2.0/client_1
NLS_LANG=american_america.CL8MSWIN1251
LD_LIBRARY_PATH=/opt/oracle/oracle/product/10.2.0/client_1/lib:/opt/apache2/lib:/opt/oracle/oracle/product/10.2.0/client_1/lib
ORA_NLS33=/opt/oracle/oracle/product/10.2.0/client_1/nls/data

Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME is set and points to the right directory in /opt/apache2/htdocs/dbtest01.php on line 24
...FAILED

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-25 08:26 UTC] sasha at it-energy dot ru
Installed full ORACLE client 10.2.0
php configure from root as:
./configure --with-apxs2=/opt/apache2/bin/apxs --with-openssl --enable-shmop --enable-sysvsem --enable-sysvshm --with-zlib --with-oci8=$ORACLE_HOME --enable-sigchild --with-iconv
Before configure test sqlplus user/name@string coneect succsessfuly.
 [2007-04-25 08:29 UTC] tony2001@php.net
>There is something wrong with your system - please check that 
>ORACLE_HOME isset and points to the right directory 

Do I really need to add something?
 [2007-04-25 09:02 UTC] sasha at it-energy dot ru
Yes !
I write "Before configure test sqlplus user/name@string conect succsessfuly"
If ORACLE_HOME not correct call sqlplus not correct start.
Realy, I do
. oraenv 
and set valid SID
 [2007-04-25 09:11 UTC] tony2001@php.net
>I write "Before configure test sqlplus user/name@string conect
>succsessfuly"

ORACLE_HOME should be available for _Apache_ process during the start up process.
Oracle directory also has to be readable by Apache user.
 [2007-04-25 09:39 UTC] sasha at it-energy dot ru
Available.
I run as root:
. oraenv ! Set all needed enviroment
sqlplus ..... for test cconnections
/opt/apache2/bin/apachectl start

For test I set chmod -R +r $ORACLE_HOME

Error the same !
 [2007-04-25 09:47 UTC] sasha at it-energy dot ru
May be problem in this, what directory structure not the same in 9.2 client and 10.2 client
In 9.2 client nlb file found in $ORACLE_HOME/ocommon/nls/ADMIN/DATA.
In 10.2 client nlb file found in $ORACLE_HOME/nls/data.

It may produce error ?

The directory in both case is standard. Not manualy moved and renamed.
 [2007-04-25 09:59 UTC] tony2001@php.net
Please ask your questions on a support forum.
This is not PHP problem.
 [2007-04-25 10:14 UTC] sasha at it-energy dot ru
It not PHP problem. It problem OCI8 extension.
This extension not work in this combination. It realy combination.
Configure and make runs successfuly.
What can I make or look for the decision of this problem?
 [2007-04-25 10:24 UTC] tony2001@php.net
>It not PHP problem. It problem OCI8 extension.
Your misconfiguration is noway OCI8 problem.
OCI8 extension does not care of any env variables, they are used by the Oracle client library.
The error you get means the Oracle client library failed to initialize and OCI8 extension has nothing to do about it.

>What can I make or look for the decision of this problem?
I've told you everything.
Check the ORACLE_HOME var and make sure the dir is readable by Apache user (www, nobody, apache, httpd or whatever you set it to).
Other env variables also might affect it.

If you still unable to make it work - please find a support forum and ask your questions there, since this is NOT a support forum.
Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 16:01:35 2024 UTC