diff --git a/images/win/scripts/Installers/Install-PHP.ps1 b/images/win/scripts/Installers/Install-PHP.ps1 index 02d38931d..72db2ee27 100644 --- a/images/win/scripts/Installers/Install-PHP.ps1 +++ b/images/win/scripts/Installers/Install-PHP.ps1 @@ -10,8 +10,11 @@ Import-Module -Name ImageHelpers $installDir = "c:\tools\php" choco install php -y --force --params "/InstallDir:$installDir" -# update path to extensions and enable curl and mbstring extensions -((Get-Content -path $installDir\php.ini -Raw) -replace ';extension=curl','extension=curl' -replace ';extension=mbstring','extension=mbstring' -replace ';extension_dir = "ext"','extension_dir = "ext"') | Set-Content -Path $installDir\php.ini +# Install latest Composer in chocolatey +choco install composer --ia "/DEV=$installDir /PHP=$installDir" + +# update path to extensions and enable curl and mbstring extensions, and enable php openssl extensions. +((Get-Content -path $installDir\php.ini -Raw) -replace ';extension=curl','extension=curl' -replace ';extension=mbstring','extension=mbstring' -replace ';extension_dir = "ext"','extension_dir = "ext"' -replace 'extension=";php_openssl.dll"','extension_dir = "php_openssl.dll"') | Set-Content -Path $installDir\php.ini # Set the PHPROOT environment variable. setx PHPROOT $installDir /M