|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-09-05 10:26 UTC] matteo dot redaelli at pirelli dot com
Cannot start apache 1.3.20 & php 4.0.6 with --with-oci8 enabled: bonnie.root./apps/WEB/sw $ /www/bin/apachectl start /usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libcl.2 /usr/lib/dld.sl: Exec format error Syntax error on line 205 of /apps/WEB/apache/conf/httpd.conf: Cannot load /apps/WEB/apache/libexec/libphp4.sl into server: Exec format error my configure options are: CC=/opt/gcc/bin/gcc ./configure --prefix=/apps/WEB/php --with-iconv=/opt/libicon v --with-apxs=/apps/WEB/apache/bin/apxs --with-gd=shared --with-gd=/opt/gd --wit h-zlib-dir=/opt/zlib --with-ttf=/opt/freetype --without-mysql --with-xpm-dir=/op t/xpm --with-png-dir=/opt/libpng --with-gettext=/opt/gettext --with-jpeg-dir=/ opt/jpeg-6 --enable-gd-native-ttf --with-oci8=/oracle/PIRELLI/app/oracle/produc t/8.0.5 --enable-sigchild ------------------------- without oci8, GD libs are compiled successfully.... Matteo PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
I don't know if it can be considered as a bug. fred is right when it says that it must be compiled with -lcl. Here is the explanation from the HP ITRC site : The other restriction is that if a library containing TLS is listed as a dependancy of library that a program tries to shl_load it will fail to load unless the library with TLS has been linked against the program. The man page for shl_load(3) in the warnings section says: Use caution when building shared libraries with external library dependencies. Any library that contains Thread Local Storage (TLS) should not be used as a dependency. If a dependent library contains TLS, and it is not loaded during program startup (that is, not linked against the executable), the dynamic loader fails to perform the operation. The workaround to not being able to shl_load a shared library containing TLS can be seen in the following example: #include <stdio.h> #include <dl.h> #include <errno.h> main() { shl_load("/usr/lib/libcl.2", BIND_DEFERRED, NULL); printf("errno is %i\n", errno); } $ cc testing.c -o testing $ ./testing /usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libcl.2 /usr/lib/dld.sl: Exec format error errno is 8 $ cc testing.c -o testing -lcl $ ./testing errno is 0 The program does not produce an error when libcl.sl (-lcl) has been linked directly against the program. This method does not require any changes to the code only to the compilation flags (or makefile) as shl_load will ignore any request to load a library that is already loaded. <end of explanation> The problem shows off because the Oracle client library (libclntsh) has a reference to libcl.sl, which uses thread local storage. The best workaround is to compile the apache httpd binary and the PHP CLI executable with -lcl. The easiest way to do that is to set LDFLAGS='-lcl' before configuring apache and php. Another workaround, if you cannot relink your executables files, is to set an environment variable LD_PRELOAD=/usr/lib/libcl.sl before starting apache or PHP/CLI. It is less clean and should be reserved to the case where you cannot rebuild your packages. I am currently writing a step by step tutorial describing how to compile Apache, PHP, and many extensions on HP-UX, in order to create an alternative to the HP HPWS package. When it is ready, I post a comment on the PHP doc site in the 'HP-UX specific installation notes' section.