How to Set Time Zone on Ubuntu 16.04 Apache Server

Here we’ll cover how to set the default time zone on your Ubuntu 16.04 Apache Server.

First, open your php.ini file (found within the /etc/ directory) in a plain text editor, your file path could vary but here are a couple of example of possible file paths:


Find the following line in the php.ini file. If there’s a semi-colon at the start of this line then remove the semi-colon to uncomment this.

date.timezone =

Set date.timezone equal to your continent and main city, a list of all available time zones can be found at

For Example:

date.timezone = Europe/London

Save your php.ini file and then restart Apache using the following command in terminal:

service apache2 restart

Leave a Reply

Your email address will not be published. Required fields are marked *

18 − ten =