How to install Composer with XAMPP on Linux (Ubuntu/Pop OS)

Afiv Dicky Efendy
2 min readApr 24, 2021
Photo by Ben on Unsplash

Hello everyone, this time I want to share my method of installing Composer on a linux operating system that already has the xampp application installed.

Previously I had a problem where to create or edit files in the htdocs folder you had to have root permissions, but finally I found a way to solve it where we can change the permissions of the htdocs folder like the steps below, happy reading!!!

What is Composer in PHP?

Composer is an application-level package manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries. It was developed by Nils Adermann and Jordi Boggiano, who continue to manage the project. They began development in April 2011 and first released it on March 1, 2012. Composer is strongly inspired by Node.js’snpm” and Ruby’sbundler”.The project’s dependency solving algorithm started out as a PHP-based port of openSUSE’s libzypp satsolver.

Composer runs from the command line and installs dependencies (e.g. libraries) for an application. It also allows users to install PHP applications that are available on “Packagist” which is its main repository containing available packages. It also provides autoload capabilities for libraries that specify autoload information to ease usage of third-party code.

Installation Steps:

Read this previously article below

Or

Download Xampp with link below

Change the permissions to the installer

chmod 755 xampp-linux-*-installer.run

Run the installer

sudo ./xampp-linux-*-installer.run

Then you must setting the path and variables to access xampp bundle globally

gedit ~/.bashrc 
or
gedit ~/.zshrc (if you use zsh shell)

add this in the file

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

After installation, you should then symlink it by running command:

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

Download Composer for linux

After downloaded, make composer can run globally

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

And the last one is change htdocs folder permission

sudo chmod 777 -R /opt/lampp/htdocs

Thank You for reading and don’t forget to clap this articel 🙌.

--

--

Afiv Dicky Efendy

Linux enthusiast who wants to share his knowledge through writing on the medium