In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what is the method for centos to modify php time". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's way of thinking to study and learn "what is the method for centos to modify php time".
1, modify the hardware time zone; 2, modify the system time zone; 3, modify the time zone setting of php.ini; 4, synchronize the time through crontab.
Problem: the customer's US server time is incorrect.
The first step is to modify the hardware time zone.
Vim / etc/sysconfig/clock comments ZONE= "America/New_York" with 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
Step 4, write a crontab to synchronize the time (in special cases, add this)
# Ansible: Time synchronization00 01 * / usr/sbin/ntpdate 0.centos.pool.ntp.org > / dev/null
How to set the synchronization time for each boot
Vim / etc/rc.local usr/sbin/ntpdate 0.centos.pool.ntp.org > / dev/null
The above is to set the time zone and time of centos6.5, and the following is that of centos7
Yum-y install ntpsystemctl enable ntpdntpdate-u cn.pool.ntp.orgsystemctl start ntpd# set time zone timedatectl set-timezone Asia/Shanghai thank you for reading, the above is "what is the method of centos modifying php time", after the study of this article, I believe you have a deeper understanding of what is the method of centos to modify php time, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.