Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set the php time zone for linux server

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how the linux server sets the php time zone. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Setting method: 1, open the "/ etc/sysconfig/clock" file, change the value of the "ZONE" item to "Asia/Shanghai"; 2, execute the command to modify the system time zone; 3, open the "php.ini" file, and change the value of the "date.timezone" item to "PRC".

The operating environment of this tutorial: CentOS 6.5 system, PHP7.1 version, Dell G3 computer.

Modify linux time zone time and php time zone

The first step is to modify the hardware time zone.

Vim / etc/sysconfig/clock

Comment ZONE= "America/New_York" and add an extra line ZONE= "Asia/Shanghai"

Second, modify the system time zone

Cp / etc/localtime / etc/localtime.bakrm-rf / etc/localtimeln-svf / usr/share/zoneinfo/Asia/Shanghai / etc/localtimeyum install ntpdate-yntpdate 0.centos.pool.ntp.orgdateclock-w # write the current Linux time to BIOS! Clock-r # check the time in BIOS

The third step is to modify the time zone setting of php.ini

Date.timezone = PRC

After setting up, it is best to restart the system.

Thank you for reading! This is the end of the article on "how to set the php time zone on the linux server". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report