How to enable mod_rewrite in Apache?
November 11, 2017
Installing Node.js via package manager
November 11, 2017
Show all

Install PHP Composer on Ubuntu 16.04

Introduction

PHP Composer is a package management system for PHP which prevents users from having to “reinvent the wheel” when it comes to commonly-used website components like user authentication or database management. Composer is modeled on other popular package management systems like Ruby’s Bundler.

Note: For any 1&1 Cloud Server with Plesk, applications like PHP Composer should always be installed and managed through the Plesk interface.

Composer vs PEAR

PEAR was the first substantial package management system for PHP. However, PEAR has fallen out of favor with developers in recent years.

Due to the difficult process of getting packages approved for inclusion with PEAR, many of the packages available through PEAR are out of date. PEAR also requires users to install packages system-wide, whereas Composer allows you to install packages either system-wide or on a per-project basis.

Composer also tends to be better at handling dependencies, has a wider and more up-to-date codebase, and is more actively maintained.

Requirements

  • A 1&1 Cloud Server running Linux (Ubuntu 16.04)
    • PHP installed and configured, version 5.3.2 or higher

Use the command  php -v to check your PHP version:

In this example, the server is running PHP version 7.0.13.

Install PHP Composer

Update your packages:

Install the  curl utility:

Download the installer:

Move the  composer.phar file:

Use the  composer command to test the installation. If Composer is installed correctly, the server will respond with a long list of help information and commands:

Leave a Reply

Your email address will not be published. Required fields are marked *