OCIEnvNlsCreate()失败。当我尝试连接我的oracle数据库在php [英] OCIEnvNlsCreate() failed. When i try to connect my oracle database in php

查看:1678
本文介绍了OCIEnvNlsCreate()失败。当我尝试连接我的oracle数据库在php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

phpinfo

_ENV["ORACLE_HOME"] C:\oracle\instantclient_11_2\
_ENV["OS"]  Windows_NT
_ENV["Path"]    C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\oracle\instantclient_11_2;\;

oci8

OCI8 Support    enabled
Version     1.2.5
Revision    $Revision: 1.269.2.16.2.43 $
Active Persistent Connections   0
Active Connections  0
Temporary Lob support   enabled
Collections support     enabled 

php代码

<?php
     $conn = OCILogon('mppd1','mppd1', "121.256.476.86:1521/mydatabase");

$query = 'select * from users';

$stid = OCIParse($conn, $query);
//OCIExecute($stid, OCI_DEFAULT);
while ($succ = OCIFetchInto($stid, $row)) {
foreach ($row as $item) {
echo $item." ";
}
echo "<br>\n";
}

OCILogoff($conn);
?>

我收到此错误

Severity: Warning

Message: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that PATH includes the directory with Oracle Instant Client libraries


推荐答案

我解决了它复制C:\instantclient_11_2(请检查你的是什么)在Windows中的system和system32文件夹的所有内容,然后我删除C:\instantclient_11_2的路径PATH环境变量。

I solved it copying all the content of C:\instantclient_11_2 (please check what´s yours) inside system and system32 folders in Windows , then I delete the path of C:\instantclient_11_2 in the PATH enviroment variable.

我使用XAMPP和Windows 8,这是我第一次看到这个问题。我总是配置正确oci 8与xampp和窗口在几分钟。我希望这会帮助你。

I am using XAMPP and Windows 8 and it´s the first time I see this issue. I always configured properly oci 8 with xampp and windows in a few minutes. I hope this would help you.

这篇关于OCIEnvNlsCreate()失败。当我尝试连接我的oracle数据库在php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆