2

suddenly in my project with laravel 8 I ran composer to uninstall a dependency that I want to reinstall for a sense nothing more than order and start from scratch and I started to throw this error that has to do with Symfony Process:

PHP Fatal error: Uncaught TypeError: fclose (): Argument # 1 ($ stream) must be of type resource, bool given in phar: // C: /ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/process/ Pipes / WindowsPipes.php: 71

What can be the mistake? I read something like that has to do with the update of the symfony Process but I don't know why. The only thing I did was install Laravel / Passport for the use of token in the user login.

Tom aguilera
  • 55
  • 1
  • 3
  • 9

1 Answers1

3

Whilst running PHP 8 on Windows I too had this error. I tried to clear out the temp directory manually per Composer loading from cache - when that didn't work. I also found that composer's symfony usage had locked a temp file in an odd way.

I needed to clear the temp file, and I used filelocker to unlock it, easily enough. Once I had unlocked and deleted the file, I was able to run composer as expected again.

Here is a related stack overflow question about the temp file location: Composer install: error on temporary file (%USERPROFILE%\AppData\Local\Temp works for me)

They have names like 'sf_proc_00.err'. I found them easily by sorting the temp files by date, and only trying to remove the ones modified today.

A reboot, or identifying the symfony process tying up the temp file would also work. According to file locked - it was an instance of mingw git for me.

Stephan Vierkant
  • 9,674
  • 8
  • 61
  • 97
Kyle Wiering
  • 444
  • 5
  • 15