PHP Composer Basics
On all platforms, you can download and use
composer.phar directly. Go to the downloads page and scroll to the "Manual Download" section. The latest version at the time of writing is 1.10.0. You will of course need PHP installed also.
php composer.phar --help
To help with the setup process, you can use a composer setup script. Download this file and name it
# You can delete `composer-setup.php` after running php composer-setup.php composer --help
In MacOS, you can also use Homebrew to install:
brew install composer composer --help
choco install composer composer --help
Start a new project
To start a new project, you simply need a
composer.json file. You can generate one using the command:
This will create a
composer.json with your project information like name and dependencies. As long as you have a
name entry in your
composer.json then you can import your project in to other composer projects as a dependency.