: This article describes how to configure PHP in AzureWebsites to change the default time zone of the system. if you are interested in the PHP Tutorial, refer to it. Azure Website provides us with a highly scalable Website deployment platform. Because Website is a service on the PaaS (platform as a Service) layer, some configuration methods are different from the traditional ones when you migrate the original PHP Website to Azure Websites. For example, in Azure Websites, we cannot access the server running the PHP engine or the php. ini file.
In the running environment provided by Azure websites, the default time zone is UTC time. For customers in China, we often want to get the GMT + 8 time zone through the date object. At this time, we need to create the. user. ini file under the root directory of the PHP application, and specify in it:
Date. timezone = Asia/Chongqing
Note: after adding the. user. ini file, restart Azure Websites.
In this way, if our PHP source code is as follows:
PHP Demo page
The above code will get the following page output:
In addition:
In general, the configuration information in the php. ini file can be modified in the application scope through the. user. ini file as long as it is not a System-level configuration item. Here (http://php.net/manual/en/ini.list.php) is the configuration item list and role level for php. ini.
The above describes how to configure PHP in Azure Websites to change the default time zone of the system, including some content, and hope to help those who are interested in the PHP Tutorial.