【问题标题】:Time error when sending email SMTP with codeigniter - mediatemple hosting使用 codeigniter 发送电子邮件 SMTP 时出现时间错误 - mediatemple 托管
【发布时间】:2012-01-12 06:43:12
【问题描述】:

我正在使用 codeigniters 电子邮件助手 (SMTP) 从我的网站发送电子邮件

电子邮件已成功发送到我的收件箱,但我收到以下错误:

A PHP Error was encountered

Severity: Warning

Message: date() [function.date]: 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 'America/Los_Angeles' for 'PST/-8.0/no DST' instead

Filename: libraries/Email.php

Line Number: 704

我最近将我的主机切换到了 mediatemple,并且之前没有收到过这样的消息。我需要在某处或时区指定时间格式吗??

【问题讨论】:

    标签: php email codeigniter time smtp


    【解决方案1】:

    在您的php.ini 文件中设置date.timezone,警告就会消失。

    我相信 MediaTemple 允许您通过在主目录中包含 php.ini 来编辑 php.ini 设置。

    【讨论】:

      【解决方案2】:

      如果您没有更新 php.ini 的权限(通常您没有),
      您可以将此行添加到您的 php 脚本中:-

      date_default_timezone_set("Asia/Singapore"); <-- replace to your desire city
      

      这里有更多关于这个函数的文档:http://uk.php.net/date_default_timezone_set

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-05-30
        • 2021-12-01
        • 1970-01-01
        • 1970-01-01
        • 2015-12-28
        • 2012-11-21
        • 2014-02-21
        • 2019-05-06
        相关资源
        最近更新 更多