Warning: main(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\Program Files\Zend\Apache2\htdocs\php,MySql,Java examples\4\example4-23.php on line 4.
I've only gotten to Chapter 4 so far so have no experience beyond that.
This happens with several different examples and I would like to be able to correct the code so that it will work properly.
Can you help?
Help get this topic noticed by sharing it on Twitter, Facebook, or email.
I have forwarded your question on to our Book Tech staff, so they can help you find a solution. If you ever have any questions or issues with the content of a title, you can also contact them directly at email@example.com or call them at:
1-707-827-7019 (outside the USA)
7:30 am to 5:00 PST
Customer Service Representative
There are a couple of ways to solve that problem. Probably the best is to update your php.ini file to include the timezone. Open it in a text editor, and go to the date section and make it say something like this -
; Defines the default timezone used by the date functions
date.timezone = "America/Los_Angeles"
You can find all of the timezones listed here -
Another way to fix that is just to add this line to your php code file, above any date related functions in the code -
I hope that helps,
O'Reilly Book Support