I am writing a PHP file to read some log files and write the content to Oracle database. I try to create a connection to the database as following.
$conn = oci_pconnect('myservice','oracle123','192.168.0.126:2483/XE');
if (!$conn) {
$e = oci_error();
echo trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
Here is my full code.
<!DOCTYPE html>
<html>
<body>
<?php
$conn = oci_pconnect('robiservice','oracle123','192.168.0.26:2483/XE');
if (!$conn) {
$e = oci_error();
echo trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
$myfile = fopen("14121800_ussd_cdr.file", "r") or die("Unable to open file!");
if ($myfile) {
while (($line = fgets($myfile)) !== false) {
echo $line . "</br>";
}
} else {
// error opening the file.
}
fclose($myfile);
?>
</body>
</html>
I am running my code in apache server. I put the code into htcocs folder.
But the problem is it gives a blank page. I think I need to install Oracle drivers in the server. But since I am a newbie to this I don't have clear idea about how to do it properly.
Any Suggestions are appreciated.
Thank You