Need help? Call us on 1300 789 260

Set PHP Timezone for a Website

Difficulty: Intermediate

Prerequisites

  • Plesk / Conetix Control Panel login details

Overview

Most PHP applications (eg WordPress) set the required date/time within the application, so that it's a user configurable option. Prior to PHP 5.4, PHP would default to the server timezone, however PHP 5.4 upwards now default to UTC if no timezone is set. Ideally, these applications should be updated to contain the timezone via the date_default_timezone_set function.

If the application cannot be updated, you can set a default timezone per site within Plesk as detailed below.

Instructions

  1. Login to Plesk or the Conetix Control panel, then select the domain you need to set the PHP timezone for.
  2. Select PHP Settings :
    PHP Timezone - PHP Settings
  3. At the bottom of the page,  add the following line into the Additional directives section:
    date.timezone = "Australia/Sydney"

    A full list of timezones can be found here: PHP Timezones . Your configuration should look like this:
    PHP Timezone- Additional Directives

  4. Click Apply to save the settings.

  5. Scroll to the top of the PHP Settings page, then select View the phpinfo() page:
    PHP Timezone - PHP Info Page

  6. This will open a page displaying all of the configured PHP information. Scroll down to the date section to verify that the timezone has been updated:
    PHP Timezone - PHP Info - Date
  7. You can now click OK on the PHP Settings page to finalise the settings.
Was this article helpful? Yes No
👥

Having trouble? We’re here to help!

We’ve built our company with a serious focus on quality service. Feel free to give us a call!

1300 789 260