每当我在PHP中使用日期函数时,我都在使用php5.5并收到此错误:
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文件权限,但仍然无法正常工作请指导我解决这个问题,谢谢..