我使用php5.5,每当我在PHP中使用date函数时都会得到这个错误:
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 /var/www/info.php on line 1
加载的配置文件如下:
/etc/php5/apache2/php.ini
因此,我将date.timezone设置更改为:
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Jakarta
; http://php.net/date.default-latitude
;date.default_latitude = 31.7667
; http://php.net/date.default-longitude
;date.default_longitude = 35.2333
; http://php.net/date.sunrise-zenith
;date.sunrise_zenith = 90.583333
; http://php.net/date.sunset-zenith
;date.sunset_zenith = 90.583333
然后我重新启动服务器:
sudo /etc/init.d/apache2 restart
但仍然收到此错误,我尝试检查附加ini文件位置中的.ini文件,但它们都没有覆盖date.timezone设置
我已经检查了php.ini文件权限,但是仍然不能工作,请指导我解决这个问题,谢谢..
https://stackoverflow.com/questions/20451719
复制相似问题