php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19219 Cannot build with-informix for Apache DSO
Submitted: 2002-09-03 17:56 UTC Modified: 2004-03-10 03:18 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: jerrysmith at directvinternet dot com Assigned:
Status: Closed Package: Informix related
PHP Version: 4.2.2 OS: HPUX 11.0
Private report: No CVE-ID: None
 [2002-09-03 17:56 UTC] jerrysmith at directvinternet dot com
CONFIGURATION
=============
Running the HP Depot Version of Apache 1.3.26 that we pre-built for HPUX11 to work with DSO.
----------------------------------
[hpserv02] ./httpd -v
Server version: Apache/1.3.26 (Unix)
Server built:   Jun 24 2002 20:07:33
[hpserv02] ./httpd -l
Compiled-in modules:
  http_core.c
  mod_so.c
suexec: disabled; invalid wrapper /usr/local/apache/bin/suexec
[hpserv02] 
-----------------------------------
BUG DESCRIPTION
===============

The HPUX os shared libraries are built with the .sl suffix.  I found a post on google where the fix is to simply rename the file libphp4.sl to libphp4.so.

I created a script for various types of builds to automatically fix this and help identify the informix problem.

Note: I can build the basic php4.2.2 by configuring with and or without mysql and it executes fine..ie.. I can run the test url <?phpinfo()?>.  The informix build completes but the apache will not start.

STEPS TO RECREATE PROBLEM
==========================

The script I am using to correct the shared library problem is as follows: (note the different configurations I have built)

# Setup Environment..

export INFORMIXDIR=/usr/informix
export PATH=$PATH:$INFORMIXDIR/bin
export DBPATH=/usr/informix
export INFORMIXSERVER=sedb
export LD_LIBRARY_PATH=/usr/lib:/opt/langtools/lib:/usr/informix/lib/esqlc:/usr/informix/lib/incl/esqlc


# added these variables from a post I found on Google that reportedly worked for static build..

export "IFX_LIBS=""-L$INFORMIXDIR/lib -L$INFORMIXDIR/lib/esql"""
export "IFX_INCDIR=""-L$INFORMIXDIR/incl/esql"""
export "IFX_LIBDIR=""-L$INFORMIXDIR/lib -L$INFORMIXDIR/lib/esql"""

# stop WebServer
apachectl stop

./configure --with-apxs=/usr/informix/apache/bin/apxs --with-mysql=no  --with-informix=yes

#./configure --with-apxs=/usr/informix/apache/bin/apxs --with-mysql=yes

#./configure --with-apxs=/usr/informix/apache/bin/apxs --with-mysql=no

make
make install

# since HPUX shared libraries have the .sl suffix we have to rename thelibphp4
#
mv libs/libphp4.sl libs/libphp4.so
cp libs/libphp4.so /usr/informix/apache/lib/modules

# re-execute the failed command..
apxs -S LIBEXECDIR="/usr/informix/apache/lib/modules" -i -a -n php4 libs/libphp4.so

# start WebServer
apachectl start
####################END OF SCRIPT###########################


NOTE:  As stated before, if I build a php without the informix module, all works as it should.

If I build the informix configuration, the build completed, but with the following warnings:

.....previous lines omitted...
Making all in .
        /bin/sh /usr/local/src/php-4.2.2/libtool --silent --mode=link cc  -I. -I/usr/local/src/php-4.2.2/ -I/usr/local/src/php-4.2.2/main -I/usr/local/src/php-4.2.2 -I/usr/local/apache/include -I/usr/local/src/php-4.2.2/Zend -I/usr/informix/incl/esql -I/usr/local/src/php-4.2.2/ext/xml/expat  -DHPUX11 -DUSE_HSREGEX -DUSE_EXPAT -I/usr/local/src/php-4.2.2/TSRM -g -prefer-pic   -o libphp4.la -rpath /usr/local/src/php-4.2.2/libs -avoid-version -L/usr/informix/lib -L/usr/informix/lib/esql  -R /usr/informix/lib -R /usr/informix/lib/esql stub.lo  Zend/libZend.la  sapi/apache/libsapi.la  main/libmain.la  regex/libregex.la  /usr/local/src/php-4.2.2/ext/ctype/libctype.la /usr/local/src/php-4.2.2/ext/informix/libinformix.la /usr/local/src/php-4.2.2/ext/pcre/libpcre.la /usr/local/src/php-4.2.2/ext/posix/libposix.la /usr/local/src/php-4.2.2/ext/session/libsession.la /usr/local/src/php-4.2.2/ext/standard/libstandard.la /usr/local/src/php-4.2.2/ext/xml/libxml.la  TSRM/libtsrm.la -lpam -L/usr/informix/lib/esql -lixos -L/usr/informix/lib/esql -lixgen -L/usr/informix/lib/esql -lixsql -L/usr/informix/lib -lixasf -L/usr/informix/lib/esql -lixos -L/usr/informix/lib/esql -lixgen -L/usr/informix/lib/esql -lixgls -lnsl_s -lV3 -lcl -lsec -L/usr/informix/lib/esql -lixglx -lcrypt -lm -lnsl -lcrypt 

*** Warning: This library needs some functionality provided by -lV3.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: This library needs some functionality provided by -lcrypt.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: This library needs some functionality provided by -lcrypt.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.

Making install in .
        /usr/local/src/php-4.2.2/build/shtool mkdir -p "/usr/local/apache/lib/modules" && /usr/informix/apache/bin/apxs -S LIBEXECDIR="/usr/local/apache/lib/modules" -i -a -n php4 libs/libphp4.sl
apxs:Error: file libs/libphp4.sl is not a DSO
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.

##########################################################

ERROR ENCOUNTERED
=================

at this point my script fixes the above error and attempts to start the apache server...

###########LINES FROM SCRIPT###############
# since HPUX shared libraries have the .sl suffix we have to rename thelibphp4
#
mv libs/libphp4.sl libs/libphp4.so
cp libs/libphp4.so /usr/informix/apache/lib/modules

# re-execute the failed command..
apxs -S LIBEXECDIR="/usr/informix/apache/lib/modules" -i -a -n php4 libs/libphp4.so

# start WebServer
apachectl start

###############################################

[activating module `php4' in /usr/local/apache/etc/httpd.conf]
cp libs/libphp4.so /usr/informix/apache/lib/modules/libphp4.so
chmod 755 /usr/informix/apache/lib/modules/libphp4.so
cp /usr/local/apache/etc/httpd.conf /usr/local/apache/etc/httpd.conf.bak
cp /usr/local/apache/etc/httpd.conf.new /usr/local/apache/etc/httpd.conf
rm /usr/local/apache/etc/httpd.conf.new
/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 236 of /usr/local/apache/etc/httpd.conf:
Cannot load /usr/local/apache/lib/modules/libphp4.so into server: Exec format error
/usr/informix/apache/bin/apachectl start: httpd could not be started
===============END PROBLEM DEFINITION====================

Notes:  

I have done some research and believe that the library in question (libcl.2 not a shared library) could be replaced with a shared one in the make file, but I don't know what library to replace it with?

I have completely wiped the file structure containing the php-4.2.2 directory and re-run the entire process with no change in the results.
 
Please help!

Thanks,  

Jerry

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-03 18:02 UTC] sniper@php.net
Try compiling PHP as static module for Apache instead.
(this really is not PHP bug but libtool one..)

 [2002-09-03 18:09 UTC] jerrysmith at directvinternet dot com
I cannot recompile the Apache.  HP has a strange way of doing things.  I attempted to build an Apache webserver but gave up.  This version I am running is a pre-built binary in the hp DEPOT format obtained from an HP user group.
 [2002-09-03 18:13 UTC] sniper@php.net
Well..you can always try this snapshot then:

http://snaps.php.net/php4-latest.tar.gz

Compiled as shared module..

 [2002-09-04 10:41 UTC] jerrysmith at directvinternet dot com
I downloade the suggested latest tar file.  Actually, this provides worse results:

/bin/sh libtool --silent --mode=link
cc -export-dynamic -g  -avoid-version -module -L/usr/informix/lib -L/usr/inf
ormix/lib/esql  -R /usr/informix/lib -R /usr/informix/lib/esql
ext/ctype/ctype.lo ext/informix/ifx.lo ext/mbstring/mbfilter_ja.lo
ext/mbstring/mbfilter_cn.lo ext/mbstring/mbfilter_tw.lo
ext/mbstring/mbfilter_kr.lo ext/mbstring/mbfilter_ru.lo
ext/mbstring/mbfilter.lo ext/mbstring/mbstring.lo ext/mbstring/mbregex.lo
ext/mbstring/php_mbregex.lo ext/mbstring/html_entities.lo
ext/overload/overload.lo ext/pcre/pcrelib/maketables.lo
ext/pcre/pcrelib/get.lo ext/pcre/pcrelib/study.lo ext/pcre/pcrelib/pcre.lo
ext/pcre/php_pcre.lo ext/posix/posix.lo ext/session/session.lo
ext/session/mod_files.lo ext/session/mod_mm.lo ext/session/mod_user.lo
ext/standard/array.lo ext/standard/base64.lo ext/standard/basic_functions.lo
ext/standard/browscap.lo ext/standard/crc32.lo ext/standard/crypt.lo
ext/standard/cyr_convert.lo ext/standard/datetime.lo ext/standard/dir.lo
ext/standard/dl.lo ext/standard/dns.lo ext/standard/exec.lo
ext/standard/file.lo ext/standard/filestat.lo ext/standard/flock_compat.lo
ext/standard/formatted_print.lo ext/standard/fsock.lo ext/standard/head.lo
ext/standard/html.lo ext/standard/image.lo ext/standard/info.lo
ext/standard/iptc.lo ext/standard/lcg.lo ext/standard/link.lo
ext/standard/mail.lo ext/standard/math.lo ext/standard/md5.lo
ext/standard/metaphone.lo ext/standard/microtime.lo ext/standard/pack.lo
ext/standard/pageinfo.lo ext/standard/parsedate.lo
ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/reg.lo
ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo
ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo
ext/standard/url.lo ext/standard/url_scanner.lo ext/standard/var.lo
ext/standard/versioning.lo ext/standard/assert.lo ext/standard/strnatcmp.lo
ext/standard/levenshtein.lo ext/standard/incomplete_class.lo
ext/standard/url_scanner_ex.lo ext/standard/ftp_fopen_wrapper.lo
ext/standard/http_fopen_wrapper.lo ext/standard/php_fopen_wrapper.lo
ext/standard/credits.lo ext/standard/var_unserializer.lo
ext/standard/ftok.lo ext/standard/aggregation.lo ext/standard/sha1.lo
ext/tokenizer/tokenizer.lo ext/xml/xml.lo ext/xml/expat/xmlparse.lo
ext/xml/expat/xmlrole.lo ext/xml/expat/xmltok.lo regex/regcomp.lo
regex/regexec.lo regex/regerror.lo regex/regfree.lo TSRM/TSRM.lo
TSRM/tsrm_strtok_r.lo TSRM/tsrm_virtual_cwd.lo main/main.lo main/snprintf.lo
main/spprintf.lo main/php_sprintf.lo main/safe_mode.lo
main/fopen_wrappers.lo main/alloca.lo main/php_ini.lo main/SAPI.lo
main/rfc1867.lo main/php_content_types.lo main/strlcpy.lo main/strlcat.lo
main/mergesort.lo main/reentrancy.lo main/php_variables.lo main/php_ticks.lo
main/streams.lo main/network.lo main/php_open_temporary_file.lo
main/php_logos.lo main/output.lo main/memory_streams.lo main/user_streams.lo
Zend/zend_language_parser.lo Zend/zend_language_scanner.lo
Zend/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zend_alloc.lo
Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo
Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo
Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo
Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo
Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo
Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo
Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo
Zend/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/getopt.lo
main/internal_functions_cli.lo -L/usr/informix/lib/esql -lixos -L/usr/inform
ix/lib/esql -lixgen -L/usr/informix/lib/esql -lixsql -L/usr/informix/lib -li
xasf -L/usr/informix/lib/esql -lixos -L/usr/informix/lib/esql -lixgen -L/usr
/informix/lib/esql -lixgls -lnsl_s -lV3 -lcl -lsec -L/usr/informix/lib/esql 
-lixglx -lcrypt -lm -lnsl -lcrypt  -o sapi/cli/php
Installing PHP SAPI module
apxs:Error: file libs/libphp4.sl is not a DSO
*** Error exit code 1

Stop.
 [2002-09-04 12:27 UTC] sniper@php.net
First of all: STOP pasting those huge parts of text!!
It's enough to paste the ERRORS only..

Anyway, iirc, it should work the same you did before, ie. copy the libphp4.sl to .so 

 [2002-09-04 13:08 UTC] jerrysmith at directvinternet dot com
It did not build a libphp4.sl, but a libphp4.lc  whatever that is.  I tried copying it and still got the exec error.

Since I can successfully build and run a PHP moduled for the Apache WITHOUT the Informix, I believe that the portion of the makefile simply needs to be modified to use the correct "shared" version of the libraries needed.

Thanks for your help
Jerry
 [2002-09-04 13:22 UTC] sniper@php.net
Did the snapshot work (ie. compile correct file) without informix then?

 [2002-09-04 17:37 UTC] jerrysmith at directvinternet dot com
No such luck.  The standard build with:
./configure --with-apxs=/usr/informix/apache/bin/apxs --with-mysql=no

Resulted in....
.
.
*** Warning: This library needs some functionality provided by -lcrypt....*** I have the capability to make that.....


*** Warning: libtool could not satisfy all declared inter-library*** dependencies of module libphp4.  Therefore, libtool will create *** a static module, that should work as long as the dlopening *** application is linked with the -dlopen flag.

Installing PHP SAPI module
apxs:Error: file libs/libphp4.sl is not a DSO
*** Error exit code 1

Stop.
===============================================
the libs directory contained two libraries...

libphp4.a   libphp4.la

I copied them to the apache modules dir and updated
the httpd.conf to include them....when starting get the
error:
[hpserv02] ./apachectl start
/usr/lib/dld.sl: Bad magic number for shared library: /usr/local/apache/lib/modules/libphp4.la
/usr/lib/dld.sl: Exec format error
Syntax error on line 236 of /usr/local/apache/etc/httpd.conf:
Cannot load /usr/local/apache/lib/modules/libphp4.la into server: Exec format error
./apachectl start: httpd could not be started

---------

Since I cannot rebuild the Apache, I must have an Informix make file that includes the proper shared library.  This seems to me to be the simplest solution..(and use the 4.2.2 source for the build)  What do you think?

Thanks
Jerry
 [2002-09-04 19:40 UTC] sniper@php.net
I think libtool sucks. And I'm out of ideas.

 [2002-09-09 19:50 UTC] jerrysmith at directvinternet dot com
ANYONE ELSE UP TO THE CHALLENGE???

...here is the contents of the ext dir of PHP for Informix

[hpserv02] ls
.deps           Makefile        ifx.c           ifx.lo          libs.mk         stub.c
.libs           Makefile.in     ifx.dsp         libinformix.la  php_informix.h
CREDITS         config.m4       ifx.ec          libphpifx.a     setup.stub
..the .lib DIR contains..
[hpserv02] ls -al .libs
-rw-rw-rw-   1 root       sys         321104 Sep  9 19:55 libinformix.al
lrwxrwxrwx   1 root       sys             17 Sep  9 19:55 libinformix.la -> ../libinformix.la

ALSO..

[hpserv02] 
[hpserv02] ls /usr/informix/lib
esql           iasft07b.sl    libixasf.a     libtasf.a      netstub.a      sqlexecd
iasfs07a.sl    libasf.a       libixasf.sl    libtasf.sl     sqlexec        sqlexecd.old
iasfs07b.sl    libasf.sl      libnetstub.sl  netlib.a       sqlexec.old    sqlrm
[hpserv02] 
[hpserv02] ls /usr/informix/lib/esql
checkapi.o    igl4a303.sl   isqlt07a.sl   libgls.a      libixgen.sl   libixos.a     libos.sl      libtos.a
esqlc         iglxa303.sl   isxas07a.sl   libglx.a      libixgls.a    libixos.sl    libsql.a      libtos.sl
esqlmf        iosls07a.sl   ixacursor.o   libinfxxa.a   libixgls.sl   libixsql.a    libsql.sl     libtsql.a
igens07a.sl   ioslt07a.sl   libgen.a      libinfxxa.sl  libixglx.a    libixsql.sl   libtgen.a     libtsql.sl
igent07a.sl   isqls07a.sl   libgen.sl     libixgen.a    libixglx.sl   libos.a       libtgen.sl
[hpserv02]
 [2002-09-26 23:43 UTC] jerrysmith at directvinternet dot com
HELP!  I'm dying here.  If I don't get this running I may loose a consulting contract!  Whats the process to get a developer to take a look here?
 [2002-09-28 00:18 UTC] jerrysmith at directvinternet dot com
FWIW...There are tons on references on comp.sys.hpux regarding "thread local storage". The all basically state that one must statically include the libcl.2 in the a.out.  I must assume here that in our case here, a.out is lib4php.sl.  However, I know very little about Make and makefiles.  I dont have a clue as to what to edit to make this happen.
 [2002-11-06 03:23 UTC] cvb at clausvb dot de
I am not sure if I can offer help, but since I installed INFORMIX IDS on a HPUX once and I have a running PHP-INFORMIX enviroment on a standard INTEL server (Primergy I think).

You say:
"NOTE:  As stated before, if I build a php without the informix module, all works as it should.

If I build the informix configuration, the build completed, but with the following warnings:"

To get this straight:

"lib/esql -lixgls -lnsl_s -lV3 -lcl -lsec"

-lixgls
has something to do with "Global Language Support" something I only encountered with INFORMIX (perhaps I am wrong), in this case a GLS parameter (-lixgls) for ESQL

Doesn't it make sense that "-lV3" is something within ESQL, too?

So this problem could exist in your IfxCSDK. 

Which version do you use?

I suppose it was released for HPUX 11.0?

Best regards,
Claus
 [2002-11-06 03:31 UTC] cvb at clausvb dot de
@sniper
"this really is not PHP bug but libtool one."

I don't know if it's a libtool bug or a bug within the IfxCSDK, but imho it's defenitly no bug within PHP, so I would close this bug.

It could be an user error, too, because installing PHP with Ifx is tricky. We had to install two different IfxCSDK, to get it work.

Regards,
Claus
 [2002-11-06 09:22 UTC] jerrysmith at directvinternet dot com
IMHO this problem is related to the make file that is included with the PHP that builds the module.  This make file is including (erroneously) a static library.  Yes if I run the build WITHOUT informix the PHP module works and the Apache can render the test page.  I have been using the esql on HPUX for a few years now to write esql-C dynamically generated webpages..see www.cosworthvega.com
 [2003-02-20 07:45 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip


This should be fixed now, at least that crypt issue is.

 [2003-02-25 02: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.


 [2004-03-09 20:07 UTC] jerrysmith at directvinternet dot com
After waiting a year, I recently obtained yet again the 'latest' version only to experience the same issue.  Seems no one knows how to fix LIBTOOL.

I give up. I will stay with compiled C-langage CGI
 [2004-03-10 03:18 UTC] derick@php.net
Considered "closed" then.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 23:01:31 2024 UTC