Install 64bit version of PHP on windows

This commit is contained in:
Shivam Mathur 2019-12-18 17:50:25 +05:30
parent 51c7527bd8
commit 2d3750b36e
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -33,11 +33,13 @@ if (Test-Path -LiteralPath $php_dir -PathType Container) {
} }
Step-Log "Setup PHP and Composer" Step-Log "Setup PHP and Composer"
if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.')))) { if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.')))) {
$arch='x64'
if ($version -lt '7.0') { if ($version -lt '7.0') {
Install-Module -Name VcRedist -Force Install-Module -Name VcRedist -Force
$arch='x86'
} }
Install-Php -Version $version -Architecture x86 -ThreadSafe $true -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force >$null 2>&1 Install-Php -Version $version -Architecture $arch -ThreadSafe $true -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force >$null 2>&1
$installed = Get-Php -Path $php_dir $installed = Get-Php -Path $php_dir
$status = "Installed PHP $($installed.FullVersion)" $status = "Installed PHP $($installed.FullVersion)"
} }