httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose Tremols <>
Subject [users@httpd] Problem with dbd authentication, Oracle, oci8 and PHP
Date Tue, 24 Nov 2015 03:43:33 GMT

I've been fighting with this problem for a week.

I have installed oci8 in order to access an Oracle 11g database from php 
My php pages work fine. I can connect, select, update, insert.
Here is the code of a simple php page named connect.php that I put under 
Apache default site
I access http://localhost/connect.php and it displays the list of the 
user's tables
     $conn = oci_connect('havana', 'cdcdcdcdcdc', '//');

     $stid = oci_parse($conn, 'select table_name from user_tables');

     echo "<table>\n";
     while (($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) 
!= false) {
         echo "<tr>\n";
         foreach ($row as $item) {
             echo "  <td>".($item !== null ? htmlentities($item, 
ENT_QUOTES) : "&nbsp;")."</td>\n";
         echo "</tr>\n";
     echo "</table>\n";

The problem is that once I configure Apache dbd authentication for 
another site, my php code against the database stop working.
I try to access the same page http://localhost/connect.php without any 
modification to the page and I have this error screen:

I don't  need to access the authenticated site. Just defining the 
virtual host with the dbd authentication and restarting Apache, makes my 
php database related code stop responding
I don't even need to configure all the directives for the authentication.
I just put the DBDDriver oracle directive, restart Apache and php-oracle 
doesn't work anymore

This is the virtual host definition:

             <VirtualHost *:80>
                 ServerAdmin webmaster@havana.tld
                 DocumentRoot "/srv/auth"
                 ServerName auth.havana.tld
                 ErrorLog "/var/log/httpd/auth.havana.tld-error_log"
                 CustomLog "/var/log/httpd/auth.havana.tld-access_log" 
                 DBDriver oracle
                 DBDParams "user=havana pass=crosemont 
                 DBDPersist on

             <Directory "/srv/auth">
                 AuthType Basic
                 AuthName "Havana"
                 AuthBasicProvider dbd
                 Require valid-user
                 AuthDBDUserPWQuery "SELECT p_client FROM client WHERE 
n_client = %s"

     -Apache 2.4.6 Over CentOS 7
     -An authenticated site configured to use dbd authenticacion against 
an Oracle 11g database
           I have compiled apr-1.5.2 libraries against Oracle instanclient

I would appreciate any help.

Best regards,

View raw message