Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 安装脚本后出现时区错误_Php_Database_Timezone_Server_Cpanel - Fatal编程技术网

Php 安装脚本后出现时区错误

Php 安装脚本后出现时区错误,php,database,timezone,server,cpanel,Php,Database,Timezone,Server,Cpanel,我收到一条错误消息---------- 如何解决此问题???解决此问题有两种方法: 在脚本顶部(或mvc框架的输入文件)使用内置函数date\u default\u timezone\u set(您所在的时区)。您可以在中找到表示位置时区的常数 在php.ini中更改配置项date.timezone=your_timezone 这两种方法的不同之处在于,方法1将立即生效,但仅在脚本的生命周期内生效,而方法2将在重新加载php配置文件后影响所有php脚本的行为。$sql='SET SESSI

我收到一条错误消息----------


如何解决此问题???

解决此问题有两种方法:

  • 在脚本顶部(或mvc框架的输入文件)使用内置函数
    date\u default\u timezone\u set(您所在的时区)
    。您可以在中找到表示位置时区的常数

  • php.ini
    中更改配置项
    date.timezone=your_timezone


  • 这两种方法的不同之处在于,方法1将立即生效,但仅在脚本的生命周期内生效,而方法2将在重新加载php配置文件后影响所有php脚本的行为。

    $sql='SET SESSION
    sql\u mode
    ='',name“utf8”,SESSION collation\u connection=“utf8\u unicode\u ci”,time\u zone=“Indian/cocoos.”date('p')) . '"';我的数据库在db_common.php文件b_common.php的公共目录中有一行:46消息:无法执行查询:未知或不正确的时区:“亚洲/加尔各答+05:30”设置会话
    sql\u模式
    =”,名称“utf8”,会话排序\u connection=“utf8\u unicode\u ci”,time\u zone=“亚洲/加尔各答+05:30”现在我从这一行中删除并放入php.ini并开始工作。
    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 /home/user/public_html/cdemo/_include/lib/lib.php on line 73
    
    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 /home/user/public_html/cdemo/_include/lib/lib.php on line 74
    
    
    
    Error: E_WARNING
    URL: http://mywebsite.com/demo/
    File: /home/user/public_html/cdemo/_include/lib/db_common.php
    Line: 69
    Message: 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.
    
    Call stack:
    
    File: /home/user/public_html/cdemo/_include/lib/db_common.php (Line: 69)
    Function: date
    
    File: /home/user/public_html/cdemo/_include/core/start.php (Line: 199)
    Class: DB_Common
    Function: connect
    
    File: /home/user/public_html/cdemo/_include/core/main_start.php (Line: 12)
    Function: include
    
    File: /home/user/public_html/cdemo/index.php (Line: 15)
    Function: include