I followed the documentation on https://getcomposer.org/doc/00-intro.md#globally to install composer globally on arch linux. When I do composer self-update
, I get this message:
[ErrorException]
rename(/home/hannes/.composer/cache/composer-temp.phar,/usr/local/bin/composer): Permission denied
The permissions in /usr/local/bin/
(I changed them to 777, but it did not help):
-rwxrwxrwx 1 hannes users 1104202 30. Mai 18:07 composer
In my home directory I did this:
sudo chmod -R 777 .composer/
In /etc/php/php.ini
, the open_basedir
looks so:
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/usr/local/bin/
I also tried sudo composer self-update
but it did not work as well and is possibly not the right way. (?). What else could I try to make this work?
Even after moving the file via
sudo mv composer.phar /usr/local/bin/composer
I was getting a permission error when trying to run thecomposer
command.sudo chmod 755 /usr/local/bin/composer
fixed things for me.this might be the case if you have downloaded
composer.phar
directly ,but not by running
php composer-setup.php
make
composer.phar
executable with following command before moving it to/usr/local/bin/composer
or after movingsudo chmod 755 composer.phar
composer-setup.php will make this change for us by default