SGI: Development

PHP 5.0.0 && gettext not working

I've been working on a new setup on my server and after some problems I thought I had it working (finally!)... however gettext doesn't seem to work in my PHP setup.

I compiled all stuff myself, new Apache 2.0.50 server, PHP 5.0.0 and gettext 0.14.1 when running the configure script for PHP everything goes fine. It even compiles without problems. But when I run a simple test script:
Code:
<?php
gettext ("TEST")
?>

I get a fatal error messages telling me: "Call to undefined function gettext()" :(

The problem is I have no idea what is going wrong. I'm positive that the "ext/gettext" gets compiled. Also that these functions are included checked the #ifdef, even removed quite a few of them so the code would allways compile but it just doesn't work :(

Anyone with tips on what I might be doing wrong, they are very much appreciated.
shrek wrote:
[..]
I get a fatal error messages telling me: "Call to undefined function gettext()" :(

The problem is I have no idea what is going wrong. I'm positive that the "ext/gettext" gets compiled. Also that these functions are included checked the #ifdef, even removed quite a few of them so the code would allways compile but it just doesn't work :(

Anyone with tips on what I might be doing wrong, they are very much appreciated.


Well... looks like that php configure havent detected your gettext installation and have build php without gettext support. Which php extension currently available in your build a phpinfo() can show you.

Its also possilbe to build the most extensions as a shared one. These 'foo.so' can be load in php.ini or during runtime by using dl('foo.so') in the script.

You can compile loadable extension with the main build or in later step!

[o2k]:/usr2/MIPS/php-5/ext/gettext
[o2k]:/usr2/MIPS/php-5/ext/gettext $ phpize
[o2k]:/usr2/MIPS/php-5/ext/gettext $ ./configure --with-gettext=/usr/local
[o2k]:/usr2/MIPS/php-5/ext/gettext $ gmake
[o2k]:/usr2/MIPS/php-5/ext/gettext $ gmake install
Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20040412/

ll /usr/local/php5/lib/php/extensions/no-debug-non-zts-20040412/gettext.so
-rwxr-xr-x 1 root sys 22536 Aug 13 15:16 /usr/local/php5/lib/php/extensions/no-debug-non-zts-20040412/gettext.so

To load this extension the 'extension_dir' config parameter in your php.ini must match to the right dir.


After that you have these functions avalaible
http://www.irixworld.net/php/overview.php?ext=gettext

At this point an eye goes to your
shrek wrote:
[..]
I get a fatal error messages telling me: "Call to undefined function gettext()" :(


all my gettext related function starts with 'libintl_*' which is completly wrong :| So please use get_extension_funcs('gettext') to see which functions are exists and drop a note for me.
joerg wrote:
Well... looks like that php configure havent detected your gettext installation and have build php without gettext support. Which php extension currently available in your build a phpinfo() can show you.

Well I did everything to make sure they were compiled, tried shared stuff all of it...

joerg wrote:
After that you have these functions avalaible
http://www.irixworld.net/php/overview.php?ext=gettext

At this point an eye goes to your
shrek wrote:
[..]
I get a fatal error messages telling me: "Call to undefined function gettext()" :(


all my gettext related function starts with 'libintl_*' which is completly wrong :| So please use get_extension_funcs('gettext') to see which functions are exists and drop a note for me.


My list:
Code:
25 sander@origin ~% /opt/apache2/php/bin/php
<?php
print_r (get_extension_funcs('gettext'));
?>^D
Array
(
[0] => libintl_textdomain
[1] => libintl_gettext
[2] => _
[3] => libintl_dgettext
[4] => libintl_dcgettext
[5] => libintl_bindtextdomain
[6] => libintl_ngettext
[7] => libintl_dngettext
[8] => libintl_dcngettext
[9] => libintl_bind_textdomain_codeset
)
26 sander@origin ~%


So they seem to be prefixed with libintl_ here to! That explains all. Well I write something around this now I know how to call the functions. Thanks very much for your help, and if you find something to strip the libintl_ for good... let me know!

Again thanx!
http://bugs.php.net/bug.php?id=29414&edit=3

regards
Joerg
hello,

nice to hear it worked.
i didn't respect special functions and some wouldn't compile so you might miss the one or the other.
but it's made with mipspro so i guess the stuff that works works quite well ;-)

_________________
r-a-c.de
Looks like this was fixed in PHP 5.0.1 - which is out now.

_________________
私のホバークラフト は鰻が一杯です。
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.
Thanks neko for metioning. It is indeed solved in PHP 5.0.1 which is running fine!
wow, you guys are fast.
upped it just a few hours ago :D

_________________
r-a-c.de
Well my work depended on it and I work for myself so I regular work through the weekends :)

Though I've got no time atm to make nice tardist of everything :)


BTW, is anyone familiar with "sprocsp" errors with PHP when you are using libraries compiled with MIPSPro's "-apo" flag? I've had quite a few of them and I have no idea how to resolve them aside from just removing the -apo flag during build of the library... (it happend to MySQL if I remember correctly and to the latest GD (graphics library).
shrek wrote:
Well my work depended on it and I work for myself so I regular work through the weekends :)

Though I've got no time atm to make nice tardist of everything :)


BTW, is anyone familiar with "sprocsp" errors with PHP when you are using libraries compiled with MIPSPro's "-apo" flag? I've had quite a few of them and I have no idea how to resolve them aside from just removing the -apo flag during build of the library... (it happend to MySQL if I remember correctly and to the latest GD (graphics library).


also got -apo errors. but only when using php as a plugin/lib.
same with apache2.

_________________
r-a-c.de