1 / 4

How to Change Default Timezone in Apache

Default timezone in Apache/PHP is set to UTC time. Here is how to change default timezone in Apache/PHP. #apache #php<br><br>Visit https://ubiq.co/tech-blog/how-to-change-default-timezone-in-apache-php/

Download Presentation

How to Change Default Timezone in Apache

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to Change Default Timezone in Apache/PHP

  2. Change default timezone using .htaccess file Open .htaccess file, typically located at /var/www/html/.htaccess $ sudo vi /var/www/html/.htaccess Add the following line to set environment variable TZ (for timezone) in Apache web server to Eastern Time zone in US. SetEnv TZ America/New_York Restart Apache Server to apply changes. $ sudo service apache2 restart

  3. Change default timezone using php.ini Open php.ini, typically at /etc/php.ini $ sudo vi /etc/php.ini Uncomment/Add the following lines to set default timezone in PHP. ;[Date] ;date.timezone = UTC Change them to the following, to set default time to Eastern timezone. [ Date] date.timezone = America/New_York Restart Apache Server to apply changes. $ sudo service apache2 restart

  4. Thank You Visit for details https://ubiq.co/tech-blog/how-to-change-default-timezone-in-apache-php/

More Related