簡體   English   中英

PHP和Windows 7錯誤報告

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM