开发者

PHP + ORACLE connection problem

My error code is :

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 /data01/app/htdocs/doosanclub/include/classes.pinc on line 47

and the line 47 is :

46:     function connect($DBuser,$DBpassword,$DBsid) {
47:        $this->conn = OCILogon($DBuser,$DBpassword,$DBsid);
48:        $this->mode = OCI_DEFAULT;
49:    }

My ORACLE_HOME is set in root.sh : ORACLE_HOME=/oracle

and /oracle is a correct directory that contains /bin.

and.. my $DBsid value is also defined in /oracle/network/admin/tnsnames.ora.

I googled some docs and try it. I made a test php file. THe code is :

oci_internal_debug(1);   // turn on tracing
$conn = oci_connect("id", "pw", "SID");

and it displays :

OCI8 DEBUG: OCINlsEnvironmentVariableGet at (/temp/php_source/php-5.2.13/ext/oci8/oci8.c:1067) OCI8 DEBUG: OCIEnvNlsCreate at (/temp/php_source/php-5.2.13/ext/oci8/oci8.c:1223) 
Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME is set and points to the right directory in /data01/app/htdocs/d开发者_开发技巧oosanclub/db_connect_test.php on line 23
OCI8 DEBUG: OCIHandleFree at (/temp/php_source/php-5.2.13/ext/oci8/oci8.c:1547) 

ORACLE_HOME again.. maybe it is wrong..? I don't know..

It's the first time to setup these things. Please help me out this problem. Thanks!


I solved this problem just by adding putenv() into a DB connecting PHP file.

putenv("ORACLE_HOME=/oracle");

But it's very weird that phpinfo(); displays ORACLE_HOME=/oracle before I set ORACLE_HOME.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜