PHP Warning: date(): It is not safe to rely on the system's timezone settings.

时间:2023-01-14 07:25:17

OSSEC安装结束后运行,运行以下命令却抛错

cat /opt/ossec/logs/alerts/alerts.log

具体抛错内容:

** Alert 1468897672.2164786: mail  - syslog,errors,
Jul :: localhost->/var/log/httpd/error_log
Rule: (level ) -> 'Unknown problem somewhere in the system.'
[Tue Jul ::50.911154 ] [:error] [pid ] [client 192.168.129.1:] PHP Warning: 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/html/analogi/detail.php on line 547, referer: http://192.168.129.128/analogi/

It is not safe to rely on the system解决方法,其实就是时区设置不正确造成的,
解决方法就是在/etc/php.ini里加上找到date.timezone项,

设置date.timezone = "Asia/Shanghai",重启环境就ok了。

PHP Warning: date(): It is not safe to rely on the system's timezone settings.的更多相关文章

  1. Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use ...报错

    错误截图 Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* t ...

  2. 出现Warning: date(): It is not safe to rely on the system's timezone settings的解决办法

    在没有配置,尤其是新安装的PHP中使用date函数时,会报这个错误: Warning: date(): It is not safe to rely on the system's timezone ...

  3. Warning: strftime(): It is not safe to rely on the system's timezone settings.

    当运行程序时,会出现如下警告: Warning: strftime(): It is not safe to rely on the system's timezone settings. You a ...

  4. php : Warning: strftime(): It is not safe to rely on the system's timezone settings.

    使用 Smarty 的时候出现这种警告: Warning: strftime(): It is not safe to rely on the system's timezone settings. ...

  5. php时区设置 warning: strtotime(): It is not safe to rely on the system's timezone settings

    warning: strtotime(): It is not safe to rely on the system's timezone settings warning: strtotime(): ...

  6. date(): It is not safe to rely on the system’s timezone settings.

    在执行php脚本时出现的错误: date(): It is not safe to rely on the system’s timezone settings.You are *required* ...

  7. PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings.

    有三种解决办法: 1. php文件中设置时区 <?php date_default_timezone_set('Asia/Shanghai'); echo strtotime('2012-9-3 ...

  8. yii2定时任务不执行&comma;报错PHP date调用警告:It is not safe to rely on the system&&num;39&semi;s timezone settings

    It is not safe to rely on the system's timezone settings 在写php程序中有时会出现这样的警告:PHP Warning: date(): It ...

  9. 解决php的&OpenCurlyDoubleQuote;It is not safe to rely on the system’s timezone settings”问题

    PHP调试的时候出现了警告: It is not safe to rely on the system解决方法,其实就是时区设置不正确造成的,本文提供了3种方法来解决这个问题. 实 际上,从PHP 5 ...

随机推荐

  1. Python 学习第十七天 jQuery

    一,jQuery 知识详解 利用jquery 查找元素,操作元素 1,jquery 引入 <!DOCTYPE html> <html lang="en"> ...

  2. dobbo zookeeper 认识

    dubbo 主要使用来整合各种协议的服务,服务提供者可以向dubbo平台注册服务,服务消费都可以看到所有服务的详细信息,而已可以调用所提供的服务接口.zookeeper:主是要服务的集群,配置管理(如 ...

  3. 习课的redis配置记录

    <!-- redis begin --> <dependency> <groupId>redis.clients</groupId> <artif ...

  4. 【原】jquery图片预览

    平时我们在做图片上传的时候,如果可以让用户选择图片的时候,看到图片的效果,那这样用户体验会好很多,因为用户可以就可以决定是否继续用这张图片,尤其是和ajaxuploadfile结合使用的时候,图片的预 ...

  5. django上传下载大文件

    上传 def upFile(file): upload_dir = '/tmp/upload/%s' % username if request.method == 'POST': upload_fi ...

  6. C&plus;&plus; this指针详解

       C++this指针操作 在这里总结一下this 指针的相关知识点. 首先,我们都知道类的成员函数可以访问类的数据(限定符只是限定于类外的一些操作,类内的一切对于成员函数来说都是透明的),那么成员 ...

  7. MongoDB简单操作

    Hadoop核心技术厂商Cloudera将在2014/06推出hadoop Ecosystem与MongoDB的整合产品,届时MongoDB与ipmala及hbase,hive一起用; 开源linux ...

  8. Group Commit of Binary Log

    160222 09:19:26 mysqld_safe Starting mysqld daemon with databases from /data01/mysql 2016-02-22 09:1 ...

  9. Oracle中sign函数和decode函数的使用

    Oracle中sign函数和decode函数的使用 1.比较大小函数SIGN sign(x)或者Sign(x)叫做 符号函数,其功能是取某个数的符号(正或负): 当x>0,sign(x)=1; ...

  10. MellPlayer&comma; 基于网易云歌单的命令行播放器

    MellPlayer 前言 我写代码时非常喜欢听音乐,最近在网易云歌单中听到了许多入耳惊艳的歌,觉得非常不错.但是歌单的随机播放以及快速切换是个软肋,于是开发了MellPlayer,可以按照分类随机听 ...