Title: Sybase-ct and Apache2

While building PHP 5.0.5 on a Sun (Solaris 8) box with the Sybase Client Library (12.0) support enabled, I am getting the following error when trying to start Apache2 with the PHP plugin configured:

# ./apachectl start
Syntax error on line 232 of /usr/local/apache2/conf/httpd.conf:
Cannot load /usr/local/apache2/modules/libphp5.so into server: ld.so.1: /usr/local/apache2/bin/httpd: fatal: relocation error: file /dpkg/sybase/OCS-12_0/lib/libtcl.so: symbol comn_free: referenced symbol not found


I have tried recompiling against the Sybase 12.5 client library, but got the same result.
My configure script to build PHP is as follows:

#!/usr/bin/sh

DSQUERY=fx_dbserver2_ds
SYBASE=/dpkg/sybase/sybase12_5
SYBASE_OCS=OCS-12_5
LD_LIBRARY_PATH=$SYBASE/$SYBASE_OCS/lib:/usr/local/lib:$LD_LIBRARY_PATH

PATH=$SYBASE/$SYBASE_OCS/bin:/usr/ccs/bin:/usr/local/bin:/usr/sbin:/usr/bin

CPPFLAGS="-I$SYBASE/$SYBASE_OCS/include:/usr/local/include:/usr/include:/usr/dt/include:/usr/openwin/include:/usr/local/include/libxml2/libxml:/usr/local/include/libxml2/libxslt:/usr/local/include/libpng:/usr/local/BerkeleyDB.4.2/include"

LDFLAGS="-L$SYBASE/$SYBASE_OCS/lib:/usr/ccs/lib:/usr/local/lib:/usr/lib:/usr/dt/lib:/usr/openwin/lib:/usr/local/BerkeleyDB.4.2/lib: -R$SYBASE/$SYBASE_OCS/lib:/usr/ccs/lib:/usr/local/lib:/usr/lib:/usr/dt/lib:/usr/openwin/lib:/usr/local/BerkeleyDB.4.2/lib"

export DSQUERY SYBASE SYBASE_OCS LD_LIBRARY_PATH PATH CPPFLAGS LDFLAGS

cd php-5.0.5


./configure \
  --prefix=/usr/local/php \
  --with-apxs2=/usr/local/apache2/bin/apxs \
  --with-sybase-ct=$SYBASE/$SYBASE_OCS \
  --without-bz2 \
  --enable-sysvmsg \
  --enable-sysvsem \
  --enable-sysvshm


(Note - the SYBASE and LD_LIBRARY_PATH declarations were used when I ran make from within this same script)
I thought the error was possibly related to the build picking up the wrong version of libtcl, so I added LDFLAGS and CPPFLAGS environment variables to point it in the right direction for the include and header files it needed. Thinking the problem might be related to the runtime search path, I also set the -R arguments in LDFLAGS.

The offending library in the error messages appears to only be included for the Sybase support. Here I demonstrate the linking details for PHP modules built without and with reference to the Sybase client library (I do note that libintl is being picked up from within the Sybase lib path):

# ldd libphp5.so.without_sybase
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libm.so.1 =>     /usr/lib/libm.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libz.so.1 =>     /usr/lib/libz.so.1
        libxml2.so.2 =>  /usr/local/lib/libxml2.so.2
        libiconv.so.2 =>         /usr/local/lib/libiconv.so.2
        libc.so.1 =>     /usr/lib/libc.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        libpthread.so.1 =>       /usr/lib/libpthread.so.1
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        /usr/platform/SUNW,Ultra-80/lib/libc_psr.so.1
        libthread.so.1 =>        /usr/lib/libthread.so.1


# ldd libphp5.so
        libtcl.so =>     /dpkg/sybase/sybase12_5/OCS-12_5/lib/libtcl.so
        libintl.so.1 =>  /usr/lib/libintl.so.1
        libcomn.so =>    /dpkg/sybase/sybase12_5/OCS-12_5/lib/libcomn.so
        libct.so =>      /dpkg/sybase/sybase12_5/OCS-12_5/lib/libct.so
        libcs.so =>      /dpkg/sybase/sybase12_5/OCS-12_5/lib/libcs.so
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libm.so.1 =>     /usr/lib/libm.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libz.so.1 =>     /usr/lib/libz.so.1
        libxml2.so.2 =>  /usr/local/lib/libxml2.so.2
        libiconv.so.2 =>         /usr/local/lib/libiconv.so.2
        libc.so.1 =>     /usr/lib/libc.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        libpthread.so.1 =>       /usr/lib/libpthread.so.1
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        /usr/platform/SUNW,Ultra-80/lib/libc_psr.so.1
        libthread.so.1 =>        /usr/lib/libthread.so.1


I would appreciate any light that might be shed on whats going on here. Extensive googling hasn't turned up much useful information so I'm concluding that either I'm doing something stupid here, or Sybase support in PHP is rarely used ...


Sean Healey
Solstice Technology Ltd



This e-mail message is private and confidential and for use by the intended recipient only. If the message is received by anyone other than the intended recipient, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mail messages are not necessarily secure. BayernLB does not accept responsibility for any changes made to this message after it was sent or any liability arising from unauthorised access or use of the information contained in this message. The contents of any e-mail sent by us are subject to our usual terms of business, anything which does not relate to the official business of the Bank, is neither given nor endorsed by it. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of the message and any attachments will not adversely affect its systems or data. BayernLB accepts no responsibility in this regard and the recipient should carry out such virus and other checks, as it considers appropriate.

Reply via email to