How do i install a specific version of php in windows?

Introduction

My client gave me a question that they have a windows server which hosting multiple applications using IIS and some of apps are build with PHP and the version is 5.* and the new application they want to deploy is building with Laravel which required version 7.

So we are talking about “How to run multiple versions of PHP in IIS”.

Internet Information Services (IIS) server already supported PHP by extension and also able to specific version of PHP by application. — Here

After some google I found it so I think it’s good idea to have it on Medium.

Step 1: Validate your current version of PHP

Create phpinfo.php file and place in your test site

How do i install a specific version of php in windows?

Visit your phpinfo.php file to validate the current version

This case is 5.3

Step 2: Install new version of PHP using Web Platform Installer (Web PI)

Open Web Platform Installer in IIS Manager

Search for “php” and look for “PHP 7.*” or the version you want then click Add.

Once clicked Add the required component will be also added

Click I Accept, and wait for the download and installation.

Once it’s done click Finish, Now go and check you phpinfo.php if it works or not? if not please continue.

Step 3: Configuration

Validate FastCGI Settings by open the module

You will see new version (PHP7.2) is already set into FastCGI Settings. If not or you are already install with other way, click Add Application… and create one.

Now go to you Web Site, select Config Handler Mappings

Find *.php in Path column. You will notice that there is only old version mapped so we need to add new mapping by click Add Module Mapping…

Fill in the information

Note: Executable must be set to php-cgi.exe with specific version of PHP

Click Request Restrictions…, At Mapping select File or folder

At Verbs select All verbs or up to you.

At Access select Script

Click OK, then it will ask you the permission, click Yes.

Now try to refresh the phpinfo.php file you will see new version of PHP is executed.

Reorder the priority of version of PHP

In case you want to switch between versions, right click at the list of mappings and click View Ordered List…

Try to move it up/down by right click and click Move Up/Down

Now try to refresh phpinfo.php file you will see the version is changed.

How do I install a specific version of PHP?

Install PHP (5.6, 7..
First start by adding Ondřej Surý PPA to install different versions of PHP – PHP 5.6, PHP 7. x, and PHP 8.0 on the Ubuntu system. ... .
Next, update the system as follows. $ sudo apt-get update..
Now install different supported versions of PHP as follows..

How do I manually install PHP on Windows?

How to Install PHP.
Step 1: Download the PHP files. You'll need the PHP Windows installer. ... .
Step 2: Extract the files. ... .
Step 3: Configure php. ... .
Step 4: Add C:\php to the path environment variable. ... .
Step 5: Configure PHP as an Apache module. ... .
Step 6: Test a PHP file..

How do I switch between multiple PHP versions in Windows?

Change the config file for the MySQL in “my. ini” file. Run the code: PHP..
After changing the port click on save and exit..
Now go to the extra folder..
Changes to be done in the ssl CONF file..
Change the Listen 443 to 444..

How do I install PHP on Windows 10 latest version?

Follow the below steps to install PHP on Windows: Step 1: Visit https://www.php.net/ website using any web browser and click on Downloads. Step 2: Click on the Windows “Downloads” button. Step 3: The new webpage has different options, choose the Thread safe version, and click on the zip button and Download it.