473,625 Members | 3,384 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 3623
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
1912
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
3935
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
3514
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', languages=)
0
1207
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 it is said in that book that "...this is not good style". I would like to do things "in good...
0
1285
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 foo.php #! /usr/bin/php <?php bindtextdomain($argv, $_ENV);
4
2364
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 place: http://savannah.nongnu.org/forum/forum.php?forum_id=3648 I was planning to just...
6
2020
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
4420
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
3376
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
8256
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8189
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8694
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
5570
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4193
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2621
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 we have to send another system
2
1500
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.