phar-io / phive

The Phar Installation and Verification Environment (PHIVE)
https://phar.io
BSD 3-Clause "New" or "Revised" License
571 stars 44 forks source link

phive install fails with "cannot fork where.exe" #428

Closed jfalch closed 1 month ago

jfalch commented 1 month ago

[C:\Temp]phive install phploc Phive 0.15.2 - Copyright (C) 2015-2024 by Arne Blankerts, Sebastian Heuer and Contributors [ERROR] An error occurred while processing your request:

      exec(): Unable to fork [where.exe "gpg"]

      #0 src/shared/environment/Environment.php(48)
      #1 unknown file(0): PharIo\Phive\Cli\Runner->errorHandler()
      #2 src/shared/environment/Environment.php(48): exec()
      #3 src/shared/config/Config.php(130): PharIo\Phive\Environment->getPathToCommand()
      #4 src/Factory.php(382): PharIo\Phive\Config->getGPGBinaryPath()
      #5 src/Factory.php(375): PharIo\Phive\Factory->getGnupg()
      #6 src/Factory.php(368): PharIo\Phive\Factory->getGnupgSignatureVerifier()
      #7 src/Factory.php(361): PharIo\Phive\Factory->getPharDownloader()
      #8 src/Factory.php(329): PharIo\Phive\Factory->getPharService()
      #9 src/Factory.php(101): PharIo\Phive\Factory->getInstallService()
      #10 src/commands/CommandLocator.php(42): PharIo\Phive\Factory->getInstallCommand()
      #11 src/shared/cli/Runner.php(241): PharIo\Phive\CommandLocator->getCommand()
      #12 src/shared/cli/Runner.php(95): PharIo\Phive\Cli\Runner->execute()
      #13 (354): PharIo\Phive\Cli\Runner->run()
      #14 {main}

      Environment: PHP 8.3.7 (on Windows NT 10.0)
      Phive Version: 0.15.2

      This should not have happened and is most likely a bug.
      Please report it at https://github.com/phar-io/phive/issues, make sure you include
      the full output of this error message. Thank you!

[C:\Temp]which where.exe where.exe ist ein externer Befehl: C:\WINDOWS\system32\where.exe

jfalch commented 1 month ago

N.B. this is on Windows 10.

theseer commented 1 month ago

Interesting crash - one I fail to reproduce.

When googling the "Unable to fork" error for windows though, it makes it seem like there are permission issues for the user phive is running under to execute external processes.

I'm not sure how to address this. Do you have any special restrictions on your system? Running phive as a somehow restricted user for instance?

jfalch commented 1 month ago

no, this is from a shell (cmd.exe) window, where I am running as my standard user, being admin. Actually this behaviour appears to be caused by my sh*tty antivir_etc program, Kaspersky - if I terminate that, phive runs without problem, gets the key, downloads and installs the phar. So, nothing to do for you ... sorry.

jfalch commented 1 month ago

PS I found out that this is caused by a component of Kaspersky called "activity monitor", intended for ransomware protection, which with the default settings appears to prevent all fork()-like calls ! Now trying to find out how to change that...