I was thinking that using the easy connect naming method in oci_connect does not require a running local tnslsnr!? Am I wrong?
$db = '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = my-ora-host.example.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = my-service.example.com)))';
// $db = '//my-ora-host.example.com:1521/my-service.example.com';
$ora_conn = oci_connect('test', 'test', $db);
Using both versions of the 'db' I receive the error:
mod_fcgid: stderr: PHP Warning: oci_connect(): ORA-12541: TNS:no listener in ....
I am using a self compiled PHP 5.3.8 using Oracles instantclient 126.96.36.199.0 (on Linux, 32bit).
There are NO special environment variables ( like ORACLE_HOME or TNS_ADMIN), because I was thinking that I don't need them...
Am I wrong? Is a running tnslsnr always required? Or am I doing wrong in specifying the connection string?
Any help is appreciated!
The connection strings are fine. They only control how PHP attempts to connect to the DB. The DB will need a listener started so that those incoming requests are handled. Use: 'lsnrctl start' on the DB machine.