即使设置了时区,SilverStripe 安装也会出现错误 "date.timezone option in php.ini must be set correctly."
SilverStripe installation gives error "date.timezone option in php.ini must be set correctly." even when timezone is set
我正在尝试安装 SilverStripe,但在安装页面上出现错误:date.timezone option in php.ini must be set correctly
即使时区设置为 Pacific/Auckland
我已经编辑了我的 php.ini 文件来设置时区,然后重新启动了 apache,但它仍然不起作用。 php.ini 中的相关行是:
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Pacific/Auckland
服务器在 AWS 上 运行 Ubuntu。
将 PHP 文件编辑为 运行 命令 phpinfo(),然后在浏览器中查看结果,显示当前为 PHP 配置的时区信息。如果 php.ini date.timezone 设置有效,正确的时区应该在 phpinfo() 输出中可见。
奇怪的是,apache 重启似乎不足以更改 PHP date.timezone 配置,因为 phpinfo() 显示 date.timezone 设置仍然为空。重新启动服务器使其正常工作。
尝试将这些行添加到您的 mysite/_config。php
// Set the site locale
i18n::set_locale('en_US');
ini_set('date.timezone', 'America/New_York');
我正在尝试安装 SilverStripe,但在安装页面上出现错误:date.timezone option in php.ini must be set correctly
即使时区设置为 Pacific/Auckland
我已经编辑了我的 php.ini 文件来设置时区,然后重新启动了 apache,但它仍然不起作用。 php.ini 中的相关行是:
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Pacific/Auckland
服务器在 AWS 上 运行 Ubuntu。
将 PHP 文件编辑为 运行 命令 phpinfo(),然后在浏览器中查看结果,显示当前为 PHP 配置的时区信息。如果 php.ini date.timezone 设置有效,正确的时区应该在 phpinfo() 输出中可见。
奇怪的是,apache 重启似乎不足以更改 PHP date.timezone 配置,因为 phpinfo() 显示 date.timezone 设置仍然为空。重新启动服务器使其正常工作。
尝试将这些行添加到您的 mysite/_config。php
// Set the site locale
i18n::set_locale('en_US');
ini_set('date.timezone', 'America/New_York');