This a place when you might need to consider to check for the message like

Status Failed Error was: ORA-12541: TNS:no listener

LISTENER
# listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
#(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.102)(PORT = 1521))

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = Manas6)(PORT = 1521))
)
)
 
# listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
#(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.102)(PORT = 1521))
#(ADDRESS = (PROTOCOL = TCP)(HOST = Manas6)(PORT = 1521))

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.102)(PORT = 1521))
)
)

 
SQL/PHP Code

<?php
//$db_conn = ocilogon("baba","son");
if (!$db_conn = @ocilogon("baba","son")) {
$error = ocierror();
printf("There was an error connecting. Error was: %s", $error["message"]);
die();
}
$cmdstr="select i_id, producer from wineflat where producer='Abbona'";
$parsed = ociparse($db_conn, $cmdstr);
ociexecute($parsed);
$nrows = ocifetchstatement($parsed, $results);
echo "<center>Through Wine Query<hr width='300' size='10' color='#999999'></center>";
echo "<html><head><title>Oracle PHP Test</title></head><body>";
echo "<center><h2>Oracle PHP Test</h2><br>";
echo "<table border=1 cellspacing='0' width='200'><tr>";
echo "<td bgcolor='#CCFFCC'><b>Producer</b></td><td bgcolor='#000080'><font color='#FFFF00'><b>Item-ID</b><font></td></tr>";
for ($i = 0; $i < $nrows; $i++ )
{
echo "<tr>\n";
echo "<td bgcolor='#CCFFCC'width='100'>" . $results["PRODUCER"][$i] . "</td>";
echo "<td bgcolor='#000080' width='100'><font color='#FFFF00'> " . number_format($results["I_ID"][$i], 2). "</font></td>";
echo "</tr>\n";
}
echo "<tr><td colspan='2'> Number of Rows: $nrows</td></tr></table>";
echo "<br><em>This is a test of listen.ora <br> To access your table, in windows, you need to adjust </em><br>";
echo "(ADDRESS = (PROTOCOL = TCP)(HOST = server.com)(PORT = 1521))<br>";
echo "<font color='#999999'># OR the TCP/IP addrees, you can get it by using ipconfig /all from command prompt</font><br>";
echo "(ADDRESS = (PROTOCOL = TCP)(HOST = Like xxx.xxx.x.x.)(PORT = 1521))<br>";
"</center></body></html>\n";
?>