Install WordPress on Azure Windows Server 2016 VM with IIS 10 and MySQL
I have an Azure Windows Server 2016 VM with IIS 10 and MySQL. The VM comes with 2 VCPU and 4GB. It has been working properly to host my website developed with Asp.Net 4.5 and MySQL for a few years. I am thinking about moving my WordPress website to this server as well.
Step 1: Install and configure PHP on IIS 8 in Windows 8
On Windows Server 2016, the Web Platform Installer installed following the above instructions does not show on the program files. It has to be manually started from the following folder.
C:\Program Files\Microsoft\Web Platform Installer
With Web Platform Installer, the PHP installation is quite easy.
<?php// Show all information, defaults to INFO_ALL
phpinfo();?>
Save the above file to c:\interpub\wwwroot. Try to load the file in the browser with the following URL:
http://localhost/infor.php
Unfortunately, the test run of info.php as suggested in the instruction failed as following.
To find out the reason for the above error, go to the folder of Php and double click the php.exe. It turns out that vcruntime14.0 is missing.
In order to find out the required VC++ runtime version for the PHP installed on the VM, you can run the command PHP -v in the folder where PHP is installed.
So for PHP v7.4, the VC runtime version is 14.16, which is VC2019. It can be downloaded from the following link:
After installing the Microsoft Visual C++ Redistributable for Visual Studio 2019, the info.php is loaded in the browser without any issue
Step 2: Install WordPress
It is very convenient to install WordPress with the web platform installer. However, on my VM, the MYSQL version is 8.0.12, which is not recognized by the Web Platform Installer. Therefore, I just downloaded the WordPress from https://wordpress.org/download/#download-install
After download, the zip file is unzipped and copied to the c:\intpub\wwwroot\wordpress folder.
A few things to note.
1. Increase the memory of the WordPress site following this article resolved the blank page issue of the WordPress site: https://www.wpbeginner.com/wp-tutorials/fix-wordpress-memory-exhausted-error-increase-php-memory/
2. Enable pretty URL for WordPress following this article: https://www.credera.com/insights/joy-pretty-permalinks-make-work-iis-hosted-wordpress/
Comments
Post a Comment