mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-13 05:16:47 +00:00
21 lines
801 B
PowerShell
21 lines
801 B
PowerShell
################################################################################
|
|
## File: Install-PHP.ps1
|
|
## Desc: Install PHP
|
|
################################################################################
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
Import-Module -Name ImageHelpers
|
|
|
|
# Install latest PHP in chocolatey
|
|
$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
|
|
|
|
# Set the PHPROOT environment variable.
|
|
setx PHPROOT $installDir /M
|
|
|
|
# Done
|
|
exit 0
|