mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +00:00
Update Install-PHP.ps1 to include Composer
1. Install Composer from Chocolatey. PHP needs its dependency manager. 2. Enable php_openssl.dll - believe this is necessary in the case someone wants to update Composer. **Reference** https://chocolatey.org/packages/composer https://github.com/actions/virtual-environments/issues/587 https://superuser.com/questions/1010080/the-openssl-extension-is-missing-on-windows-while-installing-composer
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user