Installing and Initializing Composer
Install Composer globally and create a composer.json project file.
What is Composer?
Composer is PHP's dependency manager. It downloads packages from Packagist, resolves version conflicts, and generates an autoloader.
Installing Composer Globally
Download the installer and move the phar to a system path.
# Download installer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composerAll lessons in this course
- Installing and Initializing Composer
- Requiring and Updating Packages
- Understanding composer.lock
- Composer Scripts and Autoloading