On servers running Plesk with LiteSpeed, PHP is configured to run as a FastCGI application for web requests. This is required for LiteSpeed compatibility, but it can cause a mismatch between the timezone used by your web application and the timezone used by PHP when running scheduled cron tasks.
This guide explains why the mismatch happens and how to fix it.
Why Does This Happen?
LiteSpeed requires PHP to run as FastCGI for web traffic. The timezone for web requests is controlled by your domain's PHP settings in Plesk. However, scheduled tasks that use the Run a PHP script task type may use a different PHP configuration that doesn't inherit your domain's timezone setting.
If your server's system timezone is set correctly (e.g. Australia/Perth) but PHP CLI reports UTC, your cron jobs will run with the wrong timezone. This can cause issues such as:
- Scheduled tasks flagging as missed because they ran at the wrong local time
- Emails or invoices generating at unexpected times
- Log timestamps appearing in UTC instead of your local time
You can check what timezone PHP CLI is using by running the following command via SSH:
/opt/plesk/php/8.3/bin/php -r "echo date_default_timezone_get();"
If this returns UTC instead of your expected timezone, use one of the options below to fix it.
Note: Changing the timezone for cron jobs does not affect your website or LiteSpeed. Web requests use the FastCGI PHP handler, which reads its own separate configuration. These are completely independent.
Option 1 — Set Timezone per Cron Task (Recommended)
This is the safest and most targeted approach. It sets the timezone for a specific scheduled task only, without affecting any other tasks or customers on the server.
- In Plesk, go to Domains > your domain > Scheduled Tasks
- Click the scheduled task you'd like to edit
- Add the following to the arguments field: -d date.timezone=Australia/Perth
- Click OK to save
For tasks that already have arguments (e.g. WHMCS sub-tasks), append the timezone flag after the existing arguments:
- Main cron: -d date.timezone=Australia/Perth
- Ticket Escalations: do --TicketEscalations -d date.timezone=Australia/Perth
- Email Campaigns: do --EmailCampaigns -d date.timezone=Australia/Perth
- Cancellation Requests: do --CancellationRequests -d date.timezone=Australia/Perth
Option 2 — Set Timezone in Domain PHP Additional Directives
You can add a timezone directive through the Plesk domain PHP settings.
- In Plesk, go to Domains > your domain > PHP Settings
- Scroll down to the Additional directives section at the bottom of the page
- Add the following line: date.timezone=Australia/Perth
- Click OK or Apply to save
Important: The Additional Directives setting primarily applies to web (FastCGI) requests and may not apply to PHP CLI cron tasks depending on your server configuration. If your cron jobs continue to use the wrong timezone after applying this setting, use Option 1 or Option 3 instead.
Option 3 — Set Timezone via a Drop-in CLI ini File (Advanced)
This option sets the timezone for all PHP CLI cron jobs running under a specific PHP version on the server. It's suitable if you're the server administrator and want a consistent default for all CLI tasks.
Note: This option requires root SSH access and affects all customers' CLI cron jobs running under the specified PHP version. Make sure all customers on the server are in the same timezone before applying this globally.
- Create a drop-in ini file by running the following command via SSH: echo "date.timezone=Australia/Perth" > /opt/plesk/php/8.3/etc/php.d/timezone.ini
- Verify the change by running: /opt/plesk/php/8.3/bin/php -r "echo date_default_timezone_get();"
This should now return your configured timezone instead of UTC. Repeat for other PHP versions if needed (e.g. 8.1, 8.2).
Australian Timezone Reference
For reference, valid PHP timezone strings for Australian states and territories are:
- Western Australia: Australia/Perth
- Northern Territory: Australia/Darwin
- South Australia: Australia/Adelaide
- Queensland: Australia/Brisbane
- New South Wales / ACT / Victoria / Tasmania: Australia/Sydney
For a full list of valid timezone strings, refer to the PHP documentation.
Which Option Should I Use?
- Option 1 — Most targeted fix, recommended for most users
- Option 2 — Worth trying but may not apply to CLI cron jobs
- Option 3 — Server-wide fix, requires root SSH access and affects all customers
If you continue to experience timezone issues after applying these changes, please contact our support team at [email protected].