473,507 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3616
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1906
by: Daniel CAUSSE | last post by:
Hello, I'm testing gettext on my website but it doesn't work. phpinfo returns correct informations: configure command => '--with-gettext=/usr' GetText Support => enabled I have no problem...
13
3920
by: cantabile | last post by:
Hi, I'm failing to make it work but can't find out what's wrong. Here's what I do : ================ test.py import gettext gettext.install('')
2
3503
by: Thomas W | last post by:
I'm trying to wrap my head around the docs at python.org related to the gettext-module, but I'm having some problem getting it to work. Is there any really simple, step-by-step on how to use this...
0
1200
by: André | last post by:
I'm trying to change an app so that it uses gettext for translations rather than the idiosyncratic way I am using. I've tried the example on the wxPython wiki...
0
1278
by: redhog | last post by:
I can not get gettext to work at all under PHP. I run ubuntu 6.06.1 LTS, and the php5 package there announces that it supports gettext. Also, php -i sais gettext GetText Support =enabled, so it...
4
2353
by: Mike P2 | last post by:
Hi. Does anyone here have experience with PHP gettext functions? I'd like to know how they work better. Also, is gettext more efficient than serializing the language strings into language files and...
6
2010
by: =?iso-8859-1?B?QW5kcuk=?= | last post by:
I've encountered a problem using gettext with properties while using a Python interpreter. Here's a simple program that illustrate the problem. ============== # i18n_test.py: test of gettext &...
2
4412
by: paolob | last post by:
Hi to all, I'm running php 5.2.5 on Debian etch, with apache 2.0.56. I need to include, in php.ini, gettext.so library but I didn't find anything. I've already install: apt-get install gettext...
8
3367
by: howa | last post by:
http://hk2.php.net/manual/en/ref.gettext.php I just wonder why those kind of translation/mapping can't be implemented in using plain PHP array? Howard
0
7221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3190
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.