From: madlybad at hotmail dot com
Operating system: Windows XP Pro SP2
PHP version: 5.1.2
PHP Bug Type: OCI8 related
Bug description: ORA-12154: using Oracle 9i
Description:
------------
My configuration to connect to Oracle 9i is correct. I am able to connect
to Oracle 9i using SQLPLus and TOAD. But using PHP I am unable to connect
to Oracle this error appears "ORA-12154: TNS:could not resolve the connect
identifier specified".
Reproduce code:
---------------
<?php
$conexion = oci_pconnect('TIENDAS','tiendas','DAVID');//('hr', 'hr',
'orcl');
if (!$conexion) {
$e = oci_error();
echo "Error al Conectarse";
print htmlentities($e['message']);
exit;
}
$consulta = 'SELECT * FROM promotoras_tda';
$id_sentencia = oci_parse($conexion, $consulta);
if (!$id_sentencia) {
$e = oci_error($conexion);
echo "Error al Parsear";
print htmlentities($e['message']);
exit;
}
$r = oci_execute($id_sentencia, OCI_DEFAULT);
if (!$r) {
$e = oci_error($id_sentencia);
echo "Error al Ejecutar la Conuslta";
echo htmlentities($e['message']);
exit;
}
print '<table border="1">';
while ($fila = oci_fetch_array($id_sentencia, OCI_RETURN_NULLS)) {
print '<tr>';
foreach ($fila as $item) {
print '<td>'.($item?htmlentities($item):' ').'</td>';
}
print '</tr>';
}
print '</table>';
oci_close($conexion);
?>
Expected result:
----------------
connected!
Actual result:
--------------
ORA-12154: TNS:could not resolve the connect identifier specified
--
Edit bug report at http://bugs.php.net/?id=36649&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36649&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36649&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36649&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36649&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36649&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36649&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36649&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36649&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36649&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36649&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36649&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36649&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36649&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36649&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36649&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36649&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36649&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36649&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36649&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36649&r=mysqlcfg