Marius van Witzenburg We fight for our survival, we fight!

14Jun/110

How to set the timezone in FreeBSD without the use of sysinstall

Posted by mariusvw

Usually you want your timezone to be set to your local time instead of the UTC time.

If you don't know which file to use, first find them all and look around:

find /usr/share/zoneinfo/ -type f

When you found your timezone you must copy the file to the right location to use it, you can do this with the following command:

cp /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
chmod 444 /etc/localtime

Now when you check the current time with the command date you will notice that the zone has changed:

matrix# date
Tue Aug  3 20:15:46 CEST 2010

Since I install most servers in this timezone its faster for me to set the timezone with simply copying the zoneinfo file instead of running sysinstall.

9Jun/110

E_STRICT crashes php if date.timezone is not set in php.ini

Posted by mariusvw

In case you use the following in your php.ini:

error_reporting = E_ALL | E_STRICT

You might notice that if you do a phpinfo() that php crashes the apache child.

Reason is a bug in php that causes an infinite loop.

You can solve this by setting "date.timezone =" to your timezone.

You can also set this in your script with ini_set() but I would go for the php.ini since thats a more permanent solution.

For a list of timezones check:
http://www.php.net/datetime