使用phpmyadmin的时候 提示Warning: strtotime()

来源:百度知道 编辑:UC知道 时间:2024/05/12 16:12:34
Warning: strtotime() [function.strtotime]: 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 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /home/httpd/admin/libraries/db_info.inc.php on line 88

Warning: strftime() [function.strftime]: 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 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /home/httpd/admin/libraries/common.lib.php on line 1482

本人比较新手。。请问如何设置才能让他不报错?。最好能说得详细一点。。 万分感谢

这是因为没有设置默认时区,编辑

/etc/php.ini

找到

;date.timezone=

把分号去掉,并且在后面加上PRC,因为在中国

date.timezone=PRC

重启apache 

service httpd restart

就可以了,你可以试试看

在/phpMyAdmin/libraries/common.lib.php文件中,在<?php之后的第二行,写入以下代码

date_default_timezone_set('PRC');//设置时区