[英]PHP and Windows 7 error reporting
我已经在Windows 7和IIS上安装了php 5.3.0,并为CGI配置了它
我喜欢在
http://www.hauser-wenz.de/s9y/index.php?/archives/280-Installing-PHP-on-Windows-7.html
它真的很简单,并且可以正常工作(感谢上传此文件的人)
php运行正常,但是问题是,脚本中有任何错误而不是正常的PHP错误(如页面名称,行号等)报告错误时,它会给出以下错误
PHP Warning: Unknown: 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 '..../....' for '4.0/no
DST”改为在第4行的C:\\ inetpub \\ wwwroot \\ test.php中
它不是时区错误。 甚至我禁用了Internet Explorer“显示友好的HTTP错误”
例如,如果我写这个简单的PHP脚本
<?php
echo("hello");
?>
这有效,如果我这样写
<?php
echo("hello);
?>
它给出与上述相同的错误。
感谢您的帮助。
您收到的错误是由时区设置引起的。 您可能在php.ini中将其设置为错误,或者根本没有设置。
如错误所示,您可以使用date_default_timezone_set
进行修复
例如
date_default_timezone_set('Europe/Helsinki');
可用时区的列表可以在php的手册中找到。 虽然据我所知,除非您尝试使用与日期相关的功能之一,否则不会出现该错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.