duanfeng7756 2014-04-16 07:54
浏览 85

Php.ini strftime()不安全Mac osx mavericks

I'm getting an error whilst using php + smarty on my mac running mavericks.

I've read in several places that you must change the timezone settings in the php.ini files.

i've also run the command to see which file php is pointing to:

php -i | grep 'Configuration File'
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini

After that i changed the date.timezone line to the following...

date.timezone = "Australia/Sydney"

and this was done in the files

/etc/php.ini /etc/php.ini-5.2-previous /etc/php.ini.default

The error is as follows...

Warning: 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 the timezone 'UTC' for now, but please set date.
timezone to select your timezone. 
in /Library/Smarty3.1.16/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 234
  • 写回答

1条回答 默认 最新

  • duandanai6470 2016-01-09 17:10
    关注

    For those who are still wondering.

    Similarly, in my case, Yosemite OS, I had no php.ini file in /etc. So I copied /etc/php.ini.default and modified it by adding a timezone and removing ;

    $ sudo cp /etc/php.ini.default /etc/php.ini
    

    And then:

    date.timezone = America/Los_Angeles
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入
  • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。
  • ¥15 opencv图像处理,需要四个处理结果图
  • ¥15 无线移动边缘计算系统中的系统模型