{"id":17383,"date":"2022-06-02T06:01:42","date_gmt":"2022-06-02T06:01:42","guid":{"rendered":"https:\/\/linuxways.net\/?p=17383"},"modified":"2022-06-02T06:01:42","modified_gmt":"2022-06-02T06:01:42","slug":"how-to-install-composer-on-debian","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/how-to-install-composer-on-debian\/","title":{"rendered":"How to Install Composer on Debian"},"content":{"rendered":"<p>Debian, sometimes known as Debian GNU\/Linux, is a free and open-source Linux system developed by the Debian Project, which is supported by the community. Ian Murdock essentially started this project on August 16, 1993. Debian is normally considered as one of the most extensively used Linux distributions. Debian releases new distributions on a regular basis, with the next candidate following a time-based freeze.<\/p>\n<p>Composer is a popular PHP dependency management solution that was designed to make project dependency installation and updates easier. It will determine which other packages a project requires and install them for you, using the right versions based on the project&#8217;s needs. When the composer installs a package for your project, it checks to see whether any other dependencies are required. If it&#8217;s required, the composer has a key job to play; it begins the installation process. Laravel, Symfony, Magento, and Drupal are just a few examples of current PHP frameworks and platforms that employ this tool for their convenience.<\/p>\n<p>You&#8217;ll learn the steps to install PHP Composer on Debian and how to update this composer through this article.<\/p>\n<h2>PHP Composer Installation<\/h2>\n<p>Before installing PHP Composer in Debian, it&#8217;s a good idea to update and upgrade the system&#8217;s packages first.<\/p>\n<p>In order to refresh the system&#8217;s cache repository, run the following command:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre><strong>$ sudo apt update<\/strong><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"697\" height=\"181\" class=\"wp-image-17384\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/text-description-automatically-generated-27.png\" alt=\"Text Description automatically generated\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/text-description-automatically-generated-27.png 697w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/text-description-automatically-generated-27-300x78.png 300w\" sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/p>\n<p>Type the following command in order to upgrade the system&#8217;s installed packages:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre><strong>$ sudo apt upgrade<\/strong><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"577\" height=\"153\" class=\"wp-image-17385\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/a-picture-containing-table-description-automatica.png\" alt=\"A picture containing table Description automatically generated\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/a-picture-containing-table-description-automatica.png 577w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/a-picture-containing-table-description-automatica-300x80.png 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/p>\n<p>After you&#8217;ve updated and upgraded your system&#8217;s packages, run the command below to install certain important packages for PHP composer installation:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre><strong>$ sudo apt install php-cli wget unzip php-zip<\/strong><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"723\" height=\"429\" class=\"wp-image-17386\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/a-screenshot-of-a-computer-description-automatica-3.png\" alt=\"A screenshot of a computer Description automatically generated\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/a-screenshot-of-a-computer-description-automatica-3.png 723w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/a-screenshot-of-a-computer-description-automatica-3-300x178.png 300w\" sizes=\"auto, (max-width: 723px) 100vw, 723px\" \/><\/p>\n<p>Type &#8220;y&#8221; and press &#8220;Enter&#8221; to begin the installation process.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"721\" height=\"395\" class=\"wp-image-17387\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/a-screenshot-of-a-computer-description-automatica-4.png\" alt=\"A screenshot of a computer Description automatically generated with medium confidence\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/a-screenshot-of-a-computer-description-automatica-4.png 721w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/a-screenshot-of-a-computer-description-automatica-4-300x164.png 300w\" sizes=\"auto, (max-width: 721px) 100vw, 721px\" \/><\/p>\n<p>Your Debian system now has all of the required fundamental packages installed. Now, using the wget command-line utility, download the composer&#8217;s PHP-based installer:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre><strong>$ wget -O composer-setup.php <\/strong><a href=\"https:\/\/getcomposer.org\/installer\"><strong>https:\/\/getcomposer.org\/installer<\/strong><\/a><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"717\" height=\"266\" class=\"wp-image-17388\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/graphical-user-interface-text-application-email-4.png\" alt=\"Graphical user interface, text, application, email Description automatically generated\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/graphical-user-interface-text-application-email-4.png 717w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/graphical-user-interface-text-application-email-4-300x111.png 300w\" sizes=\"auto, (max-width: 717px) 100vw, 717px\" \/><\/p>\n<p>It&#8217;s time to install the composer after you&#8217;ve downloaded the installer. There are two ways to install Composer on Debian. You can choose between these two methods to install it on your PC.<\/p>\n<ul>\n<li>Installing a Composer Using a Local Method<\/li>\n<li>Installing a Composer Using a Global Method<\/li>\n<\/ul>\n<h3>Install PHP Composer Locally<\/h3>\n<p>If you wish to install in a project directory, you must first download the composer file from the root directory using the following command:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre><strong>$ sudo php composer-setup.php --install-dir=\/project_directory<\/strong><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"724\" height=\"25\" class=\"wp-image-17389\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/word-image-128.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/word-image-128.png 724w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/word-image-128-300x10.png 300w\" sizes=\"auto, (max-width: 724px) 100vw, 724px\" \/><\/p>\n<p>After running this command, simply use the change directory command to get to the project&#8217;s directory, and then type the following command to use the PHP composer in that project\u2019s directory:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre><strong>$ sudo php composer.phar<\/strong><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>You can utilize PHP composer in your project after running the command above.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"405\" height=\"23\" class=\"wp-image-17390\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/word-image-129.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/word-image-129.png 405w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/word-image-129-300x17.png 300w\" sizes=\"auto, (max-width: 405px) 100vw, 405px\" \/><\/p>\n<h3>Install PHP Composer Globally<\/h3>\n<p>To download the composer file to your bin directory on your PC, run the following command:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre>$ <strong>sudo php composer-setup.php --install-dir=\/usr\/local\/bin --filename=composer<\/strong><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"721\" height=\"184\" class=\"wp-image-17391\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/graphical-user-interface-text-description-automa-3.png\" alt=\"Graphical user interface, text Description automatically generated\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/graphical-user-interface-text-description-automa-3.png 721w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/graphical-user-interface-text-description-automa-3-300x77.png 300w\" sizes=\"auto, (max-width: 721px) 100vw, 721px\" \/><\/p>\n<p>You can use the PHP composer by simply performing the command below after running the above-mentioned procedure:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre><strong>$ sudo composer<\/strong><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"95\" class=\"wp-image-17392\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/table-description-automatically-generated-with-me.png\" alt=\"Table Description automatically generated with medium confidence\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/table-description-automatically-generated-with-me.png 720w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/table-description-automatically-generated-with-me-300x40.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/p>\n<p>It will advise you not to run composer as root, but if you do, type &#8220;yes&#8221; and hit &#8220;Enter,&#8221; and the PHP composer will begin to work normally. <img loading=\"lazy\" decoding=\"async\" width=\"724\" height=\"379\" class=\"wp-image-17393\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/text-letter-description-automatically-generated.png\" alt=\"Text, letter Description automatically generated\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/text-letter-description-automatically-generated.png 724w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/text-letter-description-automatically-generated-300x157.png 300w\" sizes=\"auto, (max-width: 724px) 100vw, 724px\" \/><\/p>\n<p>In this article, we have finally discussed how to install PHP Composer on your Debian Linux system.<\/p>\n<h2>Update PHP Composer<\/h2>\n<p>If its new version is available and you want to upgrade your older version on your Debian Linux system, use the command to update your PHP Composer:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre><strong>$ sudo composer self-update<\/strong><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"101\" class=\"wp-image-17394\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/a-picture-containing-graphical-user-interface-des-1.png\" alt=\"A picture containing graphical user interface Description automatically generated\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/a-picture-containing-graphical-user-interface-des-1.png 720w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/05\/a-picture-containing-graphical-user-interface-des-1-300x42.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/p>\n<p>The PHP composer will be updated to the most recent version with this command.<\/p>\n<h2>Conclusion<\/h2>\n<p>In this tutorial, we learned how to install the PHP Composer essential packages and how to install PHP Composer locally or globally on a Debian Linux system. This article also explains how to update the PHP composer that is installed on a Debian Linux system.<\/p>","protected":false},"excerpt":{"rendered":"<p>Debian, sometimes known as Debian GNU\/Linux, is a free and open-source Linux system developed by the Debian Project, which is supported by the community. Ian Murdock essentially started&hellip;<\/p>","protected":false},"author":1,"featured_media":17507,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[297,122],"class_list":["post-17383","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian","tag-composer","tag-debian-2"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/17383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=17383"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/17383\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/17507"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=17383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=17383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=17383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}