简体   繁体   English

PHP和Windows 7错误报告

[英]PHP and Windows 7 error reporting

i have installed php 5.3.0 on windows 7 & IIS and i configure it for CGI 我已经在Windows 7和IIS上安装了php 5.3.0,并为CGI配置了它

i fond a great article at 我喜欢在

 http://www.hauser-wenz.de/s9y/index.php?/archives/280-Installing-PHP-on-Windows-7.html

its really easy and it works (thanks who have uploaded this) 它真的很简单,并且可以正常工作(感谢上传此文件的人)

php run fine, but problem is when there is any error in script instead of getting error reporting (like page name, line no etc) as normal PHP errors it gives following error 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' instead in C:\\inetpub\\wwwroot\\test.php on line 4 DST”改为在第4行的C:\\ inetpub \\ wwwroot \\ test.php中

its not time zone error. 它不是时区错误。 even i disable the internet explorer "show Friendly HTTP errors" 甚至我禁用了Internet Explorer“显示友好的HTTP错误”

for example if i write this simple php script 例如,如果我写这个简单的PHP脚本

   <?php
   echo("hello");
  ?>

this works and if i write like this 这有效,如果我这样写

   <?php
   echo("hello);
  ?>

it give same error as mention above. 它给出与上述相同的错误。

Thanks for helping. 感谢您的帮助。

The error you're getting is caused by the timezone setting. 您收到的错误是由时区设置引起的。 You've probably set it wrong in the php.ini, or haven't set it at all. 您可能在php.ini中将其设置为错误,或者根本没有设置。

As the error suggests, you can fix it with date_default_timezone_set 如错误所示,您可以使用date_default_timezone_set进行修复

For example 例如

date_default_timezone_set('Europe/Helsinki');

The list of available timezones can be found at php's manual . 可用时区的列表可以在php的手册中找到。 Though as far as I know, the error should not appear unless you attempt to use one of the date-related functions. 虽然据我所知,除非您尝试使用与日期相关的功能之一,否则不会出现该错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM