PHP Composer – Quick setup

The Composer is a dependency manager for PHP. This is a quick write up for installing and setting it up

Install composer

The composer is installed by downloading a setup file from getcomposer.org. It will generate a composer.phar file. Run this at root of the project.

The composer json file:

The composer.json contains all the dependencies for your project. It should be placed in the root of the project.

Install dependencies

The composer.phar will find the composer.json and install the dependencies in a vendor folder.

Using the installed dependencies

Use autoload.php to effortlessly access the dependencies in your php code.