To change the system PHP version on a Plesk for Windows server, follow the steps below. This will apply to all sites hosted on the server by default unless a custom PHP version is set for a specific site.
Prerequisites #
- A windows server
- Access to RDP Admin Account
- PHP installed on the servers.
Step by Step #
Step 1. Log in to the server remotely #
- You could use an RDP client, like Remmina or any other that you prefer to access RDP. Logins to the server will be provided by your server provider
Step 2. Check the current default PHP version #
- OPen the command prompt and type the command below, to see the default PHP version
php -v
- You will get an output like this below.

- We can see from the image above that the PHP version is 8.1.30
If you got an error when running the php -v command, then proceed to step 3 below, otherwise jump to step 4
Step 3. Fix the php
is not recognized. Error, if you get it #
You could also get an error when you run the php -v command, which says that the php
is not recognized. In this case it means PHP is not in your system’s PATH
environment variable. You can add the appropriate PHP folder to the PATH
or explicitly specify the full path to the PHP executable
- Get a full path to your PHP executable. Normally they would be in this location below
C:\Program Files (x86)\Plesk\Additional

- Copy a full path to one of the PHP folders, the one you prefer as the system default. You will paste this in a later step.
- In the code below, I like below, I have taken a path to PHP8.1 executable.
C:\Program Files (x86)\Plesk\Additional\PleskPHP81
- Once you have that path, go to the search box, near the start icon, and search for Environment Variables
- Click on Edit System Environment Variables

- From the resulting System Properties Window, click on Environment Variables
- A new window with Environment Variables will pop.
- Under System variables, click on Path, then on Edit

- Click on New, to add a New Environment variable.
- In the new variable slot, paste the full path to the PHP executable, which you had copied earlier
- Once done click on OK and close all the windows by clicking on OK

- Close your open command prompt sessions and open a new session again.
- Type the php -v command again to see the current version, that you had set in the Environment variable path

Step 4. Change the System PHP version
- If you just hopped here from step 2, then you just had a safe landing. I suppose you had php -v returning a PHP version that you do not want as your system default. Perfect!
- Now to change that, go to the search box, near the start icon, search for Environment Variables
- Click on Edit System Environment Variables

- From the resulting System Properties Window, click on Environment Variables
- A new window with Environment Variables will pop.
- Under System variables, click on Path, then on Edit

- Click on New, to add a New Environment variable.
- In the new variable slot, paste the full path to the PHP executable, for the PHP version that you want to be default. It could be something like this below. This part is explained in section 3
C:\Program Files (x86)\Plesk\Additional\PleskPHP82
- Once done click on OK and close all the windows by clicking on OK
- Click on Path again, and then on Edit
- Move the new PHP variable that you just added, above the one that was existing. E.g, if you had a variable that leads to PHP8.1, and you have just added one for PHP8.2, move the PHP8.2 to be above the PHP8.1, in the list

- From the imabe below, you see that PHP82 is above PHP81

- Click OK to save changes, then click on OK for each other open window to close it.
- Go and re-open your Command prompt sessions and run php -v

- If you still see the older version, then go to the Environment variables and delete the older PHP path, and leave only one path for your preferred version of PHP
- Re-opening CMD and running php -v will now show you your preferred version

Note:
For your domains to pick this change, you may need to Restart their Dedicated IIS Pool, from your Plesk Panel. If your server is with Truehost Cloud and you do not have access to Dedicated IIS Pool, please check with our support team for help.