5

I have a problem with windows 10 and composer (last version). When I want to execute command "composer install" in my project, a symphony error is thrown:

[Symfony\Component\Process\Exception\RuntimeException]
A temporary file could not be opened to write the process output to, verify that your TEMP environment variable is writable

My TEMP variable is "%USERPROFILE%\AppData\Local\Temp". The folder exists and permissions are good.

Can anyone help me to find the problem please?

Thank you.

Licorn
  • 53
  • 1
  • 1
  • 3
  • This is strange. The temp folder is user-specific and has always full control from its owner - or should have... Please do a double-check on the UAC permissions of the folder. -- You might also run your composer command with `-vvv` to enable verbose output and get closer to the position of the problem. – Jens A. Koch Jan 12 '16 at 18:35

6 Answers6

9

Look into php.ini file for location of sys_temp_dir and check rights for this folder.

Pavel Hájek
  • 176
  • 1
  • 8
4

Also in order to clarify your TEMP directory run echo %TEMP%. Copy the output directory in terminal and paste it to sys_temp_dir in your php.ini exactly as it was said above.

1

For Windows, open Explorer and navigate to that folder. Try opening it.

When you get a UAC prompt, hit yes to give permission.

Bilbo Baggins
  • 3,644
  • 8
  • 40
  • 64
1

I had tried following all answers to no avail.

In my case, this error show up when I opened multiple Powershells and did php artisan serve in one of them then in new Powershell I wanted to install a composer package for another project.

Closing all other Powershells allow me to continue my work.

This is very basic but I hope this can help someone.

hijoem
  • 21
  • 5
0

I had the same problem I was using Xampp on Windows 10 and this solution worked for me: I changed value of sys_temp_dir in my php.ini to :

extension_dir="C:\xampp\php\ext"

And it worked!

0

Restarting my computer did the trick.

Eskay Amadeus
  • 275
  • 2
  • 11
  • Did you just restart, or did you restart after trying one of the suggested solutions? – Eric Aya Aug 24 '22 at 12:45
  • The other solutions didn't work for me. I suppose that closing the CLI and deleting the temporary files (prefixed with sf_proc_00) should work as well. – Eskay Amadeus Aug 24 '22 at 12:52