ID: 13826
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Old Bug Type: Unknown/Other Function
Bug Type: OCI8 related
Operating System: windows 2000
PHP Version: 4.0.5
New Comment:

Set those environment variables for the Apache. 
In linux you would set them before starting Apache,
but I don't know how it's done in Windows.

This is not a bug.

Ask further support questions on the mailing lists:

http://www.php.net/support.php

Also this manual page has some solutions mentioned in
the user contributed notes:

http://www.php.net/oci8

--Jani


Previous Comments:
------------------------------------------------------------------------

[2001-10-25 11:51:09] [EMAIL PROTECTED]

//CODE
function ligaGAV() {
//   return odbc_connect("gavdsn","gav_gestor","gestor");
   putenv("ORACLE_SID=gaviao");
   putenv("ORACLE_HOME=d:/orant/");

   echo getenv("ORACLE_SID") . "<br>\n";
   echo getenv("ORACLE_HOME") . "<br>\n";

   $conn = ora_logon("gav_gestor@gaviao","gestor");

   return $conn;

}//end function ligaGAV()

/* ==============================================================================
Funcao: deligaOrcl
Descricao: Recebe o identificador da ligacao Oracle a desligar.
Criacao: 2001-10-25
Autoria: Patricia Albano (TMN)

============================================================================== */
function desligaOrcl($idLig) {
   //odbc_close($idLig);
   ora_logoff($idLig);
}//end function desligaOrcl


function contaReclamacoes() {

   $odbcOrcl = ligaGAV();

   if ($odbcOrcl) {
      echo "Ligacao ORCL<br>\n";

      $cur = ora_do($odbcOrcl,"SELECT COUNT(*) FROM gareclamacao");
      if ($cur) {
         echo ora_getcolumn($cur,0);
      } else {
      }


   } else {
      echo "ERRO: " . ora_errorcode($odbcOrcl) . " - " . ora_error($odbcOrcl) . 
"<br>\n";
   }//end if ($odbcOrcl)

   desligaOrcl($odbcOrcl);
}
-----------------------------------------------------------~
Extension php_oracle.dll instaled

Problem: first time the script is runned with Apache, there is no problem. Second time 
I get: 
Warning: Oracle: Connection Failed: ORA-12154: TNS:could not resolve service name in 
d:\program files\apache group\apache\htdocs\indicadores\includes\trataorcl.php on line 
29

Warning: Supplied argument is not a valid Oracle-Connection/Cursor resource in 
d:\program files\apache group\apache\htdocs\indicadores\includes\trataorcl.php on line 
63

Warning: Supplied argument is not a valid Oracle-Connection/Cursor resource in 
d:\program files\apache group\apache\htdocs\indicadores\includes\trataorcl.php on line 
63
ERRO: - 

Warning: Supplied argument is not a valid Oracle-Connection resource in d:\program 
files\apache group\apache\htdocs\indicadores\includes\trataorcl.php on line 44


------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=13826&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to