composer Javascript Laravel php
jovialcore  

The best way to install composer on linux ubuntu if you use xammp

Hi, the following technique you are about to employ will save you time having to install **php-cli ** via apt-get and php extensions on your linux when xammp already comes with php as a bundle.

Requirement:

  1. You already installed xammp
  2. Make sure you have followed step one…lol

Installing Composer

To install composer run the command below to allow ‘composer’ command to be run the following commands:

sudo curl -s https://getcomposer.org/installer | /opt/lampp/bin/php

After installation, we’ll have to symlink php bundle that comes along with after which we run the command below to allow ‘composer’ command to run globally (this will run from within the folder where you’ve just installed composer in which a composer.phar file has just been created).

Run the follwing command

sudo ln -s /opt/lampp/bin/php /usr/local/bin/php

Next, we’ll run the below command to allow composer to be reflect globally on the system
run the command below to allow ‘composer’ command to be

sudo mv composer.phar /usr/local/bin/composer

run the command below to allow ‘composer’ command to be

Bonus

If you already installed composer via apt-get but wish to use the xammp php bundle (since composer must require php-cli), you can do that by add the XAMPP php to environment variables.

Run the following command:

export PATH=$PATH:/opt/lampp/bin

Yep….That’s all! Let me know your thoughts!

Reference

Leave A Comment