I'm developing a PHP API that connects to an Oracle database, but unfortunately the connection does not work. First of all, I implemented the development environment (oracle database server + apache server), all well configured, I guess. The problem is that I do not get any response from the code I wrote, even when I type incorrect data.
PHP Info oci8:
[rvieira@localhost ~]$ php --ri oci8
oci8
OCI8 Support => enabled
Version => 1.4.10
Revision => $Id: 44bfa713983a99b3e59477f6532e5fb51b6dee94 $
Active Persistent Connections => 0
Active Connections => 0
Oracle Run-time Client Library Version => 11.2.0.2.0
Oracle Instant Client Version => 11.2
Temporary Lob support => enabled
Collections support => enabled
Directive => Local Value => Master Value
oci8.max_persistent => -1 => -1
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
oci8.default_prefetch => 100 => 100
oci8.old_oci_close_semantics => Off => Off
oci8.connection_class => no value => no value
oci8.events => Off => Off
PHP Code:
<?php
$connection = oci_connect('sys', 'rvieira', 'localhost/xe');
if (!$connection) {
$m = oci_error();
echo $m['message'], "\n";
exit;
}
else {
print "Connected to Oracle!";
}
?>
I also leave here the tutorials that I followed to configure the development environment: