OCI8 with XAMPP 1.5.2 doesn't work fine

Problems with the Linux version of XAMPP, questions, comments, and anything related.

OCI8 with XAMPP 1.5.2 doesn't work fine

Postby jupela » 16. May 2006 13:06

I have installed a RedHat Enterprise 4 and XAMPP 1.5.1 with oci8 and it works fine.
If we installed the new version XAMPP 1.5.2 with oci8 we have problems in a php script that use the function oci_connect. The problem consists in that the server doesn't return any data or error.
In the script, if we remove the line that contains the 'oci_connect' function call, the php script is executed without errors.

Oracle Server Version is 9.x and Oracle instant client is 10.2.0.2-20060331

Please, someone has test the same configuration succesfully?

Thanks,
jupela
 
Posts: 15
Joined: 16. May 2006 12:35

Postby Oswald » 18. May 2006 12:41

Dear Julia!

XAMPP 1.5.2 works fine with 10.2.0.2-20060331. I just checked it on SuSE10.0. And I'm sure it also will work on RedHat Enterprise 4.

Are you sure you didn't change your software while upgrading XAMPP 1.5.1 to 1.5.2? The error message you mentioned (ORA-12154) says that you are using a wrong TNS name.

In /opt/lampp/htdocs/xampp/contrib/oracle.php you find a simple example how to connect to an Oracle database. Maybe this is helpful for you?

Many greetings
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Postby jupela » 18. May 2006 13:48

I have two RedHat4 servers in one of them I've installed the XAMPP 1.5.1 and the oracle instant client and in the other I've installed the XAMPP 1.5.2 and the oracle instant client.
I haven't upgraded the XAMPP version on none of them.

Both have the same tnsames.ora, in the same path '/opt/lampp', and the same php script. In the server with XAMPP 1.5.1 the php script works fine but in the other with XAMPP 1.5.2 it doesn't work the same php script. The problem is that the oci_connect() function call returns an error in Xampp 1.5.2 and in 1.5.1 version works fine.

I've test also latest xampp version on Kubuntu and have the same problem with oci_connect() function call.




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

The script is the next:

<?php
PutEnv("ORACLE_SID=SID");
PutEnv("ORACLE_HOME=/opt/lamp/lib");
PutEnv("TNS_ADMIN=/opt/lampp");
echo "<html>";
echo "<body>";

$c1 = oci_connect("user", "password", "TNSNAME");
if(!$c1){
echo 'No se pudo conectar a la base de datos \n';
}else{
echo "Conexion realizada con exito\n";
}

echo "</body>";
echo "</html>";
?>
--------------------------------------------------------

The error_log contains these messages:

[Mon May 15 12:56:41 2006] [notice] child pid 7890 exit signal Segmentation fault (11)
[Mon May 15 12:56:42 2006] [error] [client xxx.yyy.zzz.www] PHP Warning: oci_connect() [<a href='function.oci-connect'>function.oci-connect</a>]: Error while trying to retrieve text for error ORA-12154 in /opt/lampp/htdocs/test_oracle.php on line 8


Thanks ;-)
jupela
 
Posts: 15
Joined: 16. May 2006 12:35

Postby Oswald » 18. May 2006 14:00

Dear Julia!

Could you please call ls -l /opt/lampp/tnsnames.ora on the XAMPP 1.5.2 system? What's the output?

Greetings
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Postby jupela » 19. May 2006 08:26

Hello Oswald,

the output is the next:

ls -l /opt/lampp/tnsnames.ora
-rw-r--r-- 1 root root 298 may 18 12:11 /opt/lampp/tnsnames.ora

Greetings
Julia
jupela
 
Posts: 15
Joined: 16. May 2006 12:35

Postby Oswald » 19. May 2006 16:13

Dear Julia!

Thanks for the output. Looks perfect.

Please check the following items:

1) /opt/lampp/tnsnames.ora are exactly the same on both machines? Call md5sum /opt/lampp/tnsnames.ora on both systems. You should get the same checksum.

2) TNSNAME from oci_connect() is really defined in /opt/lampp/tnsnames.ora?

3) Only set TNS_ADMIN=/opt/lampp and remove the other two PutEnv lines.

Greetings and good luck
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Postby jupela » 22. May 2006 12:24

Hello Oswald,

Firstly, thank you, we have resolved the problem.
We must remove the two lines 'PutEnv (ORACLE_SID)' and 'PutEnv(ORACLE_HOME)'.
We can leave this one: 'PutEnv (TNS_ADMIN)' and it works without problems.

Thanks,
jupela
 
Posts: 15
Joined: 16. May 2006 12:35


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 10 guests