Bug #54716 [Com]: Internal Server Error when php compiled with oci driver

From: Date: Fri, 10 Jan 2014 14:06:04 +0000
Subject: Bug #54716 [Com]: Internal Server Error when php compiled with oci driver
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183693@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=54716&edit=1

 ID:                 54716
 Comment by:         dfwin at live dot de
 Reported by:        dominik dot szybowski at bzwbk dot pl
 Summary:            Internal Server Error when php compiled with oci
                     driver
 Status:             No Feedback
 Type:               Bug
 Package:            OCI8 related
 Operating System:   AIX
 PHP Version:        5.2.17
 Block user comment: N
 Private report:     N

 New Comment:

I am facing the same problems like the others. 

# Environment:
- RHEL Server 6.5
- PHP 5.2.17 (old applications ...) (tested PHP 5.3.28 also, same problem) 
- Apache 2.2.25
- mod_auth_kerb 5.4
- Oracle 11.2.0.1.0

# PHP build with
./configure --prefix=/usr/local/php5 \
			--with-libdir=lib64 \
			--with-apxs2=/usr/local/apache2/bin/apxs \
			--with-libxml-dir \
			--enable-wddx \
			--with-oci8=/data/oracle \
			--with-gd \
			--with-png-dir \
			--with-zlib-dir \
			--with-jpeg-dir \
			--with-freetype-dir \
			--with-curl \
			--with-ldap \
			--enable-exif \
			--enable-mbstring \
			--with-pspell \
			--enable-soap


As soon as you compile PHP with the oci8 extensions, mod_auth_kerb & apache crash with:
[debug] src/mod_auth_kerb.c(1101): [client xx.xx.xx.xx] GSS-API major_status:000d0000,
minor_status:96c73a87
[error] [client xx.xx.xx.xx] gss_acquire_cred() failed: Unspecified GSS failure.  Minor code may
provide more information ()

PHP Applications that use oci8, are working fine, but you can't use SSO.
Without oci8 extensions kerb/sso is working.


Previous Comments:
------------------------------------------------------------------------
[2013-02-18 00:34:50] php-bugs at lists dot php dot net

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

------------------------------------------------------------------------
[2012-10-18 21:34:13] debian at linux dot org

In our case the PDO Oracle driver break kerberos config.
No need to use it, the bug appears when reloading Apache if the PDO Oracle driver is "ON".

Just disabled it.

------------------------------------------------------------------------
[2012-08-24 06:44:48] debian at linux dot org

My Configuration :
- Debian GNU/Linux 6 64-bit
- Oracle Instantclient 11.2
- PHP 5.3.14
- mod_auth_kerb 5.4 
- Apache 2.2.16
- Kerberos Heimdal

This can be reproduced using Apache graceful command.
Just after the mod_auth_kerb will fail to read the kerberos conf
gss_import_name() failed: Miscellaneous failure (, Can't open/find Kerberos configuration file.
it will use the same default kerberos configuration as Oracle Database !!!
You can force the path using sqlnet.ora but it will fail after when using gss acquire credential
(unknown error 2 or 21).

We did not find a fix.

------------------------------------------------------------------------
[2012-01-09 14:01:56] rattlebrain at gmx dot net

I have a similar problem.

mod_auth_kerb works fine as long as I don't use the PHP OCI8 extension. As soon as I load the
OCI8 extension, mod_auth_kerb starts to behave weird. After an Apache (re)start everything is fine,
but when I reload Apache I'm getting in a browser "Internal Server Error" and in the
error log (just like the topic starter):

[Mon Jan 09 14:33:00 2012] [error] [client 10.206.33.199] gss_import_name() failed: Miscellaneous
failure (, Can't open/find Kerberos configuration file)

After stracing the Apache processes it appeared that /krb5/krb.conf is trying to be opened, but
obviously fails on a Linux system. I could prove that Oracle OCI is doing this by setting the
SQLNET.KERBEROS5_CONF parameter to a different value in sqlnet.ora.

So in some way OCI mixes up the Kerberos stuff that mod_auth_kerb is using, but only when Apache is
reloaded. Without everything works perfect, including the PHP OCI8 stuff.

I'm using:

- Debian GNU/Linux 6 64-bit
- Oracle Instantclient Basic 11.2.0.2.0
- PHP 5.3.3 (Debian package rebuild to include OCI8)
- mod_auth_kerb 5.4
- Apache 2.2.16

To create the OCI8 stuff I added the following parameters to the standard Debian PHP build
parameters:

--with-oci8=shared,/usr
--with-pdo-oci=shared,/usr

This is the complete configure command:

        CFLAGS="-g -O2 -O2 -Wall -fsigned-char -fno-strict-aliasing   -gstabs"
PROG_SENDMAIL="/usr/sbin/sendmail" ../configure \
                --prefix=/usr --with-apxs2=/usr/bin/apxs2 \
                --with-config-file-path=/etc/php5/apache2 \
                --with-config-file-scan-dir=/etc/php5/apache2/conf.d \
                --build=x86_64-linux-gnu --host=x86_64-linux-gnu --sysconfdir=/etc
--localstatedir=/var --mandir=/usr/share/man --disable-debug --with-regex=php --disable-rp
ath --disable-static --with-pic --with-layout=GNU --with-pear=/usr/share/php --enable-calendar
--enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-bcmath --with-bz2 
--enable-ctype --with-db4 --with-qdbm=/usr --without-gdbm --with-iconv --enable-exif --enable-ftp
--with-gettext --enable-mbstring --with-onig=/usr --with-pcre-regex=/usr --
enable-shmop --enable-sockets --enable-wddx --with-libxml-dir=/usr --with-zlib --with-kerberos=/usr
--with-openssl=/usr --enable-soap --enable-zip --with-mhash=yes --with-ex
ec-dir=/usr/lib/php5/libexec --with-system-tzdata \
                --without-mm \
                --with-curl=shared,/usr \
                --with-enchant=shared,/usr \
                --with-zlib-dir=/usr \
                --with-gd=shared,/usr --enable-gd-native-ttf \
                --with-gmp=shared,/usr \
                --with-jpeg-dir=shared,/usr \
                --with-xpm-dir=shared,/usr/X11R6 \
                --with-png-dir=shared,/usr \
                --with-freetype-dir=shared,/usr \
                --with-imap=shared,/usr \
                --with-imap-ssl \
                --with-interbase=shared,/usr --with-pdo-firebird=shared,/usr \
                --enable-intl=shared \
                --with-ttf=shared,/usr \
                --with-t1lib=shared,/usr \
                --with-ldap=shared,/usr \
                --with-ldap-sasl=/usr \
                --with-mcrypt=shared,/usr \
                --with-mysql=shared,/usr \
                --with-mysqli=shared,/usr/bin/mysql_config \
                --with-pspell=shared,/usr \
                --with-unixODBC=shared,/usr \
                --with-recode=shared,/usr \
                --with-xsl=shared,/usr \
                --with-snmp=shared,/usr \
                --with-sqlite=shared,/usr \
                --with-sqlite3=shared,/usr \
                --with-mssql=shared,/usr \
                --with-tidy=shared,/usr \
                --with-xmlrpc=shared \
                --with-pgsql=shared,/usr PGSQL_INCLUDE=pg_config --includedir \
                --with-oci8=shared,/usr \
                --enable-pdo=shared \
                --without-pdo-dblib \
                --with-pdo-mysql=shared,/usr \
                --with-pdo-odbc=shared,unixODBC,/usr \
                --with-pdo-pgsql=shared,/usr/bin/pg_config \
                --with-pdo-oci=shared,/usr \
                --with-pdo-sqlite=shared,/usr \
                --with-pdo-dblib=shared,/usr

The relevant Apache config block:

  <Location />
    AuthName                     "Restricted Area"
    AuthType                     Kerberos
    AuthzUnixgroup               On
    AuthzUnixgroupAuthoritative  On
    Krb5Keytab                   /etc/apache2/krb5.keytab
    KrbAuthoritative             On
    KrbDelegateBasic             Off
    KrbLocalUserMapping          On
    KrbMethodNegotiate           On
    KrbMethodK5Passwd            On
    KrbSaveCredentials           Off
    KrbServiceName               HTTP/server1.net@REALM.NET
    KrbVerifyKDC                 On
    Require                      group admins
  </Location>

The content on the webserver doesn't matter, Apache breaks before the content can be read, so
it doesn't help to provide a script.

I hope this helps. Do you need anything else?

------------------------------------------------------------------------
[2011-11-07 22:24:58] sixd@php.net

Please provide more details, including the complete build steps and a script that 
causes the error

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=54716


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=54716&edit=1


Thread (9 messages)

« previous php.bugs (#183693) next »