php – Stop Warning:date()[function.date]:从本地主机

前端之家收集整理的这篇文章主要介绍了php – Stop Warning:date()[function.date]:从本地主机前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Warning: 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 …………

有许多Web应用程序弹出这个特定的错误.我可以设置

date_default_timezone_set('America/Los_Angeles');

但这不是我正在寻找的解决方案.

我可以从系统级别做一些事情.它只发生在LOCALHOST而不是实际的生产服务器上.

PHP.ini中的默认设置是date.timezone = America / Los_Angeles

[更新]编辑PHP.ini

Warning: PHPinfo() [function.PHPinfo]: 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

在一个服务器而不是另一个服务器上发生的原因是PHP.ini设置 date.timezone=.

你仍然需要选择一个实际的价值.你确实没有一个.或者错误PHP.ini版本(有一个用于CLI,一个用于mod_PHP).

原文链接:https://www.f2er.com/php/139587.html

猜你在找的PHP相关文章