技术知识库

  PHP在安装好并且修改了php.ini文件中的时区设置之后,通过浏览器访问php测试文件,出现错误PHP Warning:  phpinfo() [<a href='function.phpinfo'>function.phpinfo</a>]: 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 'UTC' for '8.0/no DST' instead in E:wwwrootxxx1.php on line 1

解决办法在php测试文件中加入如下内容

<?php

date_default_timezone_set("Asia/Shanghai");

echo date('h:i:s A');

?>

<?php phpinfo(); ?>


提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: