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

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

    2. <legend id='SIac8'><style id='SIac8'><dir id='SIac8'><q id='SIac8'></q></dir></style></legend>

        php5.3.3 date.timezone 再次 php.ini 指令未考虑在内

        时间:2024-08-14

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

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

              <bdo id='UVtgV'></bdo><ul id='UVtgV'></ul>
                <tbody id='UVtgV'></tbody>

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

                  本文介绍了php5.3.3 date.timezone 再次 php.ini 指令未考虑在内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  系统:Debian Lenny/Apache 2.2/php5.3.3 源码编译

                  System: Debian Lenny/Apache 2.2/php5.3.3 compiled from sources

                  我正在为 php.ini 中的 date.timezone 苦苦挣扎.

                  I'm strugglying with the date.timezone within php.ini.

                  我可以在 php 源代码中定义 TZ,但我想在 ini 文件中立即修复它.

                  I can define the TZ using in the php source code but I'd like to fix that at once in the ini file.

                  php 代码:好的

                  date_default_timezone_set('Europe/Berlin');
                  

                  php.ini : 如果不在源代码中设置,则不考虑

                  php.ini : Not taken into consideration if not setup within the source code

                  date.timezone = 'Europe/Berlin'
                  

                  我还检查了我修改了正确的 php.ini 文件并干扰了一些 php.default.ini 文件.
                  我在 apache 配置文件中检查了是否会有干扰的 TZ env 数据,但没有.

                  I also checked that I modified the right php.ini file and have interference with some php.default.ini files.
                  I checked within the apache config files whether there would be an interfering TZ env data, but none.

                  不知道该怎么做,所以欢迎任何提示,

                  Don't know what to do more, so any hints will be welcomed,

                  提前谢谢.

                  我也尝试使用无引号或单引号或双引号作为 date.timezone = 'Europe/Berlin' 但我仍然在 phpinfo 中得到无价值".

                  I also tried with no or single or double quotes as date.timezone = 'Europe/Berlin' but I still get a "no value" in the phpinfo.

                  phpinfo() 和下面的测试脚本都返回 date.timezone 为空(例如,没有值):

                  Both phpinfo() and the below test script return that the date.timezone is empty (eg. no value) :

                   date_default_timezone_set('America/Los_Angeles');
                   $script_tz = date_default_timezone_get();
                   $iniset = ini_get('date.timezone') ;
                   if (strcmp($script_tz, $iniset)){
                     echo "Script timezone ($script_tz) differs from ini-set timezone ($initset).";
                   } else {
                     echo "Script timezone ($script_tz) and ini-set timezone match.";
                   }
                  

                  EDIT3:嗯,我想我在 php.ini 中找到了一些东西:

                  EDIT3: hum, I guess I found sthg in the php.ini :

                   Configuration File (php.ini) Path : /usr/local/php533/php.ini 
                   Loaded Configuration File : VOID !
                  

                  所以我必须想办法确保 Apache 以某种方式寻找正确的 php.ini...

                  So I have to find the way to make sure Apache is looking for the right php.ini somehow...

                  推荐答案

                  希望它可以帮助其他类似 debian 的发行版:

                  Hope it can help others on debian's like distros :

                  已解决:
                  需要告诉 Apache 加载想要的 php.ini 文件

                  背景:
                  PHP 作为 Apache 模块加载(例如 DSO)

                  Context:
                  PHP loaded as an Apache module (eg DSO)

                  简而言之:
                  外壳环境

                  PHP_INI_SCAN_DIR=/pathtophpini
                  export PHP_INI_SCAN_DIR
                  

                  http.conf

                  # ...
                  # DSO Modules: PHP as an Apache module
                  SetEnv PHPRC /usr/pathtophpini
                  SetEnv PHP_INI_SCAN_DIR /usr/pathtophpini
                  
                  LoadModule php5_module /pathtophpmod/libphp5.so
                  PHPINIDir /pathtophpini
                  # ...
                  

                  外壳

                  /etc/init.d/apache2 restart   
                  

                  现在只需使用命令行中的 php-cli 或 phpinfo() 检查加载的配置文件 php.ini 是否正确:

                  Now just checking that the loaded configuration file php.ini is the right one either using the php-cli in commandline or phpinfo() :

                  /path/to/your/phpcli/bin/php -i | grep php.ini | tail -n2   
                  # which gives you the expected answer
                  Configuration File (php.ini) Path => /pathtophpini/php.ini
                  Additional .ini files parsed => /pathtophpini/php.ini
                  

                  更多文档:
                  在那个非常特殊的点上,只要关于该主题的文档很少,因为这是 apache 和 php 之间的一种共同责任主题:
                  在stackoverflow上
                  关于 php 手册
                  askapache

                  这篇关于php5.3.3 date.timezone 再次 php.ini 指令未考虑在内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:函数 date_default_timezone_set() 不可用 下一篇:Javascript/PHP 和时区

                  相关文章

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

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

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