小编use*_*427的帖子

php date.timezone仅对命令行脚本无法正常工作

我在php.ini文件中有这个条目:

date.timezone = 'Europe/London';
Run Code Online (Sandbox Code Playgroud)

但每次我在命令行脚本中使用DateTime()时,我仍然会收到以下错误:

Exception: DateTime::__construct(): 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 'Europe/London' for 'BST/1.0/DST' instead
Run Code Online (Sandbox Code Playgroud)

因此,我必须在任何脚本中执行以下操作才能使其工作:

date_default_timezone_set('Europe/London');
Run Code Online (Sandbox Code Playgroud)

还有什么可能导致此错误?

UPDATE

我在命令行和Web浏览器中使用了以下内容:

<?php

var_dump(ini_get('date.timezone'));
exit;
Run Code Online (Sandbox Code Playgroud)

在命令行中我得到:

string(0) ""
Run Code Online (Sandbox Code Playgroud)

在网络浏览器中,我得到:

string(13) "Europe/London" 
Run Code Online (Sandbox Code Playgroud)

php

9
推荐指数
1
解决办法
1万
查看次数

检查配置XML树magento生成

正如标题所暗示的,我想检查Magento生成的完整配置XML树.

我查看了配置对象,看不到这样做的方法.

如何才能做到这一点?

magento

5
推荐指数
1
解决办法
2768
查看次数

标签 统计

magento ×1

php ×1