How to Verify if you Already Have Composer 2.6.6 Installed | Easy Guide

If you alredy follow the steps to install composer 2.6.6 but you are not sure if if you already have it, here is how you can verify it.
In the previous versions you need to run composer or composer -v, but no if you run that command you probably are gonna get the following error:

Error:
PHP Parse error: syntax error, unexpected ‘ | ’ expecting variable (T_VARIABLE) in /
Parse error: syntax error, unexpected ‘ | ’ expecting variable (T_VARIABLE) in /
The solution of this error is very simple, in the version (2.6.6) you will need to run:
php composer.phar
After you run that command it should appear to you the next screen:

How to Install Composer 2.6.6?
If you realize you don’t have composer in your system here is an easy guide of how you can install composer 2.6.6.
To quickly install Composer in the current directory, run the following script in your terminal.
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
In the next command you need to get “Installer verified”, if you get “Installer corrupt” try again.
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Then, you most likely, you want to put the composer.phar
into a directory on your PATH, so you can simply call composer
from any directory (Global install), using for example:
sudo mv composer.phar /usr/local/bin/composer
The information of how you can install composer 2.6.6 is was getting from the Oficial Documentation of Composer.
I hope this article help you to verify if you already have composer installed or to install it, thanks for reading and follow me for more!