简体   繁体   中英

php IIS Windows Server 2008 DateTime Internal Server Error

I'm hosting my site on a Windows Server 2008 R2. I would like to assign a new DateTime to an object property. The constructor has no params. Everytime i try i get a non specific error called "500 Internal Server Error". If i use Exceptions, it prints the error code "-3" to the page. I don't know why but a error message is not available.

I also tried this DateTime format issue without success.

Here is a sample:

$stop->Arrive_Time          = new DateTime();

The ini-file described the error:

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 ...

solution: date_default_timezone_set() in front of all DateTime constructs or objects.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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