How to Change Default Timezone in php.ini (custom php)

You can change your hosting account time zone for PHP applications through custom php.ini under your hosting account. You can place custom php.ini under root directory of your php application (for PHP 5.3 or latest versions). Please follow below instructions to edit / update .htaccess file to change DNS Zone:

 Update timezone in custom php.ini file using File Manager (cPanel hosting account)

  • Logon to your cPanel acccount >> File Manager
  •  if you not able to see php.ini file, please click on Settings in File Manager and Select ‘Show Hidden Files’. Save it.
  • Select .htacccess file and click on Edit button
  • If there is no php.ini file listed, click on new file button in File Manager
  • Type below lines and click on save button to save changes:

                  #Set default time zone for PHP

        date.timezone = “US/Central”

  • 4: All is done.

You can see list of supported time zones here: http://www.php.net/manual/en/timezones.php

How to change timezone in php through ssh / command shell

  • If you have access to SSH, please logon to your server with cPanel account
  • Edit .htacccess with your favorite shell editor , like nano or vi and save changes

nano /home/yourcpaccount/public_html/php.ini

  • 0 Users Found This Useful
Was this answer helpful?
Related Articles
Copyright © 2024 Temok Technologies. All Rights Reserved.
Positive SSL