1. <i id='l2Bpl'><tr id='l2Bpl'><dt id='l2Bpl'><q id='l2Bpl'><span id='l2Bpl'><b id='l2Bpl'><form id='l2Bpl'><ins id='l2Bpl'></ins><ul id='l2Bpl'></ul><sub id='l2Bpl'></sub></form><legend id='l2Bpl'></legend><bdo id='l2Bpl'><pre id='l2Bpl'><center id='l2Bpl'></center></pre></bdo></b><th id='l2Bpl'></th></span></q></dt></tr></i><div id='l2Bpl'><tfoot id='l2Bpl'></tfoot><dl id='l2Bpl'><fieldset id='l2Bpl'></fieldset></dl></div>

      <small id='l2Bpl'></small><noframes id='l2Bpl'>

      <legend id='l2Bpl'><style id='l2Bpl'><dir id='l2Bpl'><q id='l2Bpl'></q></dir></style></legend>

          <bdo id='l2Bpl'></bdo><ul id='l2Bpl'></ul>

      1. <tfoot id='l2Bpl'></tfoot>
      2. PHP setlocale 不起作用

        时间:2023-10-12
        <tfoot id='jZm8A'></tfoot>
          <tbody id='jZm8A'></tbody>
            <bdo id='jZm8A'></bdo><ul id='jZm8A'></ul>

            • <small id='jZm8A'></small><noframes id='jZm8A'>

              <legend id='jZm8A'><style id='jZm8A'><dir id='jZm8A'><q id='jZm8A'></q></dir></style></legend>

              1. <i id='jZm8A'><tr id='jZm8A'><dt id='jZm8A'><q id='jZm8A'><span id='jZm8A'><b id='jZm8A'><form id='jZm8A'><ins id='jZm8A'></ins><ul id='jZm8A'></ul><sub id='jZm8A'></sub></form><legend id='jZm8A'></legend><bdo id='jZm8A'><pre id='jZm8A'><center id='jZm8A'></center></pre></bdo></b><th id='jZm8A'></th></span></q></dt></tr></i><div id='jZm8A'><tfoot id='jZm8A'></tfoot><dl id='jZm8A'><fieldset id='jZm8A'></fieldset></dl></div>

                  本文介绍了PHP setlocale 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我尝试在我的 raspberry-pi 上使用 nginX 在 PHP (php-fpm) 中将区域设置从 fr_FR 设置为 us_US.
                  这是我的代码:

                  I try to set the locale from fr_FR to us_US in PHP (php-fpm) with nginX on my raspberry-pi.
                  Here is my code:

                  <?php
                  
                  system('locale -a');
                  /*
                  C POSIX en_US.utf8 fr_FR fr_FR.iso88591 fr_FR.iso885915@euro fr_FR.utf8
                  So the en_US locale is well installed
                  */
                  
                  echo locale_get_default();
                  /* fr_FR */
                  echo setlocale(LC_ALL, '0');
                  /*
                  LC_CTYPE=fr_FR.UTF-8;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;
                  LC_MESSAGES=C;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;
                  LC_MEASUREMENT=C;LC_IDENTIFICATION=C
                  */
                  
                  var_dump(setlocale(LC_ALL, 'en_US.UTF-8', 'en_US.UTF8'));
                  /* bool(false) */
                  
                  var_dump(setlocale(LC_ALL, 'fr_FR.UTF8'));
                  /* string(10) "fr_FR.UTF8"
                  useless, but it shows that setlocale works with the already set locale */
                  ?>
                  

                  我不明白为什么 setlocale 返回 false.
                  似乎有些东西不起作用,但我无法找到什么.

                  I don't understand why setlocale returns false.
                  It seems something doesn't work but I don't manage to find what.

                  推荐答案

                  在使用 php5-fpm 运行 nginx 的 debian 机器上安装其他语言环境后,我遇到了同样的问题

                  I had the same problem after installing additional locales on debian machine running nginx with php5-fpm

                  为了解决这个问题,我不得不重新启动 php5-fpm.

                  To fix the problem I had to restart php5-fpm.

                  这篇关于PHP setlocale 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 PHP 在 Laravel 上的 mqtt 下一篇:在 PHP 中,有人可以解释克隆 vs 指针引用吗?

                  相关文章

                  <legend id='uleCz'><style id='uleCz'><dir id='uleCz'><q id='uleCz'></q></dir></style></legend>
                    1. <small id='uleCz'></small><noframes id='uleCz'>

                        <bdo id='uleCz'></bdo><ul id='uleCz'></ul>
                      <tfoot id='uleCz'></tfoot>
                    2. <i id='uleCz'><tr id='uleCz'><dt id='uleCz'><q id='uleCz'><span id='uleCz'><b id='uleCz'><form id='uleCz'><ins id='uleCz'></ins><ul id='uleCz'></ul><sub id='uleCz'></sub></form><legend id='uleCz'></legend><bdo id='uleCz'><pre id='uleCz'><center id='uleCz'></center></pre></bdo></b><th id='uleCz'></th></span></q></dt></tr></i><div id='uleCz'><tfoot id='uleCz'></tfoot><dl id='uleCz'><fieldset id='uleCz'></fieldset></dl></div>