Awhile ago, I wrote a guide for manually installing PHP on Windows Server 2016, well I tested out that guide but used Server 2019 as the OS.

The Guide remains unchanged, so all I have done is fixed a few grammatical errors and reposted under the new title.

Installing PHP 7 on IIS Server 2019

This guide will take you through installing PHP7 on Server 2016. ​​ This is what works for me after following many guides, so I thought I would write my own. PHP is required for many of the Open Source​​ blogging apps or CMS Packages out there, but can be a bit fiddly to install.

I have had success using the IIS web platform components installer, but lately some requirements get left behind and things don’t work, so this is a quick and dirty manual guide.

So what’s needed, hop over to​​ http://windows.php.net​​ and pick up the latest version of PHP which at the time of writing is 7.1. I have used the VC14 x64 Non-Thread Safe version, which is recommended for use on Windows IIS.

Also required is the Visual C++ Redistributables for visual Studio, PHP based on VC14 requires the redistributables indicated below.

When PHP and the VC Redist package is downloaded Install the VC_Redistx64.exe, create a folder in the C drive called PHP7, and extract the downloaded PHP zip file to the folder. Open the PHP7 folder and copy the php.ini-development file and save it as php.ini. Open this file and make the following changes;

Further down the php.ini file we need to “un” comment loadable module that php requires to function

Un comment out following lines under Dynamic Extensions; then save the file. These are the minimum required if using a CMS with MySQL.

Add PHP to the Environment Variable Path statement

Click Environment Variables…

Select Path and then Edit…Select New, this allows you to input a new​​ “path variable” into the path, Type C:\PHP7If desired you can move the new entry up the list. This will put it closer to the start of the Path variable, but is not necessary.​​

Click OK, OK, OK. ​​ Restart the server

A quick check that things are on​​ track can be achieved by opening PowerShell and and typing php –info

If you get a screen full of output, like below, then things are looking good

Install IIS

Install IIS ensuring the CGI option is selected​​

Some features may need the Server OS DVD in​​ the drive or the ISO mounted if doing this in a Virtual Machine as an alternate source path is needed to be specified for some features. The scrip​​ here​​ will install all the features and roles​​ BUT, assumes your CD/DVD is Z:\ and that you have either, a second partition on your drive labelled as D:\ or a second drive installed, labelled as D:\ ​​ Edit the script as necessary. Some things the script does is to create a new Inetpub\wwwroot folder on D:\ and copies all the c:\inetpub\wwwroot data to the new folder then deletes the C:\inetpub\wwwroot. IF you don’t have a second drive or partition configured parts of the script will fail.

Add a Module Mapping

Once IIS is installed, open up IIS Manager and open the Handler Mappings.

Double click Handler Mappings

On the right hand side menu, select Add Module Mapping

Fill in the required information

Select Request Restrictions…

Ensure the following selections are as shown

On​​ the Mapping Tab

On the Verbs Tab

On the Access Tab

Click OK, OK

When presented with the CGI application notification

Click Yes

Restart the Server

When the server is back up and running, create a text file with the following

<?phpphpinfo();?>

Save this file in the Inetpub\wwwroot folder as Index.php ensure there is no .TXT extension. When saving the file as shown

Add Index.php top the IIS Default Document list.

Open IIS Manager, select the Server, and then select Default Document

Double click Default Document

​​ Click Add…In the Add Default Document type Index.php, click OK

The new default document will appear in the list of documents.

Now it’s time to test our install. Open a web browser and go to​​ http://localhost/​​ all being well you should be presented with the php configuration output

I was playing around one night on the computer with some large video files and things were taking a bit of time. Being large and working off a mechanical HDD, I remembered back to the days when you could use the old DOS RAMDrive.sys to create a RAM drive using system memory.

This led me to search the interwebs for a tool that would allow this in windows 10. That’s when I found ImDisk ToolKit. ImDisk Tool kit, loads a driver that lets you create a RAM drive.

I wont go into specifics because I think once you run the app to create a ram drive, it will be fairly self explanitory.

This tool will let you mount image files of hard drive, cd-rom or floppy, and create one or several ramdisks with various parameters.

This all-in-one package includes the ImDisk Virtual Disk Driver (2.0.9), the DiscUtils library that extends the number of supported image file formats, and adds several GUIs and features.

Here is another good free Password Generator suggested by a reader of my site. Thanks Kaylee. 🙂

Use the this free Password Generator to create highly secure passwords that are difficult to crack or guess. Just select the criteria for the passwords you need, and click “Generate Password(s)”. Remember, the more options you choose, the more secure the passwords will be.

If this PMagic_2016_03_02.iso is not the one used, changes must be made to the section of the tools menu that loads the ISO.

This line INITRD LINUX/PMagic/pmagic_2016_03_02.iso​​ in the tools.menu must be edited to reflect the ISO used

Setting up the PMagic folder.

Drill down to the RemoteInstall\boot\x64 folder, and we should already have a sub folder called Linux where we set up Ubuntu and Centos. Make a folder called PMagic and extract the downloaded PMagic_2016_03_02.iso. Also place a copy of the ISO in this folder as shown

The PMagic Folder under Linux

Contents of the PMagic Folder

NOTE:​​ Prior​​ to booting up into Parted Magic, we need to edit the Syslinux.cfg located in the PMagic\boot folder. Open in notepad and replace vmalloc=512Mib with vmalloc=600MiB. I just did all instances.

The first time I booted into PMagic I was presented with an error along the lines of Increase vmalloc in the syslinux.cfg to​​ equal​​ the ISO size plus 32MiB. 600MiB is a nice round figure

From the previous post on deploying Linux from WDS, we should have 2 files in the RemoteInstall\boot\x64\pxelinux.cfg folder. The default file and the tools.menu

When the client PC or VM is PXE booted we are presented with the new Boot menu as previously configured.​​

Selecting =DISK TOOLS= gives us the Disk Tools Menu

From here we can select Part’d Magic Full ISO tool.

Selecting​​ Part’d Magic Full ISO will start the process of booting the ISO to a​​ live​​ environment