PHP Gettext问题(例如非线程安全的?) [英] PHP Gettext problems (like non-thread-safe?)

查看:83
本文介绍了PHP Gettext问题(例如非线程安全的?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开始使用gettext处理Web项目(PHP 5)上的翻译.由于它是一种广泛使用的标准,并且信誉良好,因此它似乎是最佳选择.

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.

但是,我还听到有关服务器的一些不兼容的消息,并且它是非线程安全的.这对当时使用它的项目意味着什么?由于我构建了许多人使用的东西,因此代码能够正常工作非常重要.

However, I'm also hearing things about server incompatibly and it being non-thread-safe. What does this mean for my projects that use it then? Since I build things that many people use, it's very important that my code works.

我们是在谈论次要问题(例如仍在使用PHP 4的人们)还是主要问题,例如在Web服务器上分发和安装gettext的数量很少?

Are we talking about minor problems (like people still using PHP 4) or major problems like distribution and installation of gettext on websevers being low?

推荐答案

仅当使用嵌入式PHP(例如Apache的mod-php)并运行使用线程的服务器(例如带有worker-mpm的Apache服务器)时,线程问题才适用.

Threads problem only apply if one uses embedded PHP (Apache's mod-php for example) and runs server that uses threads (like Apache server with worker-mpm).

因此-在以下情况下,线程安全问题不适用于您

So - thread safety issue does not apply to you if:

  1. 您使用的是NGINX服务器(它不使用线程.)
  2. 您在fastcgi模式下使用Apache(带有或不带有线程MPM的Apache)和PHP
  3. 您将Apache与非线程MPM(作为prefork-MPM)和PHP一起用于mod-php模式.

因此-大多数具有默认Apache安装的人不必担心gettext不会是线程安全的,因为大多数发行版中的默认apache安装都使用非线程的prefork-MPM!

So - most people with default Apache install shouldn't worry about gettext not being thread safe, as default apache's install in most distro's uses non-threaded prefork-MPM!

P.S.另外-请记住,Windows上的Apache是​​线程化的.

P.S. also - keep in mind that Apache on Windows is threaded.

这篇关于PHP Gettext问题(例如非线程安全的?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆