473,544 Members | 1,944 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 3620
Dave Patton <sp**@trap.inva lid> wrote in
news:Xn******** *************** **********@24.7 1.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(possibl y 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
1909
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 to create messages.mo and messages.po files. I've created all directories under a 'locale' root directory
13
3924
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
3506
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 module available? This is my script so far : import gettext gettext.install('test2', '.', unicode=1) lang1 = gettext.translation('test2',...
0
1204
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 http://wiki.wxpython.org/index.cgi/RecipesI18n but found that the accented letters would not display properly. I have found a workaround that works from Python in a Nutshell; however...
0
1281
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 should be working. Here follows a minimal example that should be working, but isn't (gettext and msgfmt are the normal GNU gettext tools): $ cat...
4
2359
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 unserializing them at each request? I found this on Google saying that some guy sped up gettext, but I have no idea how fast it was in the first...
6
2013
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 & properties import gettext fr = gettext.translation('i18n_test', './translations',
2
4416
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 apt-get install php-gettext apt-get install php5-cli apt-get install php5 php5-common
8
3372
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
7420
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7368
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5904
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5291
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4911
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3407
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3404
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
983
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
657
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.