2013-03-27 58 views
0

我在Windows Server 2008 R2上託管我的網站。我想爲對象屬性分配一個新的DateTime。構造函數沒有參數。每當我嘗試我得到一個非特定的錯誤,稱爲「500內部服務器錯誤」。如果我使用例外,它將錯誤代碼「-3」打印到頁面上。我不知道爲什麼,但錯誤消息不可用。php IIS Windows Server 2008日期時間內部服務器錯誤

我也試過這個DateTime format issue沒有成功。

下面是一個示例:在所有的DateTime構建體或對象的前面date_default_timezone_set()

$stop->Arrive_Time   = new DateTime(); 
+0

那麼,你需要啓用錯誤報告或找到服務器的日誌。 – 2013-03-27 17:30:04

回答

1

的ini文件描述的錯誤:

PHP Fatal error: Uncaught exception 'Exception' with message '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/Paris' for '1.0/no DST' instead' in ...

溶液。