ich versuche das erste mal XAMPP mit einer auf einer auf einem Server liegenden Oracle Datenbank zu verbinden. VERGEBLICH !!!!
Erst mal ein paar fakten was ich nun alles schon gemacht habe:
- Habe mir den instantclient-basic-linux32-10.2.0.2-20060331.zip von oracle runtergeladen und in /opt/oracle/instantclient entpackt.
- ls -l auf /opt/oracle/instantclient
insgesamt 97552
-rw-r--r-- 1 root root 1594191 2006-02-05 04:50 classes12.jar
-rw-r--r-- 1 root root 18774535 2006-02-05 04:50 libclntsh.so.10.1
-rw-r--r-- 1 root root 5623929 2006-02-05 04:50 libnnz10.so
-rw-r--r-- 1 root root 1398088 2006-02-05 04:50 libocci.so.10.1
-rw-r--r-- 1 root root 70690282 2006-02-05 04:50 libociei.so
-rw-r--r-- 1 root root 119919 2006-02-05 04:50 libocijdbc10.so
-rw-r--r-- 1 root root 1540457 2006-02-05 04:50 ojdbc14.jar
- Nun habe ich mit /opt/lampp/lampp oci8 den Pfad der Installation angegeben
- Jetzt habe ich mit phpinfo() unter oci8 nachgesehen ob alles richtig eingetragen wurde
oci8
OCI8 Support enabled
Revision $Revision: 1.257.2.8 $
Active Persistent Links 0
Active Links 0
Oracle Version 9.0
Compile-time ORACLE_HOME /opt/oracle/OraHome1
Libraries Used -Wl,-rpath,/opt/oracle/OraHome1/lib -L/opt/oracle/OraHome1/lib -lclntsh
Temporary Lob support disabled
Collections support disabled
- Nun testete ich ob die connection funktioniert. Aber als ich eine datei ausführte kam folgende fehlermeldung
Warning: ocilogon() [function.ocilogon]: _oci_open_server: ORA-12541: TNS:no listener in /opt/lampp/htdocs/testwebs/oracle/index.php on line 6
- Dies ist der Quelltext der index.php
- Code: Select all
<?
$dbuser = "user";
$dbpass = "pwd";
$connection = OCILogon("$dbuser","$dbpass","server");
if ($connection == false){
echo OCIError($connection). "<BR>";
exit;
}
$query = "Select * from tabelle";
$cursor = OCIParse ($connection, $query);
if ($cursor == false){
echo OCIError($cursor). "<BR>";
exit;
}
$result = OCIExecute ($cursor);
if ($cursor == false){
echo OCIError($cursor). "<BR>";
exit;
}
while (OCIFetchInto ($cursor, &$values)){
$variable1 = $values[0];
$variable2 = $values[1];
$variable3 = $values[2];
}
OCILogoff($connect);
?>
Was habe ich falschgemacht ??
Muss ich eine tnsnames.ora anlegen ??
Muss ich in der php.ini selber was ändern ??
Bitte um Hilfe
mfg
Schurl