PHP 5.0.0 && gettext not working

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
shrek
Posts: 260
Joined: Fri Apr 18, 2003 1:32 pm
Location: Vleuten, The Netherlands
Contact:

PHP 5.0.0 && gettext not working

Unread postby shrek » Fri Aug 13, 2004 2:13 am

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: Select all

<?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.

User avatar
joerg
Posts: 2223
Joined: Thu Jan 08, 2004 6:57 am
Location: In an origin rack - Germany
Contact:

Re: PHP 5.0.0 && gettext not working

Unread postby joerg » Fri Aug 13, 2004 6:29 am

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.

shrek
Posts: 260
Joined: Fri Apr 18, 2003 1:32 pm
Location: Vleuten, The Netherlands
Contact:

Re: PHP 5.0.0 && gettext not working

Unread postby shrek » Fri Aug 13, 2004 6:41 am

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: Select all

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!

User avatar
joerg
Posts: 2223
Joined: Thu Jan 08, 2004 6:57 am
Location: In an origin rack - Germany
Contact:

its not a new php5 feature.... its a bug :)

Unread postby joerg » Fri Aug 13, 2004 6:52 am


User avatar
foetz
Moderator
Moderator
Posts: 5640
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Unread postby foetz » Fri Aug 13, 2004 3:15 pm

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

User avatar
nekonoko
Site Admin
Site Admin
Posts: 8026
Joined: Thu Jan 23, 2003 1:31 am
Location: Pleasanton, California
Contact:

Unread postby nekonoko » Fri Aug 13, 2004 10:17 pm

Looks like this was fixed in PHP 5.0.1 - which is out now.
Twitter: @neko_no_ko
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.

shrek
Posts: 260
Joined: Fri Apr 18, 2003 1:32 pm
Location: Vleuten, The Netherlands
Contact:

Unread postby shrek » Sat Aug 14, 2004 8:20 am

Thanks neko for metioning. It is indeed solved in PHP 5.0.1 which is running fine!

User avatar
foetz
Moderator
Moderator
Posts: 5640
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Unread postby foetz » Mon Aug 16, 2004 6:23 pm

wow, you guys are fast.
upped it just a few hours ago :D
r-a-c.de

shrek
Posts: 260
Joined: Fri Apr 18, 2003 1:32 pm
Location: Vleuten, The Netherlands
Contact:

Unread postby shrek » Tue Aug 17, 2004 12:21 am

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).

User avatar
foetz
Moderator
Moderator
Posts: 5640
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Unread postby foetz » Tue Aug 17, 2004 8:16 pm

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


Return to “SGI: Development”

Who is online

Users browsing this forum: No registered users and 0 guests