php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25741 Apache Cannot Load libphp4.so Due To Undefined Symbol __cmpdi2
Submitted: 2003-10-03 02:43 UTC Modified: 2003-10-13 03:03 UTC
Votes:4
Avg. Score:4.2 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: james at inpho dot com dot au Assigned:
Status: No Feedback Package: OCI8 related
PHP Version: 4.3.3 OS: RedHat 9
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-10-03 02:43 UTC] james at inpho dot com dot au
Description:
------------
If PHP 4.3.3 is compiled with --oci8 switch against Oracle 9.0.1, when Apache 2.0.47 attempts to load the module it fails as per below:

Starting httpd: Syntax error on line 57 of /usr/local/apache2/conf/httpd.conf:
Cannot load /usr/local/apache2/modules/libphp4.so into server: /usr/local/oracle/product/9.0.1/lib/libclntsh.so.9.0: undefined symbol: __cmpdi2

=== Why Use Oracle Client 9.0.1?

In order to connect to legacy Oracle 7.2/7.3 instances. Versions of Oracle after this do not support these databases.

=== Building PHP

glibc has to be downgraded in order to compile PHP 4.3.3 successfully. Compile failure:

CONFIGURE:   './configure' '--with-mysql=/usr/local/mysql' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-openssl=/usr/local/ssl' '--with-oci8' '--enable-sigchild'
CC:         gcc
CFLAGS:     -g -O2
CPPFLAGS:
CXX:
CXXFLAGS:
INCLUDES:    -I$(top_builddir)/Zend -I/usr/local/ssl/include -I/usr/local/mysql/include -I/usr/local/oracle/product/9.0.1/rdbms/public -I/usr/local/oracle/product/9.0.1/rdbms/demo -I/usr/local/oracle/product/9.0.1/plsql/public
LDFLAGS:     -Wl,-rpath,/usr/local/ssl/lib -L/usr/local/ssl/lib -Wl,-rpath,/usr/local/mysql/lib -L/usr/local/mysql/lib -Wl,-rpath,/usr/local/oracle/product/9.0.1/lib -L/usr/local/oracle/product/9.0.1/lib
LIBS:       -lmysqlclient -lz -lssl -lcrypto -lresolv -lm -ldl -lnsl  -ldl -lm -lclntsh
DLIBS:
SAPI:       apache2handler
PHP_RPATHS:  /usr/local/ssl/lib /usr/local/mysql/lib /usr/local/oracle/product/9.0.1/lib
uname -a:   Linux staging.int.inpho.com.au 2.4.20-19.9 #1 Tue Jul 15 17:18:13 EDT 2003 i686 i686 i386 GNU/Linux

gcc -o conftest -g -O2   -Wl,-rpath,/usr/local/ssl/lib -L/usr/local/ssl/lib -Wl,-rpath,/usr/local/mysql/lib -L/usr/local/mysql/lib -Wl,-rpath,/usr/local/oracle/product/9.0.1/lib -L/usr/local/oracle/product/9.0.1/lib conftest.c -lmysqlclient -lz -lssl -lcrypto -lresolv -lm -ldl -lnsl  -ldl -lm -lclntsh 1>&5
/usr/local/oracle/product/9.0.1/lib/libclntsh.so: undefined reference to `__ctype_b'
/usr/local/oracle/product/9.0.1/lib/libclntsh.so: undefined reference to `__ctype_toupper'
/usr/local/oracle/product/9.0.1/lib/libclntsh.so: undefined reference to `__ctype_tolower'
collect2: ld returned 1 exit status

=== Downgrading glibc

As per instructions here:

http://www.puschitz.com/InstallingOracle9i.shtml

rpm -Uvh --force glibc-2.3.2-5.i686.rpm glibc-common-2.3.2-5.i386.rpm glibc-devel-2.3.2-5.i386.rpm 

configure/make now succeeds.

=== Installation of PHP 4.3.3

Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/man/man1/
Installing PHP SAPI module:       apache2handler
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp4.la /usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install cp libphp4.la /usr/local/apache2/modules/
cp .libs/libphp4.so /usr/local/apache2/modules/libphp4.so
cp .libs/libphp4.lai /usr/local/apache2/modules/libphp4.la
libtool: install: warning: remember to run `libtool --finish /home/distrib/software/php-4.3.3/libs'
chmod 755 /usr/local/apache2/modules/libphp4.so
[activating module `php4' in /usr/local/apache2/conf/httpd.conf]
Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20020429/
Installing PEAR environment:      /usr/local/lib/php/
[PEAR] Archive_Tar    - already installed: 1.1
[PEAR] Console_Getopt - already installed: 1.0
[PEAR] PEAR           - already installed: 1.2.1
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
[PEAR] DB             - already installed: 1.5.0RC1
[PEAR] HTTP           - already installed: 1.2.1
[PEAR] Mail           - already installed: 1.1.1
[PEAR] Net_SMTP       - already installed: 1.2.3
[PEAR] Net_Socket     - already installed: 1.0.1
[PEAR] XML_Parser     - already installed: 1.0.1
[PEAR] XML_RPC        - already installed: 1.0.4
Installing build environment:     /usr/local/lib/php/build/
Installing header files:          /usr/local/include/php/
Installing helper programs:       /usr/local/bin/
  program: phpize
  program: php-config
  program: phpextdist

=== Starting Apache 2.0.47

Starting httpd: Syntax error on line 57 of /usr/local/apache2/conf/httpd.conf:
Cannot load /usr/local/apache2/modules/libphp4.so into server: /usr/local/oracle/product/9.0.1/lib/libclntsh.so.9.0: undefined symbol: __cmpdi2

=== ldd libphp4.so

ldd libphp4.so
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x40251000)
        libz.so.1 => /usr/lib/libz.so.1 (0x4027e000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x4028d000)
        libm.so.6 => /lib/i686/libm.so.6 (0x4029f000)
        libdl.so.2 => /lib/libdl.so.2 (0x402c1000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x402c5000)
        libclntsh.so.9.0 => /usr/local/oracle/product/9.0.1/lib/libclntsh.so.9.0 (0x402da000)
        libc.so.6 => /lib/i686/libc.so.6 (0x40a31000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
        libwtc9.so => /usr/local/oracle/product/9.0.1/lib/libwtc9.so (0x40b6a000)
        libpthread.so.0 => /lib/i686/libpthread.so.0 (0x40b6d000)

=== Other Notes

I also tried with the --enable-libgcc to no avail


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-03 03:54 UTC] elmicha@php.net
Can you please try the hint given in http://groups.google.de/groups?q=%22undefined+symbol%22+__cmpdi2&hl=de&lr=&ie=UTF-8&scoring=d&selm=20030520135824.GM14999%40dansat.data-plan.com&rnum=4,
 i.e. append "`gcc -print-libgcc-file-name`" (including the backquotes!) to the SYSLIBS entry in $ORACLE_HOME/bin/genclntsh?
 [2003-10-13 03:03 UTC] sniper@php.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.


 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Aug 15 01:05:44 2022 UTC