How to configure PHP in AzureWebsites to change the default time zone of the system

Source: Internet
Author: User
: 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.