0PricingLogin
PHP Academy · Lesson

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/composer

All lessons in this course

  1. Installing and Initializing Composer
  2. Requiring and Updating Packages
  3. Understanding composer.lock
  4. Composer Scripts and Autoloading
← Back to PHP Academy