Hi all,
Just wanted to share at tip on removing the date_default_timezone_get() error, on a server running Mac OS X Server (or normal Mac OS X for that matter)
It’s probably the same on most other Unix and Linux boxes, but as OS X Server is usually so easy to set up and maintain, it can be confusing to some, to figure out where and what to edit, to remove this error.
In short, you need to edit the php.ini file located in /etc/ witch normally is a hidden folder. Here’s how:
1: Log on to your OS X server and open Terminal.app located in Utilities
2: Type:
sudo cp php.ini php.ini.bak01...and hit Enter. This makes a backup of the file, called php.ini.bak01, so you can get back in case anything goes wrong.
3: Type:
open /etc...and hit Enter.
This opens the etc folder in Finder. Locate the php.ini file, and open it in a real text-editor, not Word or Pages or apps like that! By “real” i mean apps that are designed for raw text-editing, and not word processing or page-layout.
I recommend the free TextWrangler from BareBones, if you have no editor installed already. You can also use BBEdit, Coda, TextMate or the like.
4: Open php.ini in your editor, for example by dragging it to the editors icon in the Dock.
5: Do a search for [Date] and find these lines:
[Date]
; Defines the default timezone used by the date functions
; <a href="http://php.net/date.timezone">http://php.net/date.timezone</a>
; date.timezone =
6: Edit the last line, so you remove the semi-colon in front of it (this un-comments the line, making it active) and so you include your local timezone, like so:
[Date]
; Defines the default timezone used by the date functions
; <a href="http://php.net/date.timezone">http://php.net/date.timezone</a>
date.timezone = "Europe/Copenhagen"7: Replace Europe/Copenhagen with your own timezone, and then save the file. Enter your password if/when the text editor asks you. You need to authenticate, because the php.ini file is in a directory that needs authentication. Make sure you save the file as php.ini and not as a new file with another filename.
8: Open Server Admin and stop and then start the Web service. This causes php.ini to be reloaded, so the change you made takes effect.
You can now access your EE control panel under OS X Server without errors 😊
Cheers,
Thomas
PS: There are other ways of doing this, for example by SSH’ing into the OS X Server box, and then using the vi editor to edit the file. My way above makes use of as many “normal” apps and folders as possible, so the most people will be able to follow along - so it can perhaps be done easier or more “nerd-like” but this is the simplest for less experienced users 😊