php system time under Linux is inconsistent with the current time

Problem Description

Before doing the project, enter php time () timestamp, always slow more than twenty minutes, that is a problem area when php configuration file, try the following solutions after throwing no work:

1, modify the php configuration file:date.timezone ="PRC"

2, the code was added:date_default_timezone_set('PRC')

Above programs are not feasible! Php guess it's not a problem, and began to consider a server problem.

solution

Taking into account the server is Hong Kong server, Linux system guess is the problem of time, the need for automatic calibration system time

sudo ntpdate cn.pool.ntp.org
Published 328 original articles · won praise 110 · views 470 000 +

Guess you like

Origin blog.csdn.net/qq_42249896/article/details/103766975