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

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

      <tfoot id='dhC3Z'></tfoot>

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

      1. 无法在 php.ini 文件中设置 date.timezone

        时间:2024-08-14
        <tfoot id='ok9i8'></tfoot>

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

                • <bdo id='ok9i8'></bdo><ul id='ok9i8'></ul>

                  <i id='ok9i8'><tr id='ok9i8'><dt id='ok9i8'><q id='ok9i8'><span id='ok9i8'><b id='ok9i8'><form id='ok9i8'><ins id='ok9i8'></ins><ul id='ok9i8'></ul><sub id='ok9i8'></sub></form><legend id='ok9i8'></legend><bdo id='ok9i8'><pre id='ok9i8'><center id='ok9i8'></center></pre></bdo></b><th id='ok9i8'></th></span></q></dt></tr></i><div id='ok9i8'><tfoot id='ok9i8'></tfoot><dl id='ok9i8'><fieldset id='ok9i8'></fieldset></dl></div>
                  本文介绍了无法在 php.ini 文件中设置 date.timezone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 php5.5,每当我在 PHP 中使用日期函数时都会出现此错误:

                  I'm using php5.5 and getting this error whenever I used the date function in PHP:

                   Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/info.php on line 1
                  

                  加载的配置文件在这里:

                  the loaded configuration file is here:

                  /etc/php5/apache2/php.ini 
                  

                  所以我将 date.timezone 设置更改为:

                  so I changed the date.timezone setting into this:

                  [Date]
                  ; Defines the default timezone used by the date functions
                  ; http://php.net/date.timezone
                  date.timezone = Asia/Jakarta
                  
                  ; http://php.net/date.default-latitude
                  ;date.default_latitude = 31.7667
                  
                  ; http://php.net/date.default-longitude
                  ;date.default_longitude = 35.2333
                  
                  ; http://php.net/date.sunrise-zenith
                  ;date.sunrise_zenith = 90.583333
                  
                  ; http://php.net/date.sunset-zenith
                  ;date.sunset_zenith = 90.583333
                  

                  然后我重启服务器:

                  sudo /etc/init.d/apache2 restart
                  

                  但仍然出现此错误,我尝试检查附加 ini 文件位置中的 .ini 文件,但没有一个覆盖 date.timezone 设置

                  but still getting this error, I tried to check the .ini file in the Additional ini file location but none of it is overriding the date.timezone setting

                  我已经检查了 php.ini 文件的权限,但还是不行请指导我解决这个问题,谢谢..

                  I've checked the php.ini file permission, but still not working please guide me to solve this problem, thanks..

                  推荐答案

                  终于解决了我的问题,这是我加载的配置文件:

                  finally solved my problem, this is my Loaded Configuration File:

                  /etc/php5/apache2/php.ini 
                  

                  在这里修改了 date.timezone 但它不起作用.

                  modified the date.timezone here but it's not working.

                  因此,我检查了 phpinfo() 中的扫描此目录以获取其他 .ini 文件"值,该值指向:

                  So, I check the "Scan this dir for additional .ini files " values in phpinfo() which point to:

                  /etc/php5/apache2/conf.d 
                  

                  然后我从该文件夹中的所有文件中搜索 date.timezone 但没有找到.

                  then I search date.timezone from all files in that folder but found none.

                  这是我在 phpinfo() 中的附加 .ini 文件解析值:

                  this is my Additional .ini file parsed value in phpinfo():

                  /etc/php5/apache2/conf.d/05-opcache.ini, /etc/php5/apache2/conf.d/10-pdo.ini, /etc/php5/apache2/conf.d/20-json.ini, /etc/php5/apache2/conf.d/20-mysql.ini, /etc/php5/apache2/conf.d/20-mysqli.ini, /etc/php5/apache2/conf.d/20-pdo_mysql.ini, /etc/php5/apache2/conf.d/20-xdebug.ini, /etc/php5/apache2/conf.d/30-mcrypt.ini 
                  

                  我修改了/etc/php5/apache2/conf.d/20-xdebug.ini,并附加了这一行:

                  I modified /etc/php5/apache2/conf.d/20-xdebug.ini, and appended this line:

                  date.timezone = Asia/Jakarta
                  

                  很奇怪,但这解决了我的问题!!!

                  very weird but this solved my problem !!!

                  这篇关于无法在 php.ini 文件中设置 date.timezone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:什么时候应该使用学说 ORM,什么时候应该使用 zend-db-table? 下一篇:使用 DateTime/DateTimeZone 在 PHP 中调整时区

                  相关文章

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

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

                      <tfoot id='fCYWK'></tfoot>