我很难从 PHP5 连接到 Oracle 9.2。我已经尝试过 1.4.2 和 1.4.5 的 OCI,并且能够连接到 Oracle 10g 及更高版本。我已经设置了一个测试数据库连接脚本,如下所示:
PHP代码:
echo "Testing Connection...";
ociinternaldebug(1);
$conn = oci_new_connect('someuser', 'somepassword', '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.0.0.2 )(PORT = 1521)) (CONNECT_DATA = (SID = ORCL)))');
if (!$conn) {
$e = oci_error();
print_r ($e);
}
else
{
echo('Successful');
}
我收到此错误:
OCI8 调试:OCINlsEnvironmentVariableGet at (ext\oci8\oci8.c:1826)
OCI8 DEBUG L1:使用共享池:(0x2078b68) at (ext\oci8\oci8.c:3028)
OCI8 调试:OCIHandleAlloc 位于 (ext\oci8\oci8.c:3039)
OCI8 调试:OCIHandleAlloc 位于 (ext\oci8\oci8.c:3049)
OCI8 调试:OCIAttrGet 位于 (ext\oci8\oci8.c:3082)
OCI8 调试:OCIAttrGet 位于 (ext\oci8\oci8.c:3083)
OCI8 调试 L1:(numopen=0)(numbusy=0) 在 (ext\oci8\oci8.c:3085)
OCI8 调试:OCISessionGet 位于 (ext\oci8\oci8.c:3096)
OCI8 调试:OCIErrorGet at (ext\oci8\oci8.c:1632)
OCI8 调试:OCIHandleFree 在 (ext\oci8\oci8.c:2218)
OCI8 调试:OCIHandleFree 在 (ext\oci8\oci8.c:2221)
OCI8 调试:OCIErrorGet at (ext\oci8\oci8.c:1632)
大批
(
[代码] => 1017
[消息] => **ORA-01017:用户名/密码无效;登录被拒绝**
[偏移] => 0
[sql文本] =>
)