13

When I am trying to self-update my composer, I get "Permission Denied" error.

Even when I use sudo /usr/bin/composer.phar self-update, it shows me command not found.

Please help me I have no idea about composer

iivannov
  • 4,341
  • 1
  • 18
  • 24
Jackaroo Ng
  • 585
  • 2
  • 6
  • 19

2 Answers2

8

Try following command:

sudo php /usr/bin/composer.phar self-update

Make sure composer.phar file exist in "/usr/bin"

Krunal
  • 317
  • 1
  • 7
  • i'm having same error as above. and the composer.phar file does not exist in the usr/bin. – TopTomato Feb 25 '17 at 00:45
  • You can try this command even when composer self-update is giving error of Permission Denied. – Rashmi Jain Jul 05 '17 at 08:24
  • 1
    Please note that (currently) running the selfupdate command with sudo, changes the owner of the cache directories inside your current users homedir. In order to avoid derived permission problems, change back ownership of the cache directories: sudo chown -R : /home//.composer – andkrup Feb 05 '20 at 11:24
6

CentOS7

sudo /usr/local/bin/composer self-update
Andrey Ivasko
  • 161
  • 1
  • 4