IIS + PHP Minor Version Upgrade W/O Web Platform Installer

I have spent way too long trying to figure this out.

On a Windows Server with IIS, most people would recommend using the Web Platfrom Installer (WebPI), however only certain specific versions are available. If say you wanted to upgrade from PHP 7.4.13 to latest 7.4.27 WebPI can’t do it. You have to do it manually.

TLDR: Download the new version, compare the php.ini files and swap the directories over.

Instructions

Grab the version of PHP that you are after from PHP directly – https://windows.php.net/download#php-7.4 (you will want the Non-Thread-Safe version).

Make note of and install any dependencies like Microsoft C++ Redist (here – https://aka.ms/vs/16/release/VC_redist.x64.exe)

Locate your current PHP installation Directory. For me (since I installed PHP originally from WebPI, it was C:\Program Files\PHP).

Extract your download version NEXT to the existing version and rename with -new. Like below.

Directory structure after extracting and renaming

You will want Notepad++ (with the Compare add-on) or a similar Text File Comparison tool.

You want to compare the CURRENT php.ini and the NEW php.ini-production for changes.

IMPORTANT: If you have used WebPI for the original PHP installation, most of the changes will be at the very end of the current PHP.ini. Especially things like Extensions. Do not miss these as I did.

Copy across all relevant settings from the CURRENT to the NEW php.ini-production (and make note of any newly introduced settings).

Copy and rename the NEW php.ini-production to php.ini within the NEW dir.

Shutdown IIS from IIS Manager (the Server level not the site level).

Swap the PHP Directory names round.

After Renaming Directories

Startup IIS.

Acknowledgments

https://www.itgeekrambling.co.uk/wordpress-manual-update-of-php-7-x-on-iis/