Method: First execute the "find / -name php.ini" command to find the "php.ini" file; then open the file, find and modify the value of the "date.timezone" item; finally execute "service httpd restart ” command to restart the service.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
Find the php.ini configuration file
find / -name php.ini
Find the date.timezone option and change it to:
date.timezone =PRC
Restart the service
service httpd restart
Single page settings
date_default_timezone_set('PRC')
Recommended: "2021 PHP Summary of interview questions (collection)》《php video tutorial》
The above is the detailed content of How to modify php time settings in centos. For more information, please follow other related articles on the PHP Chinese website!