In this article, we will have explained the necessary steps to install and configure PHP Composer on Ubuntu 20.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.
Composer is a popular dependency management tool for PHP, created mainly to facilitate installation and updates for project dependencies. It will check which other packages a specific project depends on and install them for you, using the appropriate versions according to the project requirements. Composer is also commonly used to bootstrap new projects based on popular PHP frameworks,
Install PHP Composer on Ubuntu 20.04
Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.
Step 2. Install PHP Composer on Ubuntu.
Run following command to download the latest PHP Composer version:
curl-sShttps://getcomposer.org/installer | php
Then, make PHP Composer globally available, move it to the binary folder /usr/local/bin as below:
At last, you can verify the installation by typing:
That’s all you need to do to install Composer on Ubuntu 20.04. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.