ORA-12154: and PHP OCI8
History
I have a Centos box setup with PHP5 and oracle enabled in php config. I had everything working for basic queries from orcle and then a poweroutage happend and the machine got rebooted. Now I am at a loss as to what is going on.
##########################
##########
#########
This is my test page and it was working like a charm before the reboot.
<?php
#testing for the oracle database fuctions
$conn = oci_connect('******', '*******', 'PILOT');
if (!$conn) {
$e = oci_error();
print htmlentities($e['message']
);
exit;
}
$query = 'select * from all_tables';
$stid = oci_parse($conn, $query);
if (!$stid) {
$e = oci_error($conn);
print htmlentities($e['message']
);
exit;
}
$r = oci_execute($stid, OCI_DEFAULT);
if (!$r) {
$e = oci_error($stid);
echo htmlentities($e['message']
);
exit;
}
print '<table border="1">';
while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) {
print '<tr>';
foreach ($row as $item) {
print '<td>'.($item?htmlentities
($item):'&
nbsp;').'<
/td>';
}
print '</tr>';
}
print '</table>';
oci_close($conn);
?>
##########################
##########
#######
This would just return all_tables as you can see from the query.
Config's
path to the oracle installation
/usr/lib/oracle/10.2.0.2/c
lient/lib/
path to the tnsnames.ora file
/usr/lib/oracle/10.2.0.2/c
lient/lib/
orafiles/t
nsnames.or
a
##########################
##########
#
rc.local
export ORACLE_HOME=/usr/lib/oracl
e/10.2.0.2
/client
export ORACLE_SID=orcl
export LD_LIBRARY_PATH=/usr/lib/o
racle/10.2
.0.2/clien
t/lib
export TNS_ADMIN=/usr/lib/oracle/
10.2.0.2/c
lient/lib/
orafiles
##########################
##########
#
##########################
##########
#
double check the paths
[root@cent]# echo $ORACLE_HOME
/usr/lib/oracle/10.2.0.2/c
lient
[root@cent]# echo $ORACLE_SID
orcl
[root@cent]# echo $LD_LIBRARY_PATH
/usr/lib/oracle/10.2.0.2/c
lient/lib
[root@cent]# echo $TNS_ADMIN
/usr/lib/oracle/10.2.0.2/c
lient/lib/
orafiles
##########################
##########
##
tnsnames.ora file
##########################
##########
##########
##
# TNSNAMES.ORA Network Configuration File:
#
LAZYBOY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.5)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = LAZYBOY)
)
)
PILOT =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.5)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PILOT)
)
)
PILOT2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.5)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PILOT2)
)
)
BOX =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.5)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = BOX)
)
)
##########################
##########
##########
##########
If you have anything that could help out on this that would be great.
Thanks in advanced for your time and input
Start Free Trial