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

本文介绍了如何解决PHP中出现的时间区域警告问题,提供了两种方法:一是临时修改安装脚本;二是永久更改PHP配置文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Warning: date_default_timezone_get(): 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 'Asia/Hong_Kong' for 'HKT/8.0/no DST' instead in D: ootpms.ccshopuploadinstallincludeslib_installer.php on line 223

很明显是由于PHP默认的时间区域设置问题导致的警告,本来也没什么,不过这个警告最后还是给我带来了麻烦,主要是数据库那段过不去,不得已,只有自己动手修改了,这里有两种办法供大家参考:

1. 修改installincludeslib_installer.php文件。在这个文件顶部<?php之内加上如下PHP代码:

date_default_timezone_set ('Asia/Shanghai');


这是个临时的解决办法,可以帮你成功安装数据库,长久之计还是要看方法2。

2. 修改PHP配置文件。如果你服务器的主要时区是亚洲上海,那么修改这里是比较妥当的,当然更稳妥的办法是通过.htaccess导入PHP设置。

打开PHP.INI大概在1019 【具体的行数,根据配置版本不一样】找到; date.timezone =去掉前面的注释;号,然后改成date.timezone =Asia/Shanghai,保存配置文件,重启你的服务器。

好的,这个问题也就这样很好的解决了。


该文章转载自http://www.pms.cc/operations/201307/date_default_timezone_get.html

Starting >>> calibration_manager --- stderr: calibration_manager CMake Deprecation Warning at CMakeLists.txt:11 (cmake_policy): The OLD behavior for policy CMP0072 will be removed from a future version of CMake. The cmake-policies(7) manual explains that the OLD behaviors of all policies are deprecated and that a policy should be set to OLD only under specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD. ** WARNING ** io features related to pcap will be disabled ** WARNING ** io features related to png will be disabled /usr/bin/ld: warning: libopencv_highgui.so.4.5d, needed by /home/lh/business_logic_modules/src/component_packages/calibration_manager/../../../mobile_robot_platform/ros2_ws/install/calibration_cameraimu/lib/calibration_cameraimu/libcalibration_cameraimu.so, may conflict with libopencv_highgui.so.3.4 /usr/bin/ld: warning: libopencv_video.so.4.5d, needed by /home/lh/business_logic_modules/src/component_packages/calibration_manager/../../../mobile_robot_platform/ros2_ws/install/calibration_cameraimu/lib/calibration_cameraimu/libcalibration_cameraimu.so, may conflict with libopencv_video.so.3.4 /usr/bin/ld: warning: libopencv_calib3d.so.4.5d, needed by /home/lh/business_logic_modules/src/component_packages/calibration_manager/../../../mobile_robot_platform/ros2_ws/install/calibration_cameraimu/lib/calibration_cameraimu/libcalibration_cameraimu.so, may conflict with libopencv_calib3d.so.3.4 /usr/bin/ld: /home/lh/business_logic_modules/src/component_packages/calibration_manager/../../../mobile_robot_platform/ros2_ws/install/calibration_cameraimu/lib/calibration_cameraimu/libcalibration_cameraimu.so: undefined reference to `KeyFrameDatabase::KeyFrameDatabase()' collect2: error: ld returned 1 exit status gmake[2]: *** [CMakeFiles/calibration_manager_node.dir/build.make:333:calibration_manager_node] 错误 1 gmake[1]: *** [CMakeFiles/Makefile2:137:CMakeFiles/calibration_manager_node.dir/all] 错误 2 gmake: *** [Makefile:146:all] 错误 2 ---
最新发布
07-04
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值