0

I am trying to install 'phpseclib3' PHP library via Composer but I am getting the following error:

Failed to download paragonie/random_compat from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source

In GitDownloader.php line 82:

  git was not found in your PATH, skipping source download

error

I installed Composer in C:\xampp\php\php.exe. And I tried following commands: (with same result)

composer require phpseclib/phpseclib:~3.0
composer require --prefer-dist phpseclib/phpseclib:~3.0

P.S. I am doing this because I want to use connect to external SFTP in a custom Wordpress plugin that I am building.

KWS
  • 21
  • 2
  • it appears that you do not have git and zip installed – Ken Lee Jun 03 '23 at 06:10
  • @KenLee Do I have to install those two inside Composer or generally on my Windows? – KWS Jun 03 '23 at 09:15
  • For the zip extension... in C:\xampp\php\ you'd want to open the php.ini in that directory and at, as a new line, `extension = ext/php_zip.dll`` (assuming that an ext directory exists in that path). For git... prob the easiest way to install that on Windows is to install https://desktop.github.com/ – neubert Jun 03 '23 at 11:05
  • That said, based on the "Now trying to download from source" message, if you get the zip extension working, then you prob won't need to have Git installed, anyway – neubert Jun 03 '23 at 12:48
  • @KWS: In regard to your question you only put into the comments so far: _"Do I have to install those two inside Composer or generally on my Windows?"_ - Please specify why you have not yet tried to do so. The error message would normally dictate to do this next unless you don't want to remove the road-block. This is why it is important if you ask on Stackoverflow (SO), you show what you have tried, that also means what you have tried _specifically_ **after** summoning an error message, not only the original command (which you could also share next to the original error msg.). Hope that helps. – hakre Jun 03 '23 at 13:53
  • And does this answer your question? https://stackoverflow.com/q/75050370/367456 – hakre Jun 03 '23 at 13:56

0 Answers0