Unable to load shared library gettext in php (562 Views)
Reply
Advisor
Harichand M V
Posts: 26
Registered: ‎03-27-2008
Message 1 of 12 (562 Views)

Unable to load shared library gettext in php

[ Edited ]

I am using a HP-UX with apache version 2.0.58
and with php 5.2

I compiled and installed the gettext extension

On apache startup I get the warning
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/hpws/apache/php/
lib/php/extensions/gettext.sl' - '/opt/hpws/apache/php/lib/php/extensions/gettex
t.sl' is not a valid load module: Bad magic number in Unknown on line 0

Please help

 

 

P.S. This thread has been moved from HP-UX > General to HP-UX > languages - HP Forumas Moderator

Please use plain text.
Exalted Contributor
Steven E. Protter
Posts: 33,806
Registered: ‎08-15-2002
Message 2 of 12 (562 Views)

Re: Unable to load shared library gettext in php

Shalom,

Check that the files it is complaining about actually exist and have the correct file time.

file filename.

If possible compare size and type to a system that is working.

The complaint seems to be either the library is inaccessible or invalid, I lean toward invalde based on the meaningful, magical error message.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Please use plain text.
Advisor
Harichand M V
Posts: 26
Registered: ‎03-27-2008
Message 3 of 12 (562 Views)

Re: Unable to load shared library gettext in php

I have checked with the existence of the file gettext.sl
and the php.ini file.
I actually created the gettext.sl by following commands in the php-5.2.5/ext/gettext directory.

I first copied config.sub,config.guess and ltmain.sh from /usr/local/share/libtool/config directory to gettext source directory.

# phpize
# ./configure --enable-gettext --with-php-config=/opt/hpws/apache/php/bin/php-config
# make
# make install
# cd /opt/hpws/apache/php/lib/php/extensions
# mv no-debug-zts-20060613/gettext.so gettext.sl
# apachectl restart

When I checked the error log of apache I got the above mensioned magic number error message
Please use plain text.
Advisor
Harichand M V
Posts: 26
Registered: ‎03-27-2008
Message 4 of 12 (562 Views)

Re: Unable to load shared library gettext in php

I checked shared libraries with following commands

# file libphp5.so
ELF-64 IA-64
# file gettext.sl
ELF-32 IA-64

I think the mixing up of 32bit and 64bit libraries the root cause of problem.

Can any body help with how i can build 64 bit
libraries?

Thanks in advance.
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,744
Registered: ‎03-06-2006
Message 5 of 12 (562 Views)

Re: Unable to load shared library gettext in php

>I have checked with the existence of the file gettext.sl

That's useless. You also need to check what type of file it is. Use a linker tool:
$ chatr gettext.sl

You could have PA vs IPF conflicts. Or +DD32 vs +DD64. And it must be a shared lib.

>SEP: I lean toward invalid based on the meaningful, magical error message.

Exactly.


Please use plain text.
Advisor
Harichand M V
Posts: 26
Registered: ‎03-27-2008
Message 6 of 12 (562 Views)

Re: Unable to load shared library gettext in php

I got the following respone

# chatr gettext.sl

32-bit ELF shared library
shared library dynamic path search:
LD_LIBRARY_PATH enabled first
SHLIB_PATH enabled second
embedded path enabled third /usr/local/lib
internal name:
gettext.so
shared library list:
libintl.sl.1
libc.so.1
shared library mapped private disabled
shared vtable support disabled
explicit unloading enabled
linkage table protection disabled
segments:
index type address flags size
7 text 04000000 z---c- D (default)
8 data 40010000 ---m-- D (default)
kernel assisted branch prediction enabled
lazy swap allocation for dynamic segments disabled
nulptr dereferences trap disabled
address space model: default
caliper dynamic instrumentation disabled


and for libphp5.so

#chatr libphp5.so
/opt/hpws/apache/modules/libphp5.so:
64-bit ELF shared library
shared library dynamic path search:
LD_LIBRARY_PATH enabled first
SHLIB_PATH enabled second
embedded path enabled third /lib
internal name:
libphp5.so
shared library list:
libm.so.1
libnsl.so.1
libc.so.1
shared library mapped private disabled
shared vtable support disabled
explicit unloading enabled
linkage table protection disabled
segments:
index type address flags size
6 text 4000000000000000 z---c- D (default)
7 data 6000000000000000 ---m-- D (default)
kernel assisted branch prediction enabled
lazy swap allocation for dynamic segments disabled
nulptr dereferences trap disabled
address space model: default
caliper dynamic instrumentation disabled


Can libphp5.so load the shared library gettext.sl??
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,744
Registered: ‎03-06-2006
Message 7 of 12 (562 Views)

Re: Unable to load shared library gettext in php

# chatr gettext.sl
32-bit ELF shared library
#chatr libphp5.so
64-bit ELF shared library

>Can libphp5.so load the shared library gettext.sl??

No. An application can either be 32 bit or 64 bit.

>I compiled and installed the gettext extension

You will have to port? and compile this to 64 bit.
Please use plain text.
Advisor
Harichand M V
Posts: 26
Registered: ‎03-27-2008
Message 8 of 12 (562 Views)

Re: Unable to load shared library gettext in php

How can I compile the gettext source to generate a 64 bit shared library.

ie what are the compiler and linker flags to do so

I tried
# ./configure CC='cc -m64' LD='ld -melfppc64'
# make
# make install

Still I am getting a 32 bit library..
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,744
Registered: ‎03-06-2006
Message 9 of 12 (562 Views)

Re: Unable to load shared library gettext in php

>what are the compiler and linker flags to do so
> ./configure CC='cc -m64' LD='ld -melfppc64'

If you are using a real compiler you just use +DD64. The gcc option is -mlp64.
The linker will automatically figure out the right thing. But you should be using cc instead: LD='cc +DD64'
Please use plain text.
Advisor
Harichand M V
Posts: 26
Registered: ‎03-27-2008
Message 10 of 12 (562 Views)

Re: Unable to load shared library gettext in php



Problem is that when i try to compile gettext php extension as 64 bit elf i get error that 64 bit gettext library not found.

So i think i should install gettext library as 64 bit.
How can this be done.

Thanks in advance.
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,744
Registered: ‎03-06-2006
Message 11 of 12 (562 Views)

Re: Unable to load shared library gettext in php

?So i think i should install gettext library as 64 bit. How can this be done?

Does it exist at the porting center? If not, you will have to build and port it yourself.
Please use plain text.
Advisor
Harichand M V
Posts: 26
Registered: ‎03-27-2008
Message 12 of 12 (562 Views)

Re: Unable to load shared library gettext in php

I have found that i have to compile it as a 64 bit library

Thanks to all
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation