472,110 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,110 software developers and data experts.

will PHP and GNU gettext work properly with Apache?

Can someone point me to a definitive source for the
answers to the following two questions:

1)
In an environment with Redhat Linux 2.4.21-27.0.1,
Apache 1.3.31, PHP 4.3.10, and GNU gettext 0.14.1,
will using PHP's gettext support along with the
GNU gettext utilities work properly?
For example, I've seen references to the translated
strings in .mo files not always being what appears
on webpages, presumably due to the caching built
into GNU gettext.

2)
In December 2003, in the php.i18n newsgroup, in a posting titled
"GNU gettext support for PHP programs",Bruno Haible said:
- The just-released GNU gettext 0.13 has improved support
for PHP programs
- Unfortunately, GNU gettext is not yet ready for being used
in a multithreaded environment where each thread may need
to use a different locale/language.

The README file in the hello-php directory for GNU gettext
0.14.1 says:
------------------------------------------------------------------
The gettext/PHP binding has a limitation: While it works fine for
standalone PHP programs, it cannot be used inside a web server, to
translate parts of web pages into the preferred encoding of user
that makes a HTTP connection. The reason is that a web server
usually is multithreaded, and the gettext() API relies on the
process' global locale.
------------------------------------------------------------------

Do the above statements mean that using GNU gettext with PHP
and Apapche 2.0 will not work? Does anyone know if there are
plans to change GNU gettext to support multiple threads?

Thanks

Note:
- crossposted to gnu.utils.help, comp.lang.php
- followups set to gnu.utils.help

--
Dave Patton
Canadian Coordinator, Degree Confluence Project
http://www.confluence.org/
My website: http://members.shaw.ca/davepatton/
Jul 17 '05 #1
1 3517
Dave Patton <sp**@trap.invalid> wrote in
news:Xn*********************************@24.71.223 .159:
Can someone point me to a definitive source for the
answers to the following two questions:

1)
In an environment with Redhat Linux 2.4.21-27.0.1,
Apache 1.3.31, PHP 4.3.10, and GNU gettext 0.14.1,
will using PHP's gettext support along with the
GNU gettext utilities work properly?
For example, I've seen references to the translated
strings in .mo files not always being what appears
on webpages, presumably due to the caching built
into GNU gettext.

2)
In December 2003, in the php.i18n newsgroup, in a posting titled
"GNU gettext support for PHP programs",Bruno Haible said:
- The just-released GNU gettext 0.13 has improved support
for PHP programs
- Unfortunately, GNU gettext is not yet ready for being used
in a multithreaded environment where each thread may need
to use a different locale/language.

The README file in the hello-php directory for GNU gettext
0.14.1 says:
------------------------------------------------------------------
The gettext/PHP binding has a limitation: While it works fine for
standalone PHP programs, it cannot be used inside a web server, to
translate parts of web pages into the preferred encoding of user
that makes a HTTP connection. The reason is that a web server
usually is multithreaded, and the gettext() API relies on the
process' global locale.
------------------------------------------------------------------

Do the above statements mean that using GNU gettext with PHP
and Apapche 2.0 will not work? Does anyone know if there are
plans to change GNU gettext to support multiple threads?

I've added a note to the PHP website page for gettext:
http://www.php.net/manual/en/ref.gettext.php
================================================== =============
Make sure you check your webserver configuration before deciding
to use gettext, because if you are running in a multi-threaded
environment you should not use gettext, as it is not thread-safe.

A future version of gettext(possibly 0.15) may be thread-safe.
Any gettext dependencies, such as glibc would also need to be
thread-safe.

Apache 1.3 on Unix generally is non-threaded, but on Windows it
is multithreaded.
Apache 2.0 has support for MPMs(Multi-Processing Modules), some of
which support multiple threads:
http://httpd.apache.org/docs-2.0/mpm.html
================================================== =============

Note:
- crossposted to gnu.utils.help, comp.lang.php
- followups set to gnu.utils.help

--
Dave Patton
Canadian Coordinator, Degree Confluence Project
http://www.confluence.org/
My website: http://members.shaw.ca/davepatton/
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Daniel CAUSSE | last post: by
13 posts views Thread by cantabile | last post: by
reply views Thread by redhog | last post: by
4 posts views Thread by Mike P2 | last post: by
6 posts views Thread by =?iso-8859-1?B?QW5kcuk=?= | last post: by
2 posts views Thread by paolob | last post: by
8 posts views Thread by howa | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.