Ubuntu 上的 oci8 错误

发布于 2024-09-15 01:16:29 字数 574 浏览 8 评论 0原文

我已经按照电子书 地下 Oracle-PHP 手册。但是当我使用 oci_connect() 运行一些文件连接 oracle-PHP 时显示错误:

Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed. 
There is something wrong with your system - 
please check that ORACLE_HOME and LD_LIBRARY_PATH 
are set and point to the right directories   
in /usr/local/apache/htdocs/con_oracle.php on line 2

请帮助!!!

I have already installed oracle xe 10g, apache, php in ubuntu by following the ebook Underground Oracle-PHP-manual. But when i run some file connection oracle-PHP using oci_connect() show error :

Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed. 
There is something wrong with your system - 
please check that ORACLE_HOME and LD_LIBRARY_PATH 
are set and point to the right directories   
in /usr/local/apache/htdocs/con_oracle.php on line 2

HELP please !!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

十级心震 2024-09-22 01:17:17

编辑 /usr/local/apache/bin/envvars 中的 envvars 文件,

如果您使用 oracle xe 10g,请添加此文件,

export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export LD_LIBRARY_PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib:

祝您好运:D

edit your envvars file in /usr/local/apache/bin/envvars

add this if you use oracle xe 10g

export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export LD_LIBRARY_PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib:

good luck :D

┾廆蒐ゝ 2024-09-22 01:17:12

那么,$ORACLE_HOME 和 $LD_LIBRARY_PATH 是否指向正确的目录?

So, do $ORACLE_HOME and $LD_LIBRARY_PATH point to the right directories?

夏日落 2024-09-22 01:17:05

我因为这个错误花了6个多小时。
所有变量都设置好了,设置了oracle文件夹的读取权限,读取了互联网上的几十个页面,但没有办法解决这个问题。

最后我尝试了最后一件事。
无论如何,失败 OCIEnvNlsCreate() failed 是由于文件夹 /opt/oracle/instantclient 的权限造成的!当我将所有者和组设置为 www-data (在我的例子中)时,连接已成功建立! :-)
我在网上读到了有关权限的内容,但情况并不明确。

奇怪的是,这是我第二次安装这个模块,第一次安装就没有这样的问题!

我希望这对任何人都有帮助,甚至对我将来需要再次安装它时也是如此! :-D
问候。

I spent more than 6 hours with this error.
All variables were set well, read permissions on the oracle folder set, dozens of pages on internet read, but no way to solve this.

Finally I tried the last thing.
The failure OCIEnvNlsCreate() failed is due to permissions on a folder /opt/oracle/instantclient anyway! When I set the owner and group to www-data (in my case), the connection was established successfully! :-)
I read about permissions over the net, but it was not clearly such this.

The strange thing is that is the second time I am installing this module, and the first one had no such problems!

I am expect this may help to anyone, even to me when I need to install it again in the future! :-D
Regards.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文