https://www.w3resource.com/php/composer/create-publish-and-use-your-first-composer-package.php

 

 

First check the version of composer if its intalled

composer -v;

Download the composer version like 

https://getcomposer.org/download/1.9.3/composer.phar)

Now in directory where composer.phar is located run

php composer.phar install

It will install composer.Thats it

Find all composer path

whereis composer

Downgrade the composer from 2 to 1

composer self-update --1
 

If you want to return to Composer 2 again.

composer self-update --2
 

Increase the Memory

COMPOSER_MEMORY_LIMIT=-1 composer update
 
COMPOSER_MEMORY_LIMIT=-1 php composer.phar ....
 

set COMPOSER_MEMORY_LIMIT=99999999999&& php -d memory_limit=-1 composer.phar create-project –repository-url=https://repo.magento.com/ magento/project-community-edition magento2