Skip to content

Commit

Permalink
Check extension_dir before installing a PHP extension
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Oct 21, 2019
1 parent 7f02fbb commit 86a088c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions PhpManager/public/Install-PhpExtension.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
} else {
$phpVersion = [PhpVersionInstalled]::FromPath($Path)
}
if ($phpVersion.ExtensionsPath -eq '') {
throw 'The PHP extension directory is not configured. You may need to set the extension_dir setting in the php.ini file'
}
if (-Not(Test-Path -LiteralPath $phpVersion.ExtensionsPath -PathType Container)) {
throw "The PHP extension directory ""$($phpVersion.ExtensionsPath)"" configured in your php.ini does not exist. You may need to create it, or fix the extension_dir setting in the php.ini file."
}
$tempFolder = $null
try {
if (Test-Path -Path $Extension -PathType Leaf) {
Expand Down

0 comments on commit 86a088c

Please sign in to comment.