You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If (-Not(Test-Path-Path $exePath-PathType Leaf)) {
44
+
Throw"Unable to find php.exe in the downloaded archive"
45
+
}
46
+
&$exePath@('-n','-v') |Out-Null
47
+
If ($LASTEXITCODE-eq$Script:STATUS_DLL_NOT_FOUND) {
48
+
Switch ($PhpVersion.VCVersion) {
49
+
6 { $redistName='6' } # PHP 5.2, PHP 5.3
50
+
7 { $redistName='2002' }
51
+
7.1 { $redistName='2003' }
52
+
8 { $redistName='2005' }
53
+
9 { $redistName='2008' } # PHP 5.4
54
+
10 { $redistName='2010' }
55
+
11 { $redistName='2012' } # PHP 5.5, PHP 5.6
56
+
12 { $redistName='2013' }
57
+
14 { $redistName='2015' } # PHP 7.0, PHP 7.1
58
+
15 { $redistName='2017' } # PHP 7.2
59
+
default {
60
+
Throw ('The Visual C++ '+$PhpVersion.VCVersion+' Redistributable seems to be missing: you have to install it manually (we can''t recognize its version)')
61
+
}
62
+
}
63
+
If (-Not($InstallVCRedist)) {
64
+
Throw"The Visual C++ $redistName Redistributable seems to be missing: you have to install it manually"
65
+
}
66
+
If (-Not(Get-Module-Name VcRedist)) {
67
+
Throw"The Visual C++ $redistName Redistributable seems to be missing: you have to manually install it (if you install the VcRedist PowerShell module we could try to install it automatically)"
Throw"The Visual C++ $redistName Redistributable seems to be missing: you have to manually install it (the VcRedist PowerShell module doesn't support it)"
76
+
}
77
+
}
78
+
Write-Output"Downloading the Visual C++ $redistName Redistributable (it's required by this version of PHP)"
79
+
$temporaryDirectory2=New-TempDirectory
80
+
Try {
81
+
$vcList|Get-VcRedist-Path $temporaryDirectory2
82
+
Write-Output"Installing the Visual C++ $redistName Redistributable"
Copy file name to clipboardExpand all lines: PhpManager/public/Install-Php.ps1
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,9 @@ function Install-Php() {
34
34
Specify if you want to add the PHP installation folder to the user ('User') or system ('System') PATH environment variable.
35
35
Please remark that using 'System' usually requires administrative rights.
36
36
37
+
.ParameterInstallVC
38
+
Specify this switch to try to install automatically the required Visual C++ Redistributables (requires the VcRedist PowerShell package, and to run the process as an elevated user).
39
+
37
40
.ParameterForce
38
41
Use this switch to enable installing PHP even if the destination directory already exists and it's not empty.
39
42
#>
@@ -54,6 +57,7 @@ function Install-Php() {
54
57
[Parameter(Mandatory=$false,Position=5,HelpMessage='Specify if you want to add the PHP installation folder to the user (''User'') or system (''System'') PATH environment variable')]
0 commit comments