If you are stuck on PHP 5.3 through 7.2, you should use Composer 2.2 , which is the Long-Term Support (LTS) version designed for older PHP environments. Introduction - Composer
If you are looking to download Composer 2.0 or upgrade your current setup, here is everything you need to know to get started. composer 2.0 download
Alternatively, macOS users can use : brew install composer . How to Upgrade from Version 1.x If you are stuck on PHP 5
Composer 2.0 represents a massive leap for PHP developers, offering up to and significantly lower memory usage than its predecessor. How to Upgrade from Version 1
If you already have Composer installed, you don't need to download a new file manually. Simply run: composer self-update --2 Use code with caution.
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php composer-setup.php php -r "unlink('composer-setup.php');" Use code with caution. To make it globally accessible, move the file: sudo mv composer.phar /usr/local/bin/composer Use code with caution.
Composer now checks your PHP version and extensions at runtime. If your environment doesn't match the project's requirements, it will throw a clear error immediately to prevent hidden bugs.