1
我的错误代码是:PHP + ORACLE连接问题
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
和线47是:
46: function connect($DBuser,$DBpassword,$DBsid) {
47: $this->conn = OCILogon($DBuser,$DBpassword,$DBsid);
48: $this->mode = OCI_DEFAULT;
49: }
我ORACLE_HOME设置在root.sh:ORACLE_HOME=/oracle
/oracle
和是一个包含/bin
的正确目录。
和..我的$ DBsid值也在/oracle/network/admin/tnsnames.ora
中定义。
我搜索了一些docs并尝试它。我做了一个测试php文件。 的代码是:
oci_internal_debug(1); // turn on tracing
$conn = oci_connect("id", "pw", "SID");
并显示:
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/doosanclub/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
再次..也许是错的..?我不知道..
这是第一次设置这些东西。 请帮我解决这个问题。谢谢!
可能是一些文件permissioin问题?在用户apache下运行php脚本?它有权限读取/ oracle目录吗? – heximal
你怎么在环境看,当你运行“的phpinfo()” –
詹姆斯 - 安德森//什么样的信息,你需要知道解决这个问题?我很抱歉,但由于安全问题,我无法给你全部信息。 – Deckard