Click here to Skip to main content
15,359,445 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,
I am trying to connect to remote oracle db and getting this error
ORA-24315: illegal attribute type


PHP
$db = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=1567))(CONNECT_DATA=(SERVICE_NAME=servicename)))";

$conn=oci_connect("username","pwd",$db);

If (!$conn)
echo 'Failed to connect to Oracle error';

else
echo 'Succesfully connected with Oracle DB';
$e = oci_error(); // For oci_connect errors pass no handle
//print_r($e);
oci_close($conn);


Can anybody help me with this?

What I have tried:

tried with only hostname, servicename.
Posted
Updated 16-Mar-22 22:15pm
Comments
Maciej Los 15-Mar-22 9:42am
   
Does HOST=host is storing proper IP address?
And - please - read this: https://stackoverflow.com/questions/25969695/php-oracle-connection-oci-connect-ora-24315-illegal-attribute-type-error

I think you need the actual values of the various parameters in the string. For example is "host" the actual name of the Oracle server? See Configuring Naming Methods[^].
   
Seems, that ORA-24315 error is caused by incomplete installation (OCI libraries are missing). See: Sfaturi Oracle / Tips and tricks OracleDBA: ORA-24315 in PHP function oci_connect[^]
   
Hello,
I added tnsnames.ora file at this path ORACLE_HOME/network/admin and it started working again.

Thanks
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900