I'm trying to install composer using a tutorial, on Ubuntu 18.04. I'm having the following error message:
$ sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
[sudo] password :
All settings correct for using Composer
Downloading...
Could not write to file "/usr/local/bin/composer": rename(/usr/local/bin/composer-temp.phar,/usr/local/bin/composer): Is a directory
Retrying...
Could not write to file "/usr/local/bin/composer": rename(/usr/local/bin/composer-temp.phar,/usr/local/bin/composer): Is a directory
Retrying...
Could not write to file "/usr/local/bin/composer": rename(/usr/local/bin/composer-temp.phar,/usr/local/bin/composer): Is a directory
The download failed repeatedly, aborting.Thank you for any help.
21 Answer
I have deleted /usr/local/bin/composer and started the installation process from the begining and it worked now.
When I enter the following command, I'm getting the following error message:
$ composer
In JsonFile.php line 98: Could not read /home/tonguim/.composer/config.json file_get_contents(/home/tonguim/.composer/config.json): failed to open stre am: Permission deniedBut when using
$ sudo composer
I'm getting everything right as follow:
______ / ____/___ ____ ___ ____ ____ ________ _____ / / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/ /_/
Composer version 2.0.12 2021-04-01 10:14:59To run composer without being sudom I did the following:
// Clear cache
composer clearcache
// OR
composer clear-cache
// Completely remove the cache directory
sudo rm -rf ~/.composer