Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

oci_pconnect(): ORA-12541: TNS:no listener (Read details)

3211911Apr 2 2016 — edited Apr 12 2016

I have created a database for E-voting system on SQL developer Oracle 12c by CREATE_TABLE commands and INSERT_INTO commands for making and inserting data into the tables. In 12c, I had a connection call "Qurat" to the database. I did not use the create database command.

I need to connect it to a webpage using PHP. I've PHP 5.6.19 and WAMP 3.0.0 on Windows10 [Localhost runs smoothly, APACHE is connected, all services running. WAMP is green]

I downloaded the instant client OCI8 for Oracle and did the configuration in PHP.ini file.

Now when I run the following script:<?php

<?php

$c = oci_pconnect("scott", "tiger", "localhost/orcle");

if(!$c) {echo 'Connected';}

else {echo 'failed';}

$result = oci_parse($c, "select fname from NIC where NICno=4250167366706");

if (!$result){

$err = oci\_error();

echo "Could not parse the oci";

exit;

}

$r = oci_execute($result);

if (!$r) {

$error = oci_error($conn);

echo "Could not execute." . $error['message'];

exit;

}

oci\_close();

?>

It gives me the following output which indicates that the connection is successfully done. But there's issue in parsing it.

Warning: oci_pconnect(): ORA-12541: TNS:no listener in C:\wamp\www\Hello\1.php on line 3

Connected

Warning: oci_parse() expects parameter 1 to be resource, boolean given in C:\wamp\www\Hello\1.php on line 7

Could not parse the oci

I have checked the 'Services' , listener.ora file, tnsnames.ora file. I've also tried reloading using lsnrctl and it successfully does that. I have tried almost every solution on the internet.

I have two OracleHomeUser(s) although I use only one of them. I tried deleting the folder for OracleHomeUser1 manually by shift+delete but the deletion process had to skip some files since they are being used somewhere else. Is this problem because of this?
or Am i referring to the database in a wrong way?

This is the output i get from lsnrctl status

Capture.jpg

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 5 2016
Added on Apr 2 2016
3 comments
13,778 views