Yo guys. I have the following snippet:
$conn = oci_connect('user', 'pass', '(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)
(HOST=myhost.net)(PORT=1521)
)
)
(CONNECT_DATA=
(SERVER = DEDICATED)
(SERVICE_NAME = MYSERVICE)
)
)');
That is giving me the following error: oci_connect: ORA-12541: TNS:no listener
That's the first time I try to connect to a oracle database. What am I doing wrong? I'm on Windows.
Are you sure your TNS Listener service is running? You can check it by typing services.msc in the run dialogue box and you'll get a list of services running. If you do a quick lookup for Oracle, you will find TNS Listener. I am assuming your TNS entries are correct.
I was struggling with same error to connect oracle DB with codeigniter and finally after 2 days found some solution:
Note: This steps worked for me in Wamp server - windows 10
PATH
with instant client path ie D:\php\instantclient_21_3php.ini
and uncomment extension=php_oci8_12c.dll
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.