install php and composer windows code example
Example 1: update composer on windows
php composer.phar self-update
Example 2: install composer phar
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Example 3: update composer mac
#Ubuntu-Download Composer and create a Phar (PHP Archive) file
$ curl -s https://getcomposer.org/installer | php
#Move it to bin directory
$ sudo mv composer.phar /usr/local/bin/composer
Example 4: windows install composer
Just to download
https://getcomposer.org/download/
Example 5: download composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Example 6: where do you install composer
// Adding permissions after installing Composer on Mac OSX
sudo chmod 755 /usr/local/bin/composer.phar