Skip to main content
Version: 7.0

Windows Server

danger

Before updating PHP, if Passwork is installed in a cloud/virtual environment, create a snapshot of the OS virtual state to restore functionality in case of an incorrect update.

Downloading PHP

Open a web browser on the server where Passwork is installed and go to the link to get PHP 8.3 — https://repos.passwork.pro/repository/windows_packages/php_build/83/php_latest.zip

info

Note that this archive includes the x64 version of PHP.

Extract the contents of the archive to — C:\Program Files\:

Changing version

Go to — Server ManagerToolsIIS Manager:

Searching password by browser extension

Expand the Passwork website and go to — PHP Manager:

Example of opening PHP Manager

Register the new PHP version by specifying the path — C:\Program Files\php8.3\php-cgi.exe:

Location of php-cgi.exe

Go to — Turn On or Off Extensions and activate additional modules:

Example of activated PHP extensions

Restart the Passwork website:

Restarting the Passwork website

Remove outdated PHP versions from the PATH environment variable using PowerShell:

function Remove-OldPhpPaths($target) {
$envRecords = [System.Environment]::GetEnvironmentVariable("Path", $target) -split ";"
$phpPathsToRemove = $envRecords | Where-Object {
($_ -imatch "php") -and ((Split-Path $_ -Leaf) -imatch '^(?:v?(?:php)?)?(?<version>\d+\.\d+)$')
}

if ($phpPathsToRemove.Count -gt 0) {
$newPath = $envRecords | Where-Object { $phpPathsToRemove -notcontains $_ }
[System.Environment]::SetEnvironmentVariable("Path", ($newPath -join ";"), $target)
Write-Host "Outdated PHP version removed from the PATH environment variable" -ForegroundColor Green
} else {
Write-Host "Outdated PHP version not found in the PATH environment variable"
}
}

Remove-OldPhpPaths "User"
Remove-OldPhpPaths "Machine"

Add PHP to the PATH environment variable using PowerShell:

[System.Environment]::SetEnvironmentVariable("PATH", [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::Machine) + ";C:\Program Files\php8.3", [System.EnvironmentVariableTarget]::Machine)
$env:Path = [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::Machine)