作业帮 > 综合 > 作业

PHP5.5.3Warning:phpinfo():It is not safe to rely on the syst

来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/05/22 14:34:48
PHP5.5.3
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 F:\web\index.php on line 1
那上错了
It is not safe to rely on the system's timezone settings.
系统的时区设置有问题.
一种方法,可以在php程序里,用函数修正date_default_timezone_set (XXX).关于XXX,大陆内地可用的值是:Asia/Chongqing ,Asia/Shanghai ,Asia/Urumqi(依次为重庆,上海,乌鲁木齐),港台地区可用:Asia/Maca* ,Asia/Hong_Kong ,Asia/Taipei(依次为澳门,香港,台北),还有新加坡:Asia/Singapore,以上没有北京,不过接着往下看,其他可用的值 是:Etc/GMT-8,Singapore ,Hongkong,PRC.PRC是什么?PRC是中华人民共和国啊!
一种方法,在php.ini中,可以设置为:date.timezone = PRC或date.timezone = Asia/Shanghai.
再问: 找不到? php.ini
再答: 不知道你是什么操作系统,windows的话一般放在c:\windows\目录下,linux一般放在/etc下面 具体位置,你要么通过查找文件功能定位,也可以写一个测试php文件里面有注意当前php.ini位,在前面几行。
再问: 我是win7的系统 c:\windows\目录下 也没有php.ini文件
再答: 写一个测试php文件,随便起个名放在网站目录下,同容如下
<?php phpinfo(); ?>然后通过浏览器执行这个文件名,在前几行,有个地方会写着php.ini的位置。loaded configuration file
再问: 写了测试php 还是出了这个错误 有两个 extension_dir = ; extension_dir = "ext" 和 ; extension_dir = "./" 请问修改那个extension_dir =
再答: 按上面的改了php.ini吗?改完要重启一下web服务软件的哦 正常的话,会在phpinfo里面找到对应的信息。界面如上图 ps. 如要date.timezone = "Asia/Shanghai"前面有 " ; "这个符号,也是要去掉的。他是注释的作用
再问: 我怎么调多不好使请看图片远程协助
再问: 远程协助 qq⑤①⑨⑥②零⑨⑥⑧
再答: 解决就好