nombreuses erreurs sur les fonctions php/oracle
Bonjour, j'ai récemment copié une application php5/oracle sur mon portable pour l'utiliser chez moi.
Je la lance via easyphp 2.0b et là voici les erreurs :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that PATH includes the directory with Oracle Instant Client libraries in C:\Program Files\EasyPHP 2.0b1\www\dossier patient\oracle.php on line 32
Warning: ocinewcursor() expects parameter 1 to be resource, boolean given in C:\Program Files\EasyPHP 2.0b1\www\dossier patient\oracle.php on line 39
Warning: ociparse() expects parameter 1 to be resource, boolean given in C:\Program Files\EasyPHP 2.0b1\www\dossier patient\oracle.php on line 62
Warning: ocierror() [function.ocierror]: OCIError: unable to find error handle in C:\Program Files\EasyPHP 2.0b1\www\dossier patient\oracle.php on line 66
Warning: ocicommit() expects parameter 1 to be resource, boolean given in C:\Program Files\EasyPHP 2.0b1\www\dossier patient\oracle.php on line 75
Warning: ocifetchinto() expects parameter 1 to be resource, null given in C:\Program Files\EasyPHP 2.0b1\www\dossier patient\oracle.php on line 87
Warning: ociparse() expects parameter 1 to be resource, boolean given in C:\Program Files\EasyPHP 2.0b1\www\dossier patient\oracle.php on line 62
Warning: ocierror() [function.ocierror]: OCIError: unable to find error handle in C:\Program Files\EasyPHP 2.0b1\www\dossier patient\oracle.php on line 66
Warning: ocicommit() expects parameter 1 to be resource, boolean given in C:\Program Files\EasyPHP 2.0b1\www\dossier patient\oracle.php on line 75
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP 2.0b1\www\dossier patient\cAuthentification.php on line 27
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP 2.0b1\www\dossier patient\cAuthentification.php on line 28
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP 2.0b1\www\dossier patient\cAuthentification.php on line 29
Notice: Trying to get property of non-object in C:\Program Files\EasyPHP 2.0b1\www\dossier patient\cAuthentification.php on line 30 |
Ceci apparait des la page de login et du coup impossible de passer cette page car apparement les erreurs coincent.
Ce que je trouve bizzare c'est que l'apllication fonctionne parfaitement en temps normal lorsqu'elle est sur le serveur de mon entreprise.
voici le fichier oracle.php:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
| <?php
// Classe accès à une base de données Oracle
class DB {
//--------------------------------------------------------------
//Déclaration des variables de classe
//--------------------------------------------------------------
var $BASE;
var $USER;
var $MOTDEPASSE;
var $CONNECT;
var $REQS;
var $error;
var $errMsg;
var $PARSE;
var $TNSNAME;
var $POINTEUR;
var $TABLEAU;
//--------------------------------------------------------------
//Initialisation des variables
//--------------------------------------------------------------
function DB($USER,$MOTDEPASSE) {
$this->BASE= BASE;
$this->USER = $USER;
$this->MOTDEPASSE = $MOTDEPASSE;
$this->TNSNAME = TNSNAME;
//Connection au serveur de base de données Oracle
$this->CONNECT = ocilogon($this->USER, $this->MOTDEPASSE,$this->BASE);
if (!$this->CONNECT) {
$this->error = true;
$this->errMsg = "Connection impossible";
// Sélection de la base de données
}
$this->POINTEUR = ocinewcursor($this->CONNECT);
if(!$this->POINTEUR) {
$this->error = true;
$this->errMsg = "Ouverture du pointeur impossible";
}
}
//--------------------------------------------------------------
// Déconnexion
//--------------------------------------------------------------
function deconnexion() {
$this->CONNECT = ocilogoff($this->POINTEUR);
}
//--------------------------------------------------------------
// Execution d'une requete
//--------------------------------------------------------------
function execRequete($sql) {
$this->PARSE = ociparse($this->CONNECT,$sql);
if(!$this->PARSE) {
$this->error = true;
$this->errMsg = "<B>Requête non valide</B> [<i>$sql</i>]: ".ocierror()." ";
} else {
$this->REQS = ociexecute($this->PARSE);
if (!$this->REQS) {
$this->error = true;
$this->errMsg = "<B>Requête impossible</B> [<i>$sql</i>]: ".ocierror()." ";
}
return $this->REQS;
}
ocicommit($this->CONNECT);
}
//--------------------------------------------------------------
// renvoie le nombre de lignes
//--------------------------------------------------------------
function requete_count_row($table, $clause="") {
$sql = 'SELECT COUNT(*) AS NB FROM '.$table.' '.$clause.'';
// echo $sql.'<br /><br />';
$this->execRequete($sql);
ocifetchinto($this->PARSE, $ligne, OCI_ASSOC);
return $ligne['NB'];
}
//--------------------------------------------------------------
// renvoie le nombre de lignes
//--------------------------------------------------------------
function requete_nb_Ligne($clause="") {
$sql = 'SELECT COUNT(*) AS NB '.$clause.' ';
//echo '<br>'.$sql.'<br>';
$this->execRequete($sql);
ocifetchinto($this->PARSE, $ligne, OCI_ASSOC);
//echo "--".$ligne['NB']."--";
return $ligne['NB'];
}
//--------------------------------------------------------------
//Traitement de la requete
//--------------------------------------------------------------
function requete_fetch_array() {
//nombre de champs
$nb_champs = ocinumcols($this->PARSE);
$this->TABLEAU = array();
ocifetchinto($this->PARSE, $ligne, OCI_ASSOC);
for ($i=1;$i<=$nb_champs;$i++) {
$this->TABLEAU[ocicolumnname($this->PARSE,$i)] = $ligne[ocicolumnname($this->PARSE,$i)];
}
return $this->TABLEAU;
}
//--------------------------------------------------------------
//Renvoie le nombre de champs
//--------------------------------------------------------------
function requete_nb_cols($sql) {
$this->PARSE = ociparse($this->CONNECT,$sql);
if(!$this->PARSE) {
$this->error = true;
$this->errMsg = "<B>Requête impossible</B> [<i>$sql</i>]: ".mysql_error()." ";
} else {
echo ocinumcols($this->PARSE);
}
}
}
?> |
et le fichier index
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| <?php
// Initialisation de la Contexte
session_name('patient');
session_start();
require("pageHTML.php");
require("connect.php");
require("constante.php");
require("fonction.php");
require("cQueryString.php");
require("oracle.php");
require("cContexte.php");
// Connexion à la base de données
$bd = new DB(USER,PASS_WORD);
// Construction de la réponse HTML
$pageHTML = new pageHTML($bd);
if ($bd->error = true) {
echo $bd->errMsg;
}
// Déconnexion
$bd->deconnexion();
?> |
A priori c'est la connexion qui foire :/
Si vous pouviez m'aider merci.