: This article describes how to install Composer on Mac. For more information about PHP tutorials, see. What is Composer? for details, refer to Composer's Chinese website or Baidu
This is the official website address.
------- Directly go to the installation link -----------------------
According to the official website
Curl-sS https://getcomposer.org/installer | php
Or
Php-r "readfile ('https: // getcomposer.org/installer');" | php
I am sorry for the failure because of Warning. Therefore, we can use the simplest method directly,
Step 1. go to the download page of the official website: https://getcomposer.org/download/, pull it directly to the bottom, and find latest Snapshot to download the file package.
After downloading it to your computer, you can directly use the composer command on the terminal.
Step 2. open the terminal, cd to the folder where composer. phar is downloaded, and run
Sudo mv composer. phar/usr/local/bin/composer
Well, use the administrator privilege. when you press composer on the terminal, it will appear.
-Bash:/usr/local/bin/composer: Permission denied
Then, set the permission for him.
SudoChmod-R 777/usr/local/bin/composer
When you type composer again, it is successful ~
The above describes how to install Composer on Mac, including the chmod content, and hope to help anyone interested in PHP tutorials.