Web development basic and advance tutorial, php basic tutorial, laravel basic tutorial, React Native tutorial

Sunday, May 28, 2023

How to install composer in laravel | MAC OS Composer not found in Mac OS

0 comments

How to install composer in Laravel 


Composer is a tools of dependencies in php. if you look at the project you can see. this there is a composer.json. there is a require area, there is a 
  • php version 
  • laravel framework
For installing the composer in your mac os just go to this URL

https://getcomposer.org/download/

then open your terminal put this one by one 

  1. php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  2.  php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
  3.  php composer-setup.php
  4. php -r "unlink('composer-setup.php');"

Now test composer is found or not

put terminal composer and then press enter. if composer is not found

run this command in terminal again.

mv composer.phar /usr/local/bin/composer

Then check again if its found with composer in terminal.

No comments:

Post a Comment