PHP date.timezone无值

PHP date.timezone无值,php,timezone,Php,Timezone,我只是在windows OS x64上用创建新服务器 httpd-2.4.9-win64-VC11 php-5.5.14-Win32-VC11-x64 MySql Server 我进入php.ini取消注释并添加以下内容: date.timezone = "Asia/Kuala_Lumpur" 我在phpinfo.php中创建并查看,发现我的date.timezone具有无值的本地值和主值 如下 启用日期/时间支持的“奥尔森”时区数据库版本2014.3 时区数据库内部默认时区UTC 指令本地

我只是在windows OS x64上用创建新服务器

httpd-2.4.9-win64-VC11
php-5.5.14-Win32-VC11-x64
MySql Server
我进入
php.ini
取消注释并添加以下内容:

date.timezone = "Asia/Kuala_Lumpur"
我在
phpinfo.php
中创建并查看,发现我的
date.timezone
具有
无值
的本地值和主值

如下

启用日期/时间支持的“奥尔森”时区数据库版本2014.3 时区数据库内部默认时区UTC

指令本地值主值 date.default_纬度31.7667 31.7667 date.default_经度35.2333 35.2333 日期:日出天顶90.583333 90.583333 date.sunset_zenith 90.583333 90.583333 date.timezone无值无值

在同一页面(phpinfo.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 J:\WebDocs\gad\phpinfo.php on line 2

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 J:\WebDocs\gad\phpinfo.php on line 2
这是我当前的
php.ini


这与php.ini模块有关吗?解决这个问题的最佳方法是什么。

US/Central不是PHP的有效时区

有效的美国时区如下:

中部时间使用美洲/芝加哥代替

这是我今天早上找到的快速解决方案

httpd.conf
line
PHPIniDir

"H:/PHP"
应该是这样的

"J:/PHP"

你重启apache了吗?您是否编辑了正确的php.ini?@Lashane是的,我重新启动了apache,同样的情况也会发生。请确保您编辑了正确的php.ini。有些系统有一个单独的CLI和Apache系统。在web文件中运行phpinfo(),顶部部分将给出解析ini文件的路径。请确保您编辑的php.ini是apache使用的。在您的phpinfo()中,标题中有一行关于“加载的PHP配置”或类似的smth,其中包含PHP.ini的路径。我找到了解决方案,因为缺少睡眠,我添加了PHPIniDir“H:/PHP”这是错误的,应该是PHPIniDir“J:/PHP”,我以前尝试过,这不是当前的解决方案。是的,它是有效的,只是不推荐。所以,您加载了错误的php.ini文件。。。因为您在httpd.conf中放置了错误的phpinidir。如果您在配置上遇到问题,请务必首先检查它-打开phpinfo,看看加载了哪个文件。@Toly指出,大师+2.