you are trying to update composer and you have this message

rename(/home/runner/.composer/cache/composer-temp.phar,/usr/bin/composer): Permission denied

or this one

Filesystem exception:
  Composer update failed: "C:\ProgramData\ComposerSetup\bin\composer.phar" could not be written.
  rename(...composer-temp.phar,...composer.phar): Accès r
efusé (code: 5)

WINDOWS

for windows i tryed with administrator terminal and also by according all control (authorities) on the folder bin and all its files but i never succeded to update

* I havn’t see if it is related to the manner of installation of composer (curl or installer copmposer-setup.exe)

so tryed only with cmd i never succeded so i removed current installated composer and installed new one with the composer-setup.exe, with this new installation i m on the last most stable version of composer and i have no problem on installing packages since then.

to do:
open the control panel.
click on uninstall a program
search for your composer
select this and click on uninstall

* if it is related to installation manner (curl/exe) please write it in a comment

LINUX

in linux system it works well if you login as root so use sudo with the command like this

sudo composer self-update

i dont recommend to use su and fully switch user (role) to root for security reason

hope i helped

thank you

Aller au contenu principal