tencent cloud


Building a WordPress Website (Windows)

Last updated: 2022-04-13 11:01:52


    WordPress is a blog platform written in PHP. This article describes how to install WordPress on Windows Server 2012.


    It's recommended that you can configure a personal blog by using a Tencent Cloud marketplace image. It may take a long time to set up the Discuz! forum manually.


    Although PHP version 5.6.20 and later and MySQL version 5.0 and later support WordPress, we recommend using PHP 7.3 and MySQL 5.6 or later versions for security reasons.

    The following software is involved in building WordPress:

    • Windows: this document uses Windows Server 2012 R2 Datacenter 64-bit as an example.
    • Web server: IIS. This document uses IIS 8.5 as an example.
    • MySQL 8.0.19 is used for database.
    • PHP is a scripting language. This article uses PHP 7.1.30.
    • WordPress is a blog platform. We use WordPress 5.9 in this article.


    Step 1. Log in to the CVM

    Log in to the Windows instance using RDP (recommended).
    You can also use other login methods that you are more comfortable with: log in to a Windows CVM instance using a remote desktop.

    Step 2. Setting up WIMP

    See Manually Building a WIPM Environment.

    1. Install IIS.
    2. Deploy PHP 5.6.20 and later versions.
    3. Install MySQL 5.6 and later versions.

    Step 3. Installing and configuring WordPress


    You can download the latest WordPress version from the official WordPress website.

    1. Download WordPress and decompress it into a directory on the CVM.
      For example, you can decompress it into C:\wordpress.

    2. Click > > MySQL 5.6 Command Line Client to open the MySQL command line client.

    3. Run the following commands on the MySQL command line client to create a database for WordPress.
      For example, create a database named wordpress.

      create database wordpress;
    4. Find wp-config-sample.php under C:\wordpress and rename it to wp-config.php.

    5. Open the wp-config.php file with a text editor, and modify the relevant configuration information according to Step 3: Installing and configuring WordPress as shown below:

    6. Save wp-config.php.

    7. Click to open Server Manager.

    8. On the left sidebar, select IIS. Click the name of the server in the Server column to the right. Select Internet Information Services (IIS) Manager. The Internet Information Services (IIS) Manager window appears.

    9. In the Internet Information Service (IIS) Manager window, expand your server on the left sidebar and click your website. The website management page appears, as shown below:

    10. Delete websites bound to port 80.
      You can change the port to another unused port, such as 8080.

    11. In the Actions column on the right, click Add Website.

    12. In the pop-up window, enter the following information and click OK.

      • Website name: name of the website, such as wordpress.
      • Application pool: select DefaultAppPool.
      • Physical path: the directory that contains WordPress, such as C:\wordpress.
    13. Find php.ini under the directory that contains PHP. Open it with a text editor and make the following changes:

      1. Changes are different for different PHP versions.
        • For PHP 5.x, find extension=php_mysql.dll and delete the ; at the beginning.
        • For PHP 7.x, find extension=php_mysqli.dll or extension=mysqli and delete the ; at the beginning.
      2. Find extension_dir= "ext" and delete the ; at the beginning.
    14. Save the php.ini file.

    Step 4. Verifying the WordPress Configuration

    1. Open a browser window on your local machine and visit http://localhost/wp-admin/install.php. The WordPress installation page appears.
    2. Enter the installation information as described in the following table based on the WordPress installation wizard and click Install WordPress.
      Required InformationDescription
      Website NameName of the WordPress site.
      UsernameAccount name of the WordPress administrator. For security reasons, use a name other than `admin`.
      PasswordUse a strong password, different than your current password. Store it in a secure location.
      EmailEmail address used to receive notifications
      Now, you can log in to your WordPress website and post blogs.


    If you encounter a problem when using CVM, refer to the following documents for troubleshooting:

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support