我很難從PHP5連接到Oracle 9.2。我已經嘗試了OCI的1.4.2和1.4.5,並且我能夠連接到Oracle 10g以上。我設置的測試數據庫連接腳本如下:PHP 5連接到Oracle 9.2
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');
}
我得到這個錯誤:用sqlplus來自同一
OCI8 DEBUG: OCINlsEnvironmentVariableGet at (ext\oci8\oci8.c:1826) OCI8 DEBUG L1: using shared pool: (0x2078b68) at (ext\oci8\oci8.c:3028) OCI8 DEBUG: OCIHandleAlloc at (ext\oci8\oci8.c:3039) OCI8 DEBUG: OCIHandleAlloc at (ext\oci8\oci8.c:3049) OCI8 DEBUG: OCIAttrGet at (ext\oci8\oci8.c:3082) OCI8 DEBUG: OCIAttrGet at (ext\oci8\oci8.c:3083) OCI8 DEBUG L1: (numopen=0)(numbusy=0) at (ext\oci8\oci8.c:3085) OCI8 DEBUG: OCISessionGet at (ext\oci8\oci8.c:3096) OCI8 DEBUG: OCIErrorGet at (ext\oci8\oci8.c:1632) OCI8 DEBUG: OCIHandleFree at (ext\oci8\oci8.c:2218) OCI8 DEBUG: OCIHandleFree at (ext\oci8\oci8.c:2221) OCI8 DEBUG: OCIErrorGet at (ext\oci8\oci8.c:1632) Array ( [code] => 1017 [message] => **ORA-01017: invalid username/password; logon denied** [offset] => 0 [sqltext] => )
這對我有幫助。我轉發到我的dba,他重置我的密碼不包含標點符號,我能夠進入。 – 2011-04-09 04:57:37