首页 > 解决方案 > Linux CentOS 无法更改时区

问题描述

我已将加载的 PHP ini 文件中的时区设置更改为:

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "America/Santiago"

我重新启动了 httpd 服务,然后加载了一个只有 phpinfo() 方法调用的 info.php 页面。令我惊讶的是,默认时区仍显示为 UTC。

除了加载的文件之外,我还更改了其他 php.ini 文件,但没有成功。

但是,如果我使用命令行 php,它会显示正确的时区。

有什么建议吗?

标签: phplinuxapachecentos

解决方案


推荐阅读