Oracle 11.1.0.7和WAMP oci_connect失败 [英] Oracle 11.1.0.7 and WAMP oci_connect failure

查看:60
本文介绍了Oracle 11.1.0.7和WAMP oci_connect失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在本地WAMP服务器和我拥有的一些Oracle 11.1.0.7之间配置简单的连接. 显然,PHP有各种各样的解决方案和无法启动的神奇情况.

I'm trying to configure a simple connection between my local WAMP server and some Oracle 11.1.0.7 I have. Apparently PHP has all sorts of solutions and magic situations where it fails to start.

我正在运行WAMP的最新32位版本(我今天再次拿来只是为了检查一下) 数据库机也是32位的,不是本地的

I'm running the latest 32bit version from WAMP (I fetched it today again just to check) The db machine is also 32bit, not local

这是我每次遇到相同错误时都尝试连接到数据库的方法:

here are my attempts in connecting to the database, everytime I got the same error :

    $db = "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = some.ip.addr)(PORT = 1521)))(CONNECT_DATA=(SID=somesid)))";
    //$link = oci_connect('sqlmap', 'sqlmap', 'some.ip.addr') OR die('oci_connect' . print_r(oci_error()));
    //$link = oci_connect('sqlmap', 'sqlmap', $db) OR die('oci_connect error' . print_r(oci_error()));
    //$link = oci_connect('sqlmap','sqlmap', 'some.ip.addr/somesid') or die('<= oci_connect ' . print_r(oci_error()));
    //$link = oci_connect('sqlmap','sqlmap', '//some.ip.addr/somesid') or die('<= oci_connect ' . print_r(oci_error()));
    $link = oci_connect('sqlmap','sqlmap', '//some.ip.addr/somesid');

Warning: oci_connect() [function.oci-connect]: ORA-24315: illegal attribute type in


Array ( [code] => 24315 [message] => ORA-24315: illegal attribute type [offset] => 0 [sqltext] => ) oci_connect1

有关OCI的更多信息

OCI8 Support    enabled
Version 1.4.7
Revision    $Revision: 321634 $
Active Persistent Connections   0
Active Connections  0
Oracle Run-time Client Library Version  10.2.0.1.0
Oracle Instant Client Version   11.2
Temporary Lob support   enabled
Collections support enabled

Directive   Local Value Master Value
oci8.connection_class   no value    no value
oci8.default_prefetch   100 100
oci8.events Off Off
oci8.max_persistent -1  -1
oci8.old_oci_close_semantics    Off Off
oci8.persistent_timeout -1  -1
oci8.ping_interval  60  60
oci8.privileged_connect Off Off
oci8.statement_cache_size   20  20


Apache Version :
2.2.21  
PHP Version :
5.3.9

如果有人能提示我可能会缺少的东西,我会感到很高兴

I would be fond if anyone could hint me what I might be missing

推荐答案

查看您的配置,您同时安装了Oracle Client和Oracle Instant Client:

Looking at your configuration, you have both the Oracle Client and the Oracle Instant Client installed:

Oracle Run-time Client Library Version  10.2.0.1.0
Oracle Instant Client Version   11.2

但是,我的经验是PHP仅会使用一个或另一个-基本上,首先找到的那一组库都将被使用. 由于您可以很好地连接到Oracle 10g,但不能很好地连接到11g,这表明10g客户端库在路径上比Instant Client库更高".

However, my experience is that PHP will only use one or the other - basically, whichever set of libraries is found first will get used. Since you can connect fine to Oracle 10g, but not to 11g, that suggests that the 10g Client Library is "higher" in your path than the Instant Client libraries.

我建议您探索两种选择:

Two options I'd suggest exploring:

  1. 安装完整的Oracle 11g客户端
  2. 专门更改您的路径以确保首先找到Instant Client库-当然,请确保您正在影响PHP使用的有效路径,而不仅仅是影响单独上下文中的PATH变量...

我实际上从未使PHP与Instant Client一起正常工作-我放弃并安装了完整的客户端-因此,我个人的建议是选择1,但是如果在您的环境中不可行,请首先使用PATH.

I've never actually got PHP to work correctly with the Instant Client - I gave up and installed the full client - so my personal recommendation is option 1, but if that's not practical in your environment, work with the PATH first.

这篇关于Oracle 11.1.0.7和WAMP oci_connect失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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