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

查看:33
本文介绍了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 的人)还是大问题,如网络服务器上 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)和 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!

附:另外 - 请记住,Windows 上的 Apache 是线程化的.

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

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

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