Tips & Tricks

How to change PHP time zone on cPanel or Linux servers

change PHP time zone
change PHP time zone

How to change PHP time zone on cPanel or Linux servers

This post explains how to change PHP time zone on cPanel or Linux servers.

First you need to open the the php.ini file. You can find the loaded configuration file by running following command.

 
php --ini

Once you found the file, please open it using vi, vim or nano editor.

 
vim /usr/local/lib/php.ini

and add the following code to your php.ini file.

 
date.timezone = "Asia/Kolkata"

You can change “Asia/Kolkata” with the desired time zone. The list of supported timezones can be found¬†Here

Restart Apache

 
service httpd restart

You can verify the configuration change by placing a phpinfo.php page on your website.

That’s it!

If you like this post and wish to receive more articles from us, please like our FB page: Grepitout

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at info@grepitout.com