Foros del Web » Programando para Internet » PHP »

Problema conexion a Oracle

Estas en el tema de Problema conexion a Oracle en el foro de PHP en Foros del Web. Tengo una aplicación PHP que se conecta al cliente de Oracle para hacer ciertas operaciones. En el php.ini indico la siguiente linea para que cargue ...
  #1 (permalink)  
Antiguo 26/05/2009, 06:18
 
Fecha de Ingreso: marzo-2009
Mensajes: 19
Antigüedad: 15 años, 1 mes
Puntos: 1
Problema conexion a Oracle

Tengo una aplicación PHP que se conecta al cliente de Oracle para hacer ciertas operaciones.

En el php.ini indico la siguiente linea para que cargue la dll correspondiente:

extension=php_oci8.dll

La dll se encuentra en el directorio correspondiente pero al arrancar Apache me da el siguiente error:

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\Archivos de programa\\Apache Group\\PHP\\ext\\php_oci8.dll' - No se encontr\xf3 el proceso especificado.\r\n in Unknown on line 0

No veo qué puede estar pasando.

Alguien puede ayudarme?
  #2 (permalink)  
Antiguo 26/05/2009, 07:17
Avatar de abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 14 años, 11 meses
Puntos: 1517
Respuesta: Problema conexion a Oracle

Te voy a dar los pasos que yo hice para conectarme a la base de datos oracle. A la verdad que me costo mucho trabajo pero con tanta insistencia lo logre asi que espero te sea útil. Esto lo instale en un sistema operativo de window

Cita:
//Busca la ultima version en la pagina oficial de oracle
1. Copy the directory "instantclient_10_2" in instantclient-basic-win32-10.2.0.4.zip to C:\

2. Copy the "tnsnames.ora" from C:\oracle\ora92\network\ADMIN\tnsnames.ora to C:\instantclient_10_2

3. Go to Control Panel -> System -> Advanced -> Environment Variables
Select "Path" in the "System variable" click "Edit" button and write at the beginning of "Variable value:" C:\instantclient_10_2; //This must be done before any value that is written in there.
Click the "New" button in "User variables for Administrator" and write in "Variable Name:" TNS_ADMIN
and in the "Variable value:" C:\instantclient_10_2;

4. Go to Control Panel -> Administrative tools -> Data Sources (ODBC) -> System DSN
Click the "Add..." button, select "Oracle in oracle92" click "Finish" button.
Write in the "Data Source Name" the name you want to call for the Database in the "TNS Service Name" write the Database name with the domain. Example db.example.com
Write the "User ID" of the Database click the "Test Connection" button to test the connection write the "Password" click the "OK" button.

5. Restart computer

6. Open an internet browser and write http://localhost/ click "phpinfo" in "Tools" press ctrl + f write OCI8 press two time enter and there must be a column telling you that OCI8 "Support" is enabled

7. To check if you can connect to oracle write this in a php file Example oracle.php
$DB_OCI = '(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = ****IP****)
(PORT = ***PORT***)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ****Name of Database no need to write domain only the name****)
)
)';
$USER_OCI = "USERNAME";
$PASS_OCI = "PASSWORD";
$c = oci_connect($USER_OCI, $PASS_OCI, $DB_OCI);
oci_close($c);

8. Open an internet browser and write http://localhost/oracle.php
if you get a blank page you connect succefully to the database.

//Error Category you can check them at http://www.ora-code.com/
9. If you get an error of ORA-12705: Cannot access NLS data files or invalid environment specified
Go to Start -> Run...
Write regedit in "Open:" click "OK" button
Select HKEY_LOCAL_MACHINE -> SOFTWARE -> ORACLE
In the right panel rename "NLS_LANG" to another name Example "NLS_LANG_RENAME"
Restart computer

10. If you get an error of ORA-03134: Connections to this server version are no longer supported.
An attempt was made to connect to an Oracle server of older version
Contact the administrator of the database to check the Version of Oracle in the server
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:08.