1753464 Members
4921 Online
108794 Solutions
New Discussion юеВ

Re: PHP5.0.4 on Itanium

 
Michael Simone
Frequent Advisor

PHP5.0.4 on Itanium

I'm struggling with compiling PHP 5.0.4 on an Itanium system running HPUX 11.23 with Apache 2.0.53. I've done this install on two other PA-RISC servers (11.11) and it works, but when I build the libphp5.so module on this Itanium box, Apache argues "Unresolved external" trying to load it. ldd -r reveals a bunch of "symbol not found" messages (I can post if anyone can make sense of it). I've tried the build with both GCC and Hp's CC, and neither ends up producing a usable module.

Has anyone done this build successfully, or am I chasing a ghost? I've been all over the forums and Google, and can't find any definitive answers. I'm only trying PHP5 because a security assessment told us that PHP 4.3.9 has security holes that can only be plugged with 5.0.3 or higher.

Thanks for any help.
7 REPLIES 7
Ermin Borovac
Honored Contributor

Re: PHP5.0.4 on Itanium

What symbols is it complaining about? Can you please post your ./configure lines for apache and php build?
Michael Simone
Frequent Advisor

Re: PHP5.0.4 on Itanium

Apache configure:
export CFLAGS="-mlp64"
./configure --with-z=/web/zlib-1.1.4 --prefix=/usr/local/apache --enable-so --enable-cgi --enable-info --enable-rewrite --enable-speling --enable-usertracke --enable-ssl --enable-mime-magic

PHP configure:
./configure --prefix=/usr/local/apache/php --with-apxs2=/usr/local/apache/bin/apxs --disable-libxml --enable-sockets

Check of libphp5.so:
MrT.root# ldd -r
libm.so.1 => /usr/lib/hpux64/libm.so.1
libnsl.so.1 => /usr/lib/hpux64/libnsl.so.1
libc.so.1 => /usr/lib/hpux64/libc.so.1
libxti.so.1 => /usr/lib/hpux64/libxti.so.1
libdl.so.1 => /usr/lib/hpux64/libdl.so.1
symbol not found: ap_get_server_version (/usr/local/apache/modules/libph
p5.so)
symbol not found: _U_Qfgt (/usr/local/apache/modules/libphp5.so)
symbol not found: _U_Qfge (/usr/local/apache/modules/libphp5.so)
symbol not found: _U_Qflt (/usr/local/apache/modules/libphp5.so)
symbol not found: ap_add_version_component (/usr/local/apache/modul
es/libphp5.so)
symbol not found: ap_set_last_modified (/usr/local/apache/modules/libph
p5.so)
symbol not found: apr_brigade_cleanup (/usr/local/apache/modules/libph
p5.so)
symbol not found: __udivdi3 (/usr/local/apache/modules/libphp5.so)
symbol not found: apr_bucket_eos_create (/usr/local/apache/modules/libph
p5.so)
symbol not found: __divdi3 (/usr/local/apache/modules/libphp5.so)
symbol not found: __divdf3 (/usr/local/apache/modules/libphp5.so)
symbol not found: __divsi3 (/usr/local/apache/modules/libphp5.so)
symbol not found: ap_auth_type (/usr/local/apache/modules/libphp5.so)
symbol not found: unixd_config (/usr/local/apache/modules/libphp5.so)
symbol not found: ap_rflush (/usr/local/apache/modules/libphp5.so)
symbol not found: ap_destroy_sub_req (/usr/local/apache/modules/libph
p5.so)
symbol not found: ap_loaded_modules (/usr/local/apache/modules/libph
p5.so)
symbol not found: apr_pool_cleanup_null (/usr/local/apache/modules/libph
p5.so)
symbol not found: __moddi3 (/usr/local/apache/modules/libphp5.so)
symbol not found: __modsi3 (/usr/local/apache/modules/libphp5.so)
symbol not found: ap_add_cgi_vars (/usr/local/apache/modules/libph
p5.so)
symbol not found: __umoddi3 (/usr/local/apache/modules/libphp5.so)
symbol not found: apr_pool_userdata_get (/usr/local/apache/modules/libph
p5.so)
symbol not found: apr_pool_userdata_set (/usr/local/apache/modules/libph
p5.so)
symbol not found: ap_get_brigade (/usr/local/apache/modules/libph
p5.so)
symbol not found: apr_table_unset (/usr/local/apache/modules/libph
p5.so)
symbol not found: apr_brigade_create (/usr/local/apache/modules/libph
p5.so)
symbol not found: ap_hook_pre_config (/usr/local/apache/modules/libph
p5.so)
symbol not found: ap_update_mtime (/usr/local/apache/modules/libph
p5.so)
symbol not found: ap_set_content_type (/usr/local/apache/modules/libph
p5.so)
symbol not found: apr_palloc (/usr/local/apache/modules/libphp5.so)
symbol not found: ap_log_rerror (/usr/local/apache/modules/libphp5.so)
symbol not found: apr_pool_cleanup_register (/usr/local/apache/modul
es/libphp5.so)
symbol not found: ap_hook_post_config (/usr/local/apache/modules/libph
p5.so)
symbol not found: ap_mpm_query (/usr/local/apache/modules/libphp5.so)
symbol not found: ap_add_common_vars (/usr/local/apache/modules/libph
p5.so)
symbol not found: ap_rwrite (/usr/local/apache/modules/libphp5.so)
symbol not found: apr_table_set (/usr/local/apache/modules/libphp5.so)
symbol not found: ap_server_root_relative (/usr/local/apache/modul
es/libphp5.so)
symbol not found: ap_hook_handler (/usr/local/apache/modules/libph
p5.so)
symbol not found: ap_log_error (/usr/local/apache/modules/libphp5.so)
symbol not found: apr_table_elts (/usr/local/apache/modules/libph
p5.so)
symbol not found: ap_pass_brigade (/usr/local/apache/modules/libph
p5.so)
symbol not found: apr_table_get (/usr/local/apache/modules/libphp5.so)
symbol not found: apr_table_add (/usr/local/apache/modules/libphp5.so)
symbol not found: apr_brigade_flatten (/usr/local/apache/modules/libph
p5.so)
symbol not found: ap_server_root (/usr/local/apache/modules/libph
p5.so)
symbol not found: ap_sub_req_lookup_uri (/usr/local/apache/modules/libph
p5.so)
symbol not found: ap_run_sub_req (/usr/local/apache/modules/libph
p5.so)
symbol not found: apr_pstrdup (/usr/local/apache/modules/libphp5.so)
symbol not found: main (/usr/lib/hpux64/libc.so.1)
MrT.root#
Ermin Borovac
Honored Contributor

Re: PHP5.0.4 on Itanium

All of these symbols should be found in either httpd binary or apache libraries in /lib. Some of them are apache symbols (ap*) and other are found in gcc library (__udivdi3 etc).

For each symbol not found in libphp5.so, check httpd to see if it's there.

# ldd -y,ap_add_version_component httpd
libaprutil-0.sl.9 => /opt/local/httpd-2.0.53/lib/libaprutil-0.sl.9
libexpat.sl.1 => /opt/local/httpd-2.0.53/lib/libexpat.sl.1
libapr-0.sl.9 => /opt/local/httpd-2.0.53/lib/libapr-0.sl.9
libm.2 => /lib/pa20_64/libm.2
libnsl.1 => /lib/pa20_64/libnsl.1
libpthread.1 => /lib/pa20_64/libpthread.1
libdl.1 => /lib/pa20_64/libdl.1
libc.2 => /lib/pa20_64/libc.2
libxti.2 => /usr/lib/pa20_64/libxti.2
libdl.1 => /usr/lib/pa20_64/libdl.1
ap_add_version_component (code) : needed by httpd; found in httpd

Symbols that cannot be found in httpd (or its libraries) are the ones you should be worried about.
Michael Simone
Frequent Advisor

Re: PHP5.0.4 on Itanium

I started doing those checks for symbols in httpd, and the ap* ones all seem to show up, but some of the others (ie. _U_Qfgt, etc) don't display "found in httpd", but also don't display an error of any kind, they just list the linked libraries and that's it. So does that mean they're not found?

Beyond that, I'm not sure what this tells me. If those symbols are found in httpd, do I have to somehow reference that when building libphp5.so, or do I have to link something differently or what? Sorry to not follow, but I'm somewhat lost when it gets beyond the basic configure-make-make install methods.

Thanks again for the help.
Ermin Borovac
Honored Contributor

Re: PHP5.0.4 on Itanium

httpd loads php module (libphp5.so), so any unresolved symbols from libphp5.so must be found in httpd.

Symbols like __divdi3 and _U_Qfgt should be found in gcc library (libgcc.a or libgcc.sl). You can check this with nm (example is from PA-RISC system but should be similar for Itanium).

$ nm /usr/local/pa64/lib/gcc/hppa64-hp-hpux11.23/4.0.0/libgcc.a | grep _U_Qfg
[20] | 360| 176|FUNC |GLOB |0| .text|_U_Qfgt

Maybe you can try adding -lgcc to php link line? Make sure you specify directory where gcc library resides with -L option.
Michael Simone
Frequent Advisor

Re: PHP5.0.4 on Itanium

I confirmed what you said about the symbols in libgcc. Mine is in /usr/local/lib/gcc-lib/ia64-hp-hpux11.23/3.3.3/hpux64/libgcc.a, so I added that directory to my LD_LIBRARY and SHLIB_PATH environment variables, and added --with-libgcc to my configure line, but the resulting libphp5.so still shows those symbols as missing. Plus, I still don't understand how to resolve the Apache symbols--I understand what you're saying about those symbols needing to be present in Apache if they're not in libphp5, but how do I make that connection when I build the libphp5?
Ermin Borovac
Honored Contributor

Re: PHP5.0.4 on Itanium

Are you sure that configure option is --with-libgcc and not --enable-libgcc?

--enable-libgcc Enable explicitly linking against libgcc

So your goal is to link missing gcc symbols into libphp5.so. Apache symbols are in httpd binary so libphp5.so will pick them up from there.

If you still have problems please attach full configure and make logs.