PHP Gettext problems (like non-thread-safe?)

后端 未结 3 862
时光说笑
时光说笑 2020-12-30 07:49

I want to start using gettext to handle my translations on web projects (PHP 5). Since it is a widely used standard with a good reputation it seems to be the best choice.

3条回答
  •  爱一瞬间的悲伤
    2020-12-30 08:08

    I think play some more with the php manual comments portion should revile more information....one of the comments from the manual on gettext section

    The GNU gettext library works on a per-process, not per-thread basis. This means that in a multi-user setting such as the Apache web server it will only work with a prefork MPM (i.e. one process per user). Worker and other threaded MPMs will not work.

    In addition, many users control GNU gettext by setting system environment variables such as LANG. This is not a good solution for a web server environment due to an obvious race condition.

    http://www.php.net/manual/en/gettext.setup.php

提交回复
热议问题