Skip to content

Commit 86a088c

Browse files
committed
Check extension_dir before installing a PHP extension
1 parent 7f02fbb commit 86a088c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

PhpManager/public/Install-PhpExtension.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
} else {
5151
$phpVersion = [PhpVersionInstalled]::FromPath($Path)
5252
}
53+
if ($phpVersion.ExtensionsPath -eq '') {
54+
throw 'The PHP extension directory is not configured. You may need to set the extension_dir setting in the php.ini file'
55+
}
56+
if (-Not(Test-Path -LiteralPath $phpVersion.ExtensionsPath -PathType Container)) {
57+
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."
58+
}
5359
$tempFolder = $null
5460
try {
5561
if (Test-Path -Path $Extension -PathType Leaf) {

0 commit comments

Comments
 (0)