I have this connection string on an older server which works fine and connects to a remote oracle server.
On this new server I installed oracle instant client simple and devel and php pecl oci8. Below is the screenshot of the oci8.
Here is the code I use to connect
$db = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" . $ORACLE_HOST . ")(PORT=" . $ORACLE_PORT . ")))(CONNECT_DATA=(SID=" . $ORACLE_DB . ")))"; $this->dbh = oci_connect($ORACLE_USER, $ORACLE_PASS, $db);
But when I try to connect to oracle I get this error
oci_connect(): Error while trying to retrieve text for error ORA-28547
If I type a random hostname I get
ORA-12154 error which makes sense
If I type a random SID I get
ORA-12514 error which makes sense
If I type a random port I get
ORA-12545 error which makes sense
nc the server and port I get this result
Ncat: Version 7.50 ( https://nmap.org/ncat ) Ncat: Connected to 10.10.40.21:1521. Ncat: 0 bytes sent, 0 bytes received in 0.02 seconds.
System I use is Centos 7 64bit, php 5.6
Anyone has any idea why this might happen?