Ubuntu 上的 oci8 错误
我已经按照电子书 地下 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
编辑 /usr/local/apache/bin/envvars 中的 envvars 文件,
如果您使用 oracle xe 10g,请添加此文件,
祝您好运:D
edit your envvars file in /usr/local/apache/bin/envvars
add this if you use oracle xe 10g
good luck :D
那么,$ORACLE_HOME 和 $LD_LIBRARY_PATH 是否指向正确的目录?
So, do $ORACLE_HOME and $LD_LIBRARY_PATH point to the right directories?
我因为这个错误花了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.