mlocati / powershell-phpmanager

A PowerShell module to install/update PHP, PHP extensions and Composer on Windows

Home Page:https://www.powershellgallery.com/packages/PhpManager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use in a xampp instalation

luismanuelmontoro opened this issue · comments

I cant use Install-PHPExtension in my preinstaled PHP XAMP I tryed:

Install-PhpExtension imagick -MinimumStability snapshot

Install-PhpExtension imagick C:\XAMPP\PHP -MinimumStability snapshot
and
Install-PhpExtension imagick -MinimumStability snapshot C:\XAMPP\PHP

THis is the error

PS C:\WINDOWS\system32> Install-PhpExtension imagick -MinimumStability snapshot
Move-Item : No se puede encontrar una parte de la ruta de acceso.
En C:\Users\Luis Manuel\Documents\WindowsPowerShell\Modules\PhpManager\1.10.2.142\public\Install-PhpExtension.ps1: 143 Carácter: 17

  • ... Move-Item -Path $dllPath -Destination $newExtensionFilena ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : WriteError: (C:\Users\Luis M...php_imagick.dll:FileInfo) [Move-Item], DirectoryNotFoundException
    • FullyQualifiedErrorId : MoveFileInfoItemIOError,Microsoft.PowerShell.Commands.MoveItemCommand

If C:\XAMPP\PHP is the path to your PHP installation (the location of your php.exe and php.ini), then try running:

Get-Php C:\XAMPP\PHP

What does that output?

If that works, try using the Php-Switcher to alias your PHP installation:

Initialize-PhpSwitcher -Alias C:\PHP\CurrentVersion -Scope CurrentUser

Now:

Add-PhpToSwitcher -Name 5.6 -Path C:\XAMPP\PHP

Substituting 5.6 for whatever your PHP version is.

Now:

Switch-Php 5.6

Then you will need to point your XAMPP Apache config httpd.conf to the new directory:

LoadModule php5_module "C:/PHP/CurrentVersion/php5apache2_4.dll"
PHPIniDir "C:/PHP/CurrentVersion"

Now you should be able to run:

Install-PhpExtension imagick