This screencast is to demonstrate the process of using Oracle 19 Instant Client, PHP8 and Oracle 19C on a Remote Machine. You can either connect to the container database or pluggable database.
Now, you can check the oracle database connection using this code snippet.
<?php
// check oracle database connection
if (!defined("ENVIRONMENT"))
define("ENVIRONMENT", "live");
$connection_string = "(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 3838))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAJAN)
))";
$oraConnection = oci_connect('username', 'password', $connection_string);
if (!$oraConnection) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
} else {
echo "Successfully connected to Oracle";
}
?>
Leave a Reply
You must be logged in to post a comment.