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
