Home > Backend Development > PHP Tutorial > php.ini中时区设置不成功解决方法

php.ini中时区设置不成功解决方法

WBOY
Release: 2016-06-23 13:27:35
Original
1023 people have browsed it

写项目时用到当前时间,用time()获取到的时间戳经过date()函数转化的时间与当时时间差了6个小时,修改php.ini文件,如下:

发现并没有成功修改时间,最后打开httpd-conf,修改phptimezone,如下:

结果就可以了,原来只在php.ini中修改是没用的,要在apache的配置文件中修改才行。

最后查看phpinfo,看到defaulttimezone一项是PRC才算可以了。


版权声明:本文为博主原创文章,未经博主允许不得转载。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template